Skip to content

feat(workstation-tabs): retire the Files tab when a file opens - #1182

Merged
Harry19081 merged 1 commit into
developfrom
feat/files-tab-retire-on-file-open
Sep 1, 2026
Merged

feat(workstation-tabs): retire the Files tab when a file opens#1182
Harry19081 merged 1 commit into
developfrom
feat/files-tab-retire-on-file-open

Conversation

@Chloe-JY

@Chloe-JY Chloe-JY commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

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

openTab in src/store/workstation/tabs/tabMutations.ts now retires an open Explorer tab whenever a file tab is opened:

  • A newly created file tab is spliced into the Explorer's slot, so the strip position is preserved (a genuine replace, not close-then-append).
  • Re-activating an already-open file also retires the Explorer tab, so clicking an open file from the tree behaves identically.
  • Non-file tabs (search, terminal, source-control, browser, directory listings) leave the Explorer alone.
  • A pinned or closable: false Explorer is treated as a protected fixture and never retired (currently unused — usePinnedTabs is wired enabled: 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

  • Behavior change applies in every station mode, not just my-station — the tab strip is a single shared pool, and gating a pure mutation on stationModeAtom would thread store state into it. Scoping it per mode is possible as a follow-up if wanted.
  • Once a file is open, ⌘G focuses the last file rather than reopening Files (pre-existing EditorTabService.getLastFileOrExplorerTabId preference); Files stays reachable via the Launchpad / + menu, or ⌘G with no file tabs open.
  • The Explorer tab is workspace-local, so removal flows through the normal splitPanel persistence with no shared-resource teardown; no migration concerns.
  • Tab lifecycle only, no visual restyle — screenshots would show an unchanged tab strip, so none are attached. The change was not exercised in the running Tauri app.

Verification

Verified in a detached worktree at origin/develop (57c8ffd) containing only this PR's two files (node_modules symlinked), so the diff compiles and passes against the base alone:

  • npx tsc --noEmit --pretty false -p tsconfig.json — exit 0
  • npx 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 eslint over both files — clean

On 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.

@Harry19081
Harry19081 merged commit aa17dcc into develop Sep 1, 2026
6 checks passed
@Harry19081 Harry19081 added enhancement New feature or request UX Improvements to user experience, workflow smoothness workstation Workstation, editor, source control, LSP, or status bar frontend-ui Frontend UI, design system, accessibility, layout, or theming labels Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request frontend-ui Frontend UI, design system, accessibility, layout, or theming UX Improvements to user experience, workflow smoothness workstation Workstation, editor, source control, LSP, or status bar

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants