| ... | @@ -368,17 +368,19 @@ export default function ChatView() { | ... | @@ -368,17 +368,19 @@ export default function ChatView() { |
| 368 | if (e.key === "o" && (e.metaKey || e.ctrlKey) && !e.shiftKey) { | 368 | if (e.key === "o" && (e.metaKey || e.ctrlKey) && !e.shiftKey) { |
| 369 | if (api && activeProject) { | 369 | if (api && activeProject) { |
| 370 | e.preventDefault(); | 370 | e.preventDefault(); |
| 371 | void api.shell.openInEditor(activeProject.cwd, lastEditor); | 371 | const cwd = activeThread?.worktreePath ?? activeProject.cwd; |
| | 372 | void api.shell.openInEditor(cwd, lastEditor); |
| 372 | } | 373 | } |
| 373 | } | 374 | } |
| 374 | }; | 375 | }; |
| 375 | window.addEventListener("keydown", handler); | 376 | window.addEventListener("keydown", handler); |
| 376 | return () => window.removeEventListener("keydown", handler); | 377 | return () => window.removeEventListener("keydown", handler); |
| 377 | }, [api, activeProject, lastEditor]); | 378 | }, [api, activeProject, activeThread, lastEditor]); |
| 378 | | 379 | |
| 379 | const openInEditor = (editorId: EditorId) => { | 380 | const openInEditor = (editorId: EditorId) => { |
| 380 | if (!api || !activeProject) return; | 381 | if (!api || !activeProject) return; |
| 381 | void api.shell.openInEditor(activeProject.cwd, editorId); | 382 | const cwd = activeThread?.worktreePath ?? activeProject.cwd; |
| | 383 | void api.shell.openInEditor(cwd, editorId); |
| 382 | setLastEditor(editorId); | 384 | setLastEditor(editorId); |
| 383 | localStorage.setItem(LAST_EDITOR_KEY, editorId); | 385 | localStorage.setItem(LAST_EDITOR_KEY, editorId); |
| 384 | setIsEditorMenuOpen(false); | 386 | setIsEditorMenuOpen(false); |