Repository navigation
fix(terminal): a file link opens in the workspace it was clicked in - #32320
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
🧹 Nitpick comments: 1
tests/e2e/golden-terminal-file-link.spec.ts: 1
313-322: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the read-only state through the DOM, not through
window.__store.This block reads
openFiles[].readOnlyfrom the store to confirm the view is read-only. The e2e guideline says to assert user-visible behavior through the DOM. A store-only check passes even if the editor renders the file as editable. Replace it with a DOM assertion on the rendered editor. For example, check that the editor reports read-only or rejects typing. If the DOM has no read-only signal, keep the store check as a secondary assertion.As per path instructions: "Use
window.__storefor setup; assert user-visible behavior through the DOM (getByRole,toBeVisible,toHaveText)."Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
4961ab3c-7b78-43f7-83a1-9508066cd064
📒 Files selected for processing: 27
src/renderer/src/components/editor/editor-autosave.tssrc/renderer/src/components/editor/editor-external-watch-path-index.tssrc/renderer/src/components/editor/useEditorPanelFileContentLoader.tssrc/renderer/src/components/editor/useEditorPanelRemoteSiblingContentState.test.tsxsrc/renderer/src/components/terminal-pane/terminal-file-open-routing.tssrc/renderer/src/components/terminal-pane/terminal-file-other-workspace-hint.tssrc/renderer/src/components/terminal-pane/terminal-file-other-workspace-owner.tssrc/renderer/src/components/terminal-pane/terminal-link-file-open-routing.test.tssrc/renderer/src/components/terminal-pane/terminal-link-handlers-test-fixtures.tssrc/renderer/src/components/terminal-pane/terminal-link-host-workspace-file.test.tssrc/renderer/src/components/terminal-pane/terminal-link-open-beside-source.test.tssrc/renderer/src/components/terminal-pane/terminal-link-other-workspace-hint.sonner.test.tsxsrc/renderer/src/hooks/editor-external-watch-background-trim.test.tssrc/renderer/src/hooks/editor-external-watch-event-reconciliation.tssrc/renderer/src/hooks/editor-external-watch-other-workspace-view.test.tssrc/renderer/src/hooks/editor-external-watch-overflow.test.tssrc/renderer/src/hooks/editor-external-watch-overflow.tssrc/renderer/src/hooks/editor-external-watch-targets.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/pt.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/lib/open-file-watch-scope.tstests/e2e/golden-terminal-file-link.spec.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
dc98aa3 to
2135892
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Keep local sibling tabs in the clicked workspace. · useEditorPanelFileContentLoader.ts:168-172
src/renderer/src/components/editor/useEditorPanelFileContentLoader.ts:168-172
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winKeep local sibling tabs in the clicked workspace.
A local sibling terminal link creates a read-only tab with
runtimeEnvironmentId: null. The loader treats that value as a re-own trigger, so the tab moves to the owning workspace instead of loading through the owner while remaining in the clicked workspace.This affects the ordinary cross-workspace local-link case, but it does not block file viewing. The tab is recoverable through the existing Open there action. Classify this as a minor functional issue.
Suggested fix
if ( !restoredOpenFile.readOnly || - !runtimeEnvironmentId || restoredOpenFile.terminalArtifactGrantId ) {
ℹ️ Review info
⚙️ Run configuration
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
27b7d8c8-b965-4af9-a5e4-24eb5d9f954d
📒 Files selected for processing: 24
src/renderer/src/components/editor/editor-autosave-holds.tssrc/renderer/src/components/editor/editor-autosave.tssrc/renderer/src/components/editor/editor-buffer-adapter.tssrc/renderer/src/components/editor/editor-external-change-tab-reset.tssrc/renderer/src/components/editor/editor-external-watch-path-index.tssrc/renderer/src/components/terminal-pane/terminal-file-link-hit-testing.tssrc/renderer/src/components/terminal-pane/terminal-file-open-routing.tssrc/renderer/src/components/terminal-pane/terminal-file-open-turn.tssrc/renderer/src/components/terminal-pane/terminal-file-other-workspace-hint.test.tssrc/renderer/src/components/terminal-pane/terminal-file-other-workspace-hint.tssrc/renderer/src/hooks/editor-external-watch-background-trim.test.tssrc/renderer/src/hooks/editor-external-watch-disk-verification.tssrc/renderer/src/hooks/editor-external-watch-event-reconciliation.tssrc/renderer/src/hooks/editor-external-watch-other-workspace-view.test.tssrc/renderer/src/hooks/editor-external-watch-overflow.tssrc/renderer/src/hooks/editor-external-watch-targets.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/pt.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/lib/open-file-owner-scope.ts
🚧 Files skipped from review as they are similar to previous changes: 7
- src/renderer/src/i18n/locales/es.json
- src/renderer/src/i18n/locales/ja.json
- src/renderer/src/i18n/locales/zh.json
- src/renderer/src/i18n/locales/en.json
- src/renderer/src/i18n/locales/fr.json
- src/renderer/src/i18n/locales/pt.json
- src/renderer/src/i18n/locales/ko.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Use the owner route for self-write verification. · editor-external-watch-disk-verification.ts:283-301
src/renderer/src/hooks/editor-external-watch-disk-verification.ts:283-301
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winUse the owner route for self-write verification.
An owner-scoped event can select a read-only tab whose
file.worktreeIdandfile.relativePathstill identify the source workspace. For environment targets,readRuntimeFileContentsends those values tofiles.read; it does not usefilePathfor that RPC. The verification can therefore read the source workspace instead of the owner workspace. A matching source file can suppress the owner reload, while a missing or different source file can cause a false verification result.Use the owner-scoped notification values at this boundary:
Suggested fix
- relativePath: file.relativePath, - worktreeId: file.worktreeId, + relativePath: notification.relativePath, + worktreeId: notification.worktreeId,
ℹ️ Review info
⚙️ Run configuration
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
1bbe7af7-af65-4e8e-98ce-22093f610f26
📒 Files selected for processing: 11
src/renderer/src/components/editor/EditorPanelHeaderPath.tsxsrc/renderer/src/components/terminal-pane/terminal-file-other-workspace-hint.tssrc/renderer/src/components/terminal-pane/terminal-link-handlers-test-fixtures.tssrc/renderer/src/components/terminal-pane/terminal-link-other-workspace-hint.sonner.test.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/pt.jsonsrc/renderer/src/i18n/locales/zh.json
🚧 Files skipped from review as they are similar to previous changes: 7
- src/renderer/src/i18n/locales/pt.json
- src/renderer/src/i18n/locales/fr.json
- src/renderer/src/i18n/locales/zh.json
- src/renderer/src/i18n/locales/en.json
- src/renderer/src/i18n/locales/es.json
- src/renderer/src/i18n/locales/ko.json
- src/renderer/src/i18n/locales/ja.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
1664d41 to
0e872e2
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
060455bc-fd42-49fe-bbd6-b3cd07d13d7c
📒 Files selected for processing: 13
src/renderer/src/components/editor/useEditorPanelRemoteSiblingContentState.test.tsxsrc/renderer/src/components/terminal-pane/terminal-file-link-owner-resolution.tssrc/renderer/src/components/terminal-pane/terminal-file-open-routing.tssrc/renderer/src/components/terminal-pane/terminal-file-other-workspace-hint.tssrc/renderer/src/components/terminal-pane/terminal-file-other-workspace-owner.tssrc/renderer/src/components/terminal-pane/terminal-html-file-browser-open.tssrc/renderer/src/components/terminal-pane/terminal-link-file-open-routing.test.tssrc/renderer/src/components/terminal-pane/terminal-link-host-workspace-file.test.tssrc/renderer/src/components/terminal-pane/terminal-link-other-workspace-hint.sonner.test.tsxsrc/renderer/src/hooks/editor-external-watch-background-trim.test.tssrc/renderer/src/lib/open-file-owner-scope.tssrc/renderer/src/runtime/sync-runtime-graph-outside-workspace-file-tabs.test.tssrc/renderer/src/runtime/sync-runtime-graph/mobile-session-surfaces.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
| const epoch = editorBufferRouteEpochOf(state) | ||
| const cached = ownerScopeCache.get(file) | ||
| if (cached?.epoch === epoch) { | ||
| return cached.scope | ||
| } | ||
| const route = findWorkspaceFileRoute(state, LOCAL_EXECUTION_HOST_ID, file.filePath) | ||
| const scope = route ? { worktreeId: route.worktreeId, relativePath: route.relativePath } : own | ||
| ownerScopeCache.set(file, { epoch, scope }) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
-
🏁 Script executed:
#!/bin/bash # Compare epoch inputs with the catalog fields read by the route lookup. rg -nP -C8 'function routeInputsOf' src/renderer/src/store/slices/editor/buffers/editor-buffer-identity-cache.ts rg -nP -C12 'function workspaceMatchesExecutionHost' src/renderer/src rg -nP -C4 'function findWorkspaceFileRoute|function findRuntimeWorkspaceFileOwner' src/renderer/src/lib
Repository: stablyai/orca
Length of output: 4091
🏁 Script executed:
#!/bin/bash set -u printf '%s\n' '--- epoch declaration and implementation ---' nl -ba src/renderer/src/store/slices/editor/buffers/editor-buffer-identity-cache.ts | sed -n '1,100p' printf '%s\n' '--- route lookup and host matching ---' nl -ba src/renderer/src/lib/runtime-workspace-file-route.ts | sed -n '1,180p' printf '%s\n' '--- direct helper definitions ---' rg -n -F --glob '*.ts' -e 'function resolveExplicitWorktreeOperationRouteResult' -e 'function getExecutionHostIdForWorktree' -e 'function runtimeEnvironmentIdUnlessTwin' -e 'function selectWorktreesByRepo' -e 'function selectFolderWorkspaces' src/renderer/src
Repository: stablyai/orca
Length of output: 7682
🏁 Script executed:
#!/bin/bash set -u printf '%s\n' '--- route state type ---' rg -n -F --glob '*.ts' -e 'export type WorktreeOperationRouteState' -e 'interface WorktreeOperationRouteState' src/renderer/src printf '%s\n' '--- direct helper bodies ---' nl -ba src/renderer/src/lib/resolve-owner.ts | sed -n '190,245p' nl -ba src/renderer/src/lib/worktree-runtime-owner.ts | sed -n '80,145p' nl -ba src/renderer/src/lib/worktree-operation-catalog-route.ts | sed -n '1,100p' nl -ba src/renderer/src/store/workspace-record-selectors.ts | sed -n '1,70p' nl -ba src/renderer/src/store/worktree-repo-index.ts | sed -n '1,180p'
Repository: stablyai/orca
Length of output: 18140
🏁 Script executed:
#!/bin/bash set -u printf '%s\n' '--- complete route-state declaration ---' nl -ba src/renderer/src/lib/worktree-operation-route.ts | sed -n '1,95p' printf '%s\n' '--- runtime owner implementation ---' nl -ba src/renderer/src/lib/worktree-runtime-owner.ts | sed -n '1,130p' printf '%s\n' '--- explicit route helper remainder ---' nl -ba src/renderer/src/lib/worktree-operation-catalog-route.ts | sed -n '90,260p' printf '%s\n' '--- resolve-owner direct dependencies ---' rg -n -F --glob '*.ts' -e 'function runtimeEnvironmentIdForWorkspaceOwner' -e 'function restoredFolderEnvironmentId' -e 'function getRuntimeEnvironmentIdForFolderWorkspace' -e 'function getUnstampedExecutionHostId' -e 'function getSingleFocusedRuntimeEnvironmentId' src/renderer/src/lib
Repository: stablyai/orca
Length of output: 15152
🏁 Script executed:
#!/bin/bash set -u printf '%s\n' '--- inherited state types ---' rg -n -F --glob '*.ts' -e 'export type FolderWorkspaceRuntimeOwnerState' -e 'export type WorktreeRuntimeOwnerState' -e 'interface FolderWorkspaceRuntimeOwnerState' -e 'interface WorktreeRuntimeOwnerState' src/renderer/src printf '%s\n' '--- inherited type declarations and ownership helpers ---' nl -ba src/renderer/src/lib/folder-workspace-runtime-owner.ts | sed -n '1,135p' nl -ba src/renderer/src/lib/worktree-runtime-owner-state.ts | sed -n '1,180p' nl -ba src/renderer/src/lib/active-workspace-host.ts | sed -n '1,150p' nl -ba src/renderer/src/lib/paired-web-client-host.ts | sed -n '1,130p' nl -ba src/renderer/src/lib/single-runtime-legacy-owner.ts | sed -n '1,80p'
Repository: stablyai/orca
Length of output: 13545
Include active workspace ownership in the route epoch.
findWorkspaceFileRoute can read activeWorktreeId and activeWorkspaceExecutionHostId through its ownership helpers. These fields are missing from EDITOR_BUFFER_ROUTE_INPUT_KEYS, so openFileOwnerScope can keep a stale owner after the active workspace changes.
🐛 Suggested fix
-
'runtimeEnvironments', 'settings', + 'activeWorktreeId', + 'activeWorkspaceExecutionHostId', 'editorBufferIdentityRevision'
A terminal or chat link to a file another workspace on the same host holds used to switch to that workspace. It now opens as a plain read-only file in the workspace it was clicked in (local and WSL read on this computer; paired and managed servers read through the owning workspace's scope), with a toast naming the owner and an Open there action, and a Read-only badge in the editor header. HTML on server hosts, server workspaces the client does not know, directories, shift-click download and direct-SSH workspaces keep the switch. The view is watched with its owner through one derived scope (lib/open-file-owner-scope.ts); phones skip plain file tabs they cannot read by workspace-relative path. Fixes #32158
… cached per route inputs
…er links keep opening in their workspace Servers read files only by workspace-relative path, so a read-only view of another workspace's server file needed owner rerouting in every read path. Paired and managed servers keep today's switch; the loader moves any restored read-only server tab of another workspace's file there as before.
0e872e2 to
d350f92
Compare
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v1.4.240 reverted stablyai#32320, so getOpenFilesForExternalFileChange takes two arguments again; the folder discard seam test still passed the store as a third one and broke the web typecheck. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ELI5
Clicking a terminal or chat file link used to switch you to whichever workspace contains that file. On this computer, the file now opens right where you clicked, as a read-only view. A toast tells you which workspace the file belongs to and has an Open there button to go there. SSH and server workspaces still switch as before.
What Changed
Before: in workspace A, Cmd/Ctrl-clicking a link to a file that another workspace B also holds moved you to B. B might be a sibling worktree, the main repo, or a folder workspace rooted at
~, which holds almost every file. On this computer, the click opened an absolute-path tab in A, and then the editor loader moved that tab into B and activated B.After, on this computer (local, WSL and folder workspaces):
main.Unchanged:
Mechanism:
terminal-file-open-routing.tslooks up the owning workspace with the existingfindWorkspaceFileRoute, which covers git worktrees and folder workspaces. On this computer, it opens the file read-only in A and shows the hint. On SSH it opens the file in the owner, which also reuses a tab already open there.terminal-file-link-owner-resolution.ts: the link-owner resolution, extracted to keep the routing file under the line limit;terminal-file-other-workspace-owner.tsandterminal-file-other-workspace-hint.ts;lib/open-file-owner-scope.ts: works out which workspace watches a view, from the catalog. Every watch matcher uses it, and the result is cached per route inputs.EditorPanelHeaderPath.tsx. Strings are in all 7 locales.Why
Badge.Linked Issue
Fixes #32158
Thanks to @quzard for the clear report and the "open there?" suggestion.
Visual Proof
This was checked rendered on a hidden dev build with an isolated profile and two local repos, in both light and dark themes. The steps: in repo-a, Cmd-click a terminal path into repo-b, then click Open there. The screenshots are kept locally and not committed:
The rendered check led to two changes:
Testing
terminal-link-other-workspace-hint.sonner.test.tsx(component test with the realToaster):Routing tests:
Loader: a restored read-only server tab for another workspace's file is moved to that workspace, as on main.
Watch tests:
Mobile: an outside-workspace plain-text tab is held back, and Markdown still publishes.
e2e:
golden-terminal-file-link.spec.tsis updated. It runs in CI.Rendered check: done on a hidden dev build in light and dark, covering the toast, the Read-only badge and Open there. Screenshots are kept locally.
Local runs: the new specs fail on main. The test files that import the changed modules pass, and the full static job passes.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Several Opus and Codex rounds. Findings were fixed or led to scope cuts:
The final head is Opus-approved and Codex-clean (see the handoff).
Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)