Skip to content

feat(tabs): track recently visited tabs - #1285

Merged
sudomaggie merged 2 commits into
developfrom
dev/recent-tabs-navigation
Sep 5, 2026
Merged

feat(tabs): track recently visited tabs#1285
sudomaggie merged 2 commits into
developfrom
dev/recent-tabs-navigation

Conversation

@Harry19081

@Harry19081 Harry19081 commented Sep 5, 2026

Copy link
Copy Markdown
Member

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 develop event-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 tests
  • pnpm 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 tests
  • pnpm 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 tests
  • pnpm run typecheck — passed
  • git diff --name-only origin/develop...HEAD --diff-filter=ACMR -- "*.ts" "*.tsx" | xargs pnpm exec eslint — passed
  • pnpm run check:circular — passed across 6,529 modules
  • pnpm run check:test-placement — passed across 495 directories
  • git diff --check — passed
  • git diff --name-only origin/develop...HEAD --diff-filter=ACMR | xargs pnpm exec prettier --check — passed
  • jq empty for all 13 changed navigation locale files — passed
  • Live Tauri visual verification — not run; desktop Computer Use was not authorized

Audit

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, and TabBarPlusMenu.

Area Verdict Evidence Change or reason kept Verification
Background work keep No timer, listener, request, worker, or polling path added History updates synchronously on existing tab transitions Call-chain inspection and focused tests
Memory fix Two app-lifetime histories plus workspace identity metadata Both use one shared five-entry global cap; no per-session map Shared bound test and cross-workspace bound test
Scope/isolation fix My Station tabs belong to session-scoped workspaces Entries retain origin workspace and current menu filters by exact workspace Workspace-switch unit assertion
Rendering/hot path keep Menus subscribe only to their bounded history atom No transcript or inactive view is retained by this feature Component and store tests

Performance verdict: pass.

@sudomaggie
sudomaggie merged commit 1c8448f into develop Sep 5, 2026
7 checks passed
@Harry19081 Harry19081 added enhancement New feature or request sessions Sessions, history, replay, sidebar, workspace, or worktrees labels Sep 5, 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 sessions Sessions, history, replay, sidebar, workspace, or worktrees

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants