33 DEFAULT_CHAT_FILE_MIME_TYPE ,
44 DEFAULT_MODEL_BY_PROVIDER ,
55 type ClaudeCodeEffort ,
6- type GitHubIssueDetail ,
7- type GitHubRef ,
86 type MessageId ,
97 type ProjectScript ,
108 type ModelSlug ,
@@ -184,7 +182,6 @@ import { deriveLatestContextWindowSnapshot } from "../lib/contextWindow";
184182import { shouldUseCompactComposerFooter } from "./composerFooterLayout" ;
185183import { selectThreadTerminalState , useTerminalStateStore } from "../terminalStateStore" ;
186184import { ComposerPromptEditor , type ComposerPromptEditorHandle } from "./ComposerPromptEditor" ;
187- import { IssueThreadDialog } from "./IssueThreadDialog" ;
188185import { PullRequestThreadDialog } from "./PullRequestThreadDialog" ;
189186import { MessagesTimeline } from "./chat/MessagesTimeline" ;
190187import { ChatHeader } from "./chat/ChatHeader" ;
@@ -221,7 +218,6 @@ import {
221218 deriveComposerSendState ,
222219 LAST_INVOKED_SCRIPT_BY_PROJECT_KEY ,
223220 LastInvokedScriptByProjectSchema ,
224- IssueDialogState ,
225221 PullRequestDialogState ,
226222 QueuedMessage ,
227223 readFileAsDataUrl ,
@@ -563,7 +559,6 @@ export default function ChatView({ threadId, onMinimize }: ChatViewProps) {
563559 const [ composerHighlightedItemId , setComposerHighlightedItemId ] = useState < string | null > ( null ) ;
564560 const [ pullRequestDialogState , setPullRequestDialogState ] =
565561 useState < PullRequestDialogState | null > ( null ) ;
566- const [ issueDialogState , setIssueDialogState ] = useState < IssueDialogState | null > ( null ) ;
567562 const [ pendingProjectScriptRun , setPendingProjectScriptRun ] = useState < {
568563 script : ProjectScript ;
569564 inputIds : string [ ] ;
@@ -746,24 +741,6 @@ export default function ChatView({ threadId, onMinimize }: ChatViewProps) {
746741 setPullRequestDialogState ( null ) ;
747742 } , [ ] ) ;
748743
749- const openIssueDialog = useCallback (
750- ( reference ?: string ) => {
751- if ( ! isLocalDraftThread ) {
752- return ;
753- }
754- setIssueDialogState ( {
755- initialReference : reference ?? null ,
756- key : Date . now ( ) ,
757- } ) ;
758- setComposerHighlightedItemId ( null ) ;
759- } ,
760- [ isLocalDraftThread ] ,
761- ) ;
762-
763- const closeIssueDialog = useCallback ( ( ) => {
764- setIssueDialogState ( null ) ;
765- } , [ ] ) ;
766-
767744 const openOrReuseProjectDraftThread = useCallback (
768745 async ( input : { branch : string ; worktreePath : string | null ; envMode : DraftThreadEnvMode } ) => {
769746 if ( ! activeProject ) {
@@ -826,68 +803,6 @@ export default function ChatView({ threadId, onMinimize }: ChatViewProps) {
826803 [ openOrReuseProjectDraftThread ] ,
827804 ) ;
828805
829- const handleStartIssueThread = useCallback (
830- async ( input : { issue : GitHubIssueDetail ; mode : "local" | "worktree" } ) => {
831- if ( ! activeProject ) {
832- return ;
833- }
834- // Extract owner/repo from the issue URL
835- let owner = "" ;
836- let repo = "" ;
837- try {
838- const url = new URL ( input . issue . url ) ;
839- const parts = url . pathname . split ( "/" ) . filter ( Boolean ) ;
840- if ( parts . length >= 2 ) {
841- owner = parts [ 0 ] ! ;
842- repo = parts [ 1 ] ! ;
843- }
844- } catch {
845- // Fallback: cannot parse URL
846- }
847-
848- if ( ! owner || ! repo ) {
849- return ;
850- }
851-
852- const githubRef = {
853- kind : "issue" as const ,
854- owner,
855- repo,
856- number : input . issue . number ,
857- } satisfies GitHubRef ;
858-
859- // Always create a fresh thread for an issue
860- clearProjectDraftThreadId ( activeProject . id ) ;
861- const nextId = newThreadId ( ) ;
862- setProjectDraftThreadId ( activeProject . id , nextId , {
863- createdAt : new Date ( ) . toISOString ( ) ,
864- runtimeMode : DEFAULT_RUNTIME_MODE ,
865- envMode : input . mode ,
866- githubRef,
867- } ) ;
868-
869- // Pre-populate the composer with an issue context prompt
870- const { setPrompt : storeSetPrompt } = useComposerDraftStore . getState ( ) ;
871- const labelsText =
872- input . issue . labels . length > 0
873- ? `Labels: ${ input . issue . labels . map ( ( l ) => l . name ) . join ( ", " ) } \n`
874- : "" ;
875- const bodyPreview = input . issue . body
876- ? input . issue . body . slice ( 0 , 2000 ) + ( input . issue . body . length > 2000 ? "\n..." : "" )
877- : "" ;
878- storeSetPrompt (
879- nextId ,
880- `Resolve GitHub issue #${ input . issue . number } : ${ input . issue . title } \n\n${ labelsText } ${ bodyPreview ? `${ bodyPreview } \n\n` : "" } Please analyze this issue and implement a fix.` ,
881- ) ;
882-
883- await navigate ( {
884- to : "/$threadId" ,
885- params : { threadId : nextId } ,
886- } ) ;
887- } ,
888- [ activeProject , clearProjectDraftThreadId , navigate , setProjectDraftThreadId ] ,
889- ) ;
890-
891806 useEffect ( ( ) => {
892807 if ( ! activeThread ?. id ) return ;
893808 if ( ! latestTurnSettled ) return ;
@@ -1609,11 +1524,6 @@ export default function ChatView({ threadId, onMinimize }: ChatViewProps) {
16091524
16101525 const pendingContext = useCodeViewerStore ( ( state ) => state . pendingContext ) ;
16111526 const clearPendingContext = useCodeViewerStore ( ( state ) => state . clearPendingContext ) ;
1612- const codeViewerOpen = useCodeViewerStore ( ( state ) => state . isOpen ) ;
1613- const toggleCodeViewer = useCodeViewerStore ( ( state ) => state . toggle ) ;
1614- const diffViewerOpen = useDiffViewerStore ( ( state ) => state . isOpen ) ;
1615- const openDiffViewerConversation = useDiffViewerStore ( ( state ) => state . openConversation ) ;
1616- const closeDiffViewer = useDiffViewerStore ( ( state ) => state . close ) ;
16171527 const openTurnDiffViewer = useDiffViewerStore ( ( state ) => state . openTurnDiff ) ;
16181528 const handleOpenTurnDiff = useCallback (
16191529 ( turnId : TurnId , filePath ?: string ) => {
@@ -1623,14 +1533,6 @@ export default function ChatView({ threadId, onMinimize }: ChatViewProps) {
16231533 [ activeThread , openTurnDiffViewer ] ,
16241534 ) ;
16251535
1626- const handleToggleDiffViewer = useCallback ( ( ) => {
1627- if ( diffViewerOpen ) {
1628- closeDiffViewer ( ) ;
1629- } else if ( activeThread ) {
1630- openDiffViewerConversation ( activeThread . id ) ;
1631- }
1632- } , [ diffViewerOpen , closeDiffViewer , activeThread , openDiffViewerConversation ] ) ;
1633-
16341536 // When Cmd+L is pressed in the code viewer, insert the @file:lines mention into the composer
16351537 useEffect ( ( ) => {
16361538 if ( ! pendingContext ) return ;
@@ -4853,8 +4755,6 @@ export default function ChatView({ threadId, onMinimize }: ChatViewProps) {
48534755 terminalAvailable = { activeProject !== undefined }
48544756 terminalOpen = { terminalState . terminalOpen }
48554757 terminalToggleShortcutLabel = { terminalToggleShortcutLabel }
4856- codeViewerOpen = { codeViewerOpen }
4857- diffViewerOpen = { diffViewerOpen }
48584758 previewAvailable = { isElectron && activeProject !== undefined }
48594759 previewOpen = { previewOpen }
48604760 previewDock = { previewDock }
@@ -4872,8 +4772,6 @@ export default function ChatView({ threadId, onMinimize }: ChatViewProps) {
48724772 onImportProjectScripts = { importProjectScripts }
48734773 onToggleTerminal = { toggleTerminalVisibility }
48744774 onPrefetchTerminal = { preloadThreadTerminalDrawer }
4875- onToggleCodeViewer = { toggleCodeViewer }
4876- onToggleDiffViewer = { handleToggleDiffViewer }
48774775 onTogglePreview = { ( ) => activeProjectId && togglePreviewOpen ( activeProjectId ) }
48784776 onTogglePreviewLayout = { ( ) => activeProjectId && togglePreviewLayout ( activeProjectId ) }
48794777 onMinimize = { onMinimize }
0 commit comments