feat(tabs): track recently visited tabs - #1285
Merged
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 Recent section only records tabs after they are closed. Moving from Session A to Sessions B, C, or D leaves A open but absent from the menu, so the section cannot serve as quick navigation back through visited sessions.
Solution
Track active-tab transitions as a most-recently-used history in both Chat Pane and My Station. The tab being left moves to the front, the destination is removed, Launchpad is excluded, session tabs deduplicate by session identity, and selecting an entry focuses an open tab or restores an explicitly closed one.
Both histories remain capped at five entries. My Station entries carry their originating workspace and the menu only projects entries for the currently presented workspace, preventing session-local tabs from leaking across workspaces. The existing provider/session identity icons, empty-section suppression, and localized Recent label remain intact.
The full-suite Canvas activity assertion is also aligned with the current
developevent-header contract: a non-expandable event can navigate from either its row or its Agent Station arrow. This is a test-only correction for the stale assertion that caused the first CI run to fail.Potential risks
The history is intentionally app-lifetime only and resets after restart. Closed browser tabs still reopen as fresh browser sessions, matching the previous restore behavior. The state and render paths are covered by unit tests, typechecking, lint, cycle checks, and test-placement checks, but no live Tauri screenshot or manual GUI pass was captured because desktop Computer Use was not authorized for this task.
Verification
pnpm run test— passed, 1,492 files and 11,205 testspnpm exec vitest run --config config/vitest.config.ts src/engines/ChatPanel/blocks/CanvasInlineCard/CanvasRevisionActivity.test.ts src/engines/ChatPanel/blocks/primitives/EventBlockHeader.test.ts— passed, 11 testspnpm exec vitest run --config config/vitest.config.ts src/shared/tabs/recentTabs.test.ts src/components/RecentTabsMenuSection/RecentTabsMenuSection.test.ts src/store/chatPanel/__tests__/chatPanelRecentTabs.test.ts src/store/workstation/tabs/__tests__/recentTabs.test.ts src/store/workstation/tabRegistry/atoms.test.ts src/store/workstation/browser/tabs/__tests__/sharedWorkspaceIntegration.test.ts src/engines/ChatPanel/ChatPanelTabBar/ChatPanelTabBar.test.ts src/engines/ChatPanel/components/SessionIdentityIcon.test.ts— passed, 43 testspnpm run typecheck— passedgit diff --name-only origin/develop...HEAD --diff-filter=ACMR -- "*.ts" "*.tsx" | xargs pnpm exec eslint— passedpnpm run check:circular— passed across 6,529 modulespnpm run check:test-placement— passed across 495 directoriesgit diff --check— passedgit diff --name-only origin/develop...HEAD --diff-filter=ACMR | xargs pnpm exec prettier --check— passedjq emptyfor all 13 changed navigation locale files — passedAudit
Architecture audit covered all 10 layers. Compilation, call-chain ownership, naming, default branches, shared-module boundaries, and developer clarity were reviewed. Wire serialization, initialization parity, and resolver fallback symmetry are not affected because this change is frontend-local and adds no IPC, persistence schema, or external payload.
Frontend UI audit: 0 fix, 5 keep with reason, 0 abstract across
RecentTabsMenuSection,ChatPanelPlusMenu, andTabBarPlusMenu.Performance verdict: pass.