Skip to content

feat(app): back and forward through the places you've been (BRA-2200) - #176

Merged
sean-brydon merged 2 commits into
cosscom:mainfrom
Stener1:bra-2200-back-forward
Oct 21, 2026
Merged

sean-brydon merged 2 commits into
cosscom:mainfrom
Stener1:bra-2200-back-forward

Conversation

@Stener1

@Stener1 Stener1 commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Summary

When you close a session and archive its worktree, you land on Home. To get back to the Agent Dashboard you go through the sidebar again, then scroll to find your place. This adds browser-style Back and Forward.

  • A trail of places (lib/nav-history.ts, pure part lib/nav-history-core.ts). A place is useStore.view, and in the workspace the worktree in front (useWorkspaces.current) with its tab. The trail is recorded by subscribing to those two stores, so no setView caller changes. Nothing is recorded while Back or Forward restores a place. Visiting the place you're on only updates its detail (tab, section), so Back doesn't walk through every tab. The trail holds 50 places and lasts until the window closes. Back and Forward skip places whose worktree is gone.
  • Back and Forward are arrows in the window strip at the sidebar's top (list and rail layouts, components/sidebar/back-forward.tsx), and are disabled when there's nowhere to go. They're also on ⌘[ and ⌘] (Ctrl in the Linux app) and a mouse's back and forward buttons. They're in shortcuts.json, so they show in the Keyboard shortcuts sheet, ⌘K and the Mac app's Go menu. In a File tab's or SQL editor, ⌘[ and ⌘] stay outdent and indent. When the Mac menu bar takes the key first, use-shortcuts.ts hands it to the editor.
  • Archiving or removing the worktree in front goes back, not Home. When forgetWorktree drops the workspace in front and you'd land on Home, you go back to the last place before it that still exists. With Labs tab groups, if another group comes forward instead, it stays in front as before.
  • The Agent Dashboard keeps its scroll, so Back (or ⌘J) finds the card you left from.

Evidence

Driven with the verify skill's new navigation-history scenario: the production build on the mock fixtures, in Chromium, with no console errors. It also passes with Labs on (labs=1).

Before (origin/main): archive → Home After: archive → back on the Agent Dashboard
Before: Home after archiving After: Agent Dashboard, Archived search-perf toast
Dashboard, scrolled down Open "Speed up product search" (search-perf) Back: the dashboard, at the same scroll
Dashboard scrolled Session Back to dashboard
Forward: the session ⌘[: the dashboard ⌘]: the session
Forward Cmd-bracket back Cmd-bracket forward
Remove worktree (qa-deck) from the sidebar → the dashboard Labs on: archive → the dashboard
Removed, back on dashboard Labs archive

The scenario's steps:

- open http://localhost:1433/?mock=1
- a new window is on Home with nowhere to go back or forward to
- ⌘J opens the Agent Dashboard; scroll it to the bottom
- click the 'Speed up product search' card: its worktree, search-perf, comes to the front
- Back returns to the Agent Dashboard, scrolled where it was
- Forward returns to the session
- ⌘[ goes back to the dashboard and ⌘] forward to the session
- a mouse's back button (3) and forward button (4) do the same
- close the session's tab: the worktree's launcher shows
- archive the worktree from the launcher: you land on the Agent Dashboard, not Home
- the archived worktree is gone from the trail: Forward has nowhere to go
- open 'Build the QA deck for the release' (qa-deck), then Remove worktree from its sidebar row: back on the dashboard again
OK

Checks: pnpm typecheck:plugins, check:titles, check:type, check:grid, check:csp, check:themes, pnpm test (572 pass, including 8 in nav-history-core.test.ts), pnpm build, npx tsc -p e2e and (cd docs-site && pnpm build) all pass. In the browser, the new e2e/back-forward.spec.ts passes, and so do dashboard-*, sidebar-rail, sidebar-list, sidebar-columns and worktree-remove (34 tests). cargo check couldn't run on this Linux box (no GTK dev libraries), but there's no Rust change. muda parses CmdOrCtrl+[ and CmdOrCtrl+]. There's no Go change.

Review: Codex review and adversarial review raised three findings, and all three are fixed:

  • An Automations deep link recorded twice: a place's id is now its view kind, and the request is detail.
  • The Mac menu bar swallowing ⌘[ / ⌘] in code editors: the key is handed to the editor.
  • Back to a box's home not restoring its tab.

A Codex re-review found nothing further.

Not shown on the mock, so it needs a person in the Mac app:

  • a real mouse's side buttons in WKWebView (the scenario dispatches mouseup with buttons 3 and 4)
  • the Go menu items
  • ⌘[ in a File tab while the menu bar holds the key

The verify skill gets features/navigation-history.md, a row in features/README.md and scripts/scenarios/navigation-history.mjs. There's a changelog bullet under Unreleased and a line in Getting started.

Linear: BRA-2200

🤖 Generated with Claude Code

The window strip's arrows, ⌘[ and ⌘], and a mouse's back and forward
buttons walk a trail of the places you've been: a view, or in the workspace
the worktree in front and its tab. The trail follows the view and workspace
stores, so nothing that moves you has to report it. When the worktree in
front is archived or removed you go back to the last place that is still
there (the Agent Dashboard, say) instead of Home, and the dashboard keeps
its scroll position.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 21, 2026

Copy link
Copy Markdown

@Stener1 is attempting to deploy a commit to the seanbrydonio's projects Team on Vercel.

A member of the Team first needs to authorize it.

@sean-brydon
sean-brydon merged commit cc96a38 into cosscom:main Oct 21, 2026
0 of 2 checks passed
@sean-brydon sean-brydon mentioned this pull request Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants