feat(workstation-tabs): retire the Files tab when a file opens - #1182
Merged
Conversation
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.
Problem
The Explorer ("Files") tab is a transient picker: it exists so the user can browse the tree and open a file. But after a file was opened, the Files tab stayed in the strip next to the new file tab. Every browse-then-open flow left a stale Files tab behind that the user had to close by hand.
Solution
openTabinsrc/store/workstation/tabs/tabMutations.tsnow retires an open Explorer tab whenever afiletab is opened:pinnedorclosable: falseExplorer is treated as a protected fixture and never retired (currently unused —usePinnedTabsis wiredenabled: false— but keeps the fixture contract).The fix lives in the single pure mutation that every open path funnels through (file-tree click, chat path references, spotlight,
EditorTabService, agent-driven opens), rather than being patched per call site.Potential risks
stationModeAtomwould thread store state into it. Scoping it per mode is possible as a follow-up if wanted.EditorTabService.getLastFileOrExplorerTabIdpreference); Files stays reachable via the Launchpad /+menu, or ⌘G with no file tabs open.workspace-local, so removal flows through the normalsplitPanelpersistence with no shared-resource teardown; no migration concerns.Verification
Verified in a detached worktree at
origin/develop(57c8ffd) containing only this PR's two files (node_modulessymlinked), so the diff compiles and passes against the base alone:npx tsc --noEmit --pretty false -p tsconfig.json— exit 0npx vitest run --config config/vitest.config.ts src/store/workstation/tabs/__tests__/tabMutations.test.ts— 19 tests pass (4 new: replace-in-place, reopen-retires, non-file untouched, pinned protected)npx eslintover both files — cleanOn the dev checkout, the broader sweep
vitest src/store/workstation src/hooks/tabHost src/modules/WorkStation src/services/workStation— 144 files / 1050 tests pass.Not run: E2E; manual check in the running app. The commit was built with git plumbing from a live shared checkout, so git hooks did not run and the
Pre-commit hook ran.trailer is absent — typecheck/lint/tests above were run manually instead.