Repository navigation
feat(app): isolate Code-side tab lists per project - #277
Merged
Merged
Conversation
The per-folder tab strips PR #239 gave the Work side now apply to Code: the strip is keyed by (server, folder) on both sides, where Code's folders are the selected server's projects. nextTabScope loses its work-only early return and takes a side-agnostic `selected` server; its restart hold is re-gated on the previous scope's server belonging to the side on screen (same fix as #275, now symmetric — a Work switch can no longer inherit a Code folder scope either). useWorkspaceScope resolves the selection on both sides, gated on platform.sandboxes so the web build, which has no Code/Work split, keeps upstream's single strip. Selecting a Code project in the sidebar becomes a move rather than a highlight, through the same folderEntry chain Work uses -- last session in that folder, else its open draft, an open tab, the server's most recent session there, else a new draft -- and the openSessions step is no longer gated to Work. The strip's fallback folder becomes per-side (defaultFolder): the sandbox's primary folder on Work, the last-used project then the first on Code; the side switch lands through the same helper so it agrees with the strip. Web keeps the selection toggle. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The per-folder tab strips #239 gave the Work side now apply to Code: the strip is keyed by (server, folder) on both sides, where Code's folders are the selected server's projects. Working across two projects — or two servers — no longer means reading past every other Code tab in one long strip.
Behaviour
/workspacedo.folderEntry, unchanged): the session you were last in there, else that project's open draft, an open tab, the server's most recent session in it, else a new draft. TheopenSessionsstep (land on a tab that's already open rather than minting a draft beside it) was gated to Work; that gate is gone.mod+1…9, next/previous,mod+w) and the + button act within the project on screen — this came free, since the titlebar already runs everything through the scope.routeDirectoryfirst, same as Work).useWorkspaceScoperesolves no selection there (gated onplatform.sandboxes) and the strip stays upstream's single list; project clicks keep upstream's selection toggle.Design
Following #239: the scope stays derived, never stored — folder on screen → sidebar's selected project → the side's default folder, now the per-side
defaultFolder(the sandbox's primary folder on Work; the last-used project, then the first, on Code). All logic lives in the fork-onlysrc/workspace/{side.ts,tabs.tsx}andpages/home-model.tsx; no upstream file changes, soDIVERGENCES.mdonly gets its existing per-folder-strip row updated to describe both sides (the wiring it documents is untouched).nextTabScope(from #275) loses its Work-only early return and takes a side-agnosticselectedserver. Its restart hold is re-gated from "side is Work" to "the previous scope's server belongs to the side on screen" — the same fix as #275, now symmetric, so a switch to Work can't inherit a Code folder scope either.One inherited caveat, for parity's sake: the scope's server comes from the sidebar selection, so a navigation that bypasses the sidebar (a notification click for a session on a different server) doesn't move the strip to that server. That's #239's existing behaviour on Work, unchanged here — worth its own decision if it bites.
Verification
test-browser/workspace-side.test.ts: a Code server scoping to one of its projects, the symmetric Work-side gate, and the web build's no-selection fall-through; the fix(app): scope the tab strip to Code after a side switch #275 regression locks and the restart-hold identity test still pass.bun typecheckclean inpackages/appandpackages/desktop; 702 unit + 109 browser tests pass.prompt-thinking-level,session-actions-menuShare-hidden) fail identically onmain— pre-existing, unrelated. Notablycross-server-tab-close,new-session-reuses-draft, and sidebar persistence pass: the web harness exercises the no-split path this change must not disturb.Not verified end-to-end: the scoped Code strip in the running desktop app — the web harness has no sandbox platform, so the split never activates there (same limitation #239 and #275 noted). Manual pass worth doing before merge: open sessions in two Code projects and across a WSL/remote server, check the strip follows the sidebar and the shortcuts stay within the visible project, then confirm Work still scopes per mounted folder.
🤖 Generated with Claude Code