Skip to content

feat(desktop): move Back/Forward from header arrows to View menu - #14809

Closed
xuejinT wants to merge 4 commits into
mainfrom
feat/nav-history-menu-no-arrows
Closed

xuejinT wants to merge 4 commits into
mainfrom
feat/nav-history-menu-no-arrows

Conversation

@xuejinT

@xuejinT xuejinT commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

#9550 added Back/Forward arrow buttons to the top-left of the header. #8258, the issue it answered, asked for ⌘←/⌘→, mouse back/forward buttons, and optionally menu items. It did not ask for on-screen buttons. The header's left cluster is the most crowded part of the top bar (window controls, instance selector, crew chips), and the arrows duplicate the chords. Most sidebar-driven desktop apps (Discord, ChatGPT, Claude, Figma) show no history arrows. Apps that do show them (Slack, Notion, Spotify) are built around deep browse-style navigation.

What changed

  • Removed the header arrows. NavHistoryArrows is gone. RouteHistoryTracker stays, moved to components/RouteHistoryTracker.tsx, because the chords still read its store. The narrow-header drop rung for the arrows is removed from index.css.
  • Added View → Back / Forward to the desktop app menu. A click sends a history-step IPC (-1 / 1) to the focused dashboard. The renderer takes the step through useGuardedHistoryStep, so the draft guard and the "nowhere to go" check are the same as for ⌘←/⌘→. Menu clicks are not gated on the keyboard-shortcuts toggle, because a click is not a keystroke.
  • No menu item registers the chord. A registered accelerator would take ⌘← from every text field, where it moves the caret. On Windows/Linux the chord is displayed but not bound (registerAccelerator: false, the same pattern as Settings…). macOS has no display-only accelerator, so the items show no chord there. The chord is still listed in the Shortcuts modal.
  • onHistoryStep is optional on the bridge type, so a renderer on an older desktop shell still works.
  • Removed the four now-unused tooltip strings (app.nav_back_title*, app.nav_forward_title*) from every locale and the context sidecar. app.nav_back / app.nav_forward stay because the Shortcuts modal uses them.

Not in this PR

  • Mouse back/forward buttons. feat: mouse Back/Forward buttons walk MRU session history #11891 (open) already wires them, to the session MRU walk rather than route history. This PR leaves that alone so the two don't collide.
  • Page-level "Back to Apps" links. They name a fixed destination in their label, so switching them to history-back would make the label wrong. That needs a separate UX decision.
  • ⌘[ / ⌘] conflict. These are the usual macOS Back/Forward keys, but here they cycle sessions. Mouse software such as Logi Options+ sends them for thumb buttons. Changing that is a product call.

Testing

  • npm run typecheck, eslint on the touched files, i18n:check, lint:i18n: clean.
  • Full vitest: 2432 files, 40,765 tests passed.
  • Electron npm test: 2255 tests, 0 failed. New app-menu.test.js cases check the View order (Back, Forward, separator), the click wiring, and that neither item registers an accelerator on any platform.
  • New useKeyboardShortcuts tests: a menu step goes back when there is history, even with shortcuts off; it does nothing when there is nowhere to go; the listener unsubscribes on unmount.
  • The draft-guard interplay tests from the old arrows file are kept. They now drive the same guarded step through a test harness button.
  • Not verified: a manual run of the packaged desktop app.

Screenshots

Real built SPA with the API stubbed, 1280px, dark theme, after one in-app step (Settings → Schedule) so Back shows enabled. Before is base e88e807786, after is this branch. Nothing else in the header moves.

Before: Back/Forward arrows at the top left

before

After: arrows gone, the rest of the header unchanged

after

The new View → Back / Forward items are drawn by macOS in the system menu bar, outside any web page. The repo's Electron-shell harness (capture-electron-shell.mjs) only runs on Linux/Xvfb, so the menu isn't in these shots. app-menu.test.js covers the item order and wiring, and the menu will be checked by hand in the desktop app.

The header arrows took space in the most crowded part of the top bar and
duplicated the Cmd/Ctrl+Left/Right chords. Remove them and add View > Back /
Forward to the desktop app menu instead, which is where macOS apps put
history navigation.

- The menu items send a history-step IPC; the renderer takes the step through
  useGuardedHistoryStep, so the draft guard and the nowhere-to-go check are
  the same as for the chords.
- No menu item registers the chord: a registered accelerator would take
  Cmd+Left from every text field. On Windows/Linux the chord is shown but
  not bound; macOS has no display-only accelerator, so it shows none.
- RouteHistoryTracker stays (renamed file); the unused tooltip strings are
  removed from every locale.

Refs #8258
Removes the arrows from the top bar, adds View > Back / Forward to the
desktop menu (history-step IPC, taken through useGuardedHistoryStep), and
drops the now-unused tooltip strings. No menu item registers Cmd/Ctrl+Left/
Right, so text fields keep those keys.

Refs #8258
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 28, 2026
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — 🔴 BLOCK

UX-level review of cc4a957e461418c346870525df4e94da38ef44cc — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: BLOCK

Cannot evaluate: missing screenshot of the new View → Back/Forward menu items — the PR's replacement control appears in no supplied image.

Evidence gaps

  • View → Back / Forward menu items (app-menu.js: label: "Back" / label: "Forward"): both header screenshots show only the arrow removal; the control users must now find instead was never shown to the blind reader. Close with a screenshot of the open View menu — the PR's own note says the Electron harness runs on Linux/Xvfb, where the menu is capturable, or a manual macOS shot.

Watch

  • On Windows/Linux the menu displays "Ctrl+Left / Ctrl+Right" (accelerator: "Ctrl+Left", registerAccelerator: false), but the chord handler is gated on the keyboard-shortcuts toggle (if (!enabled || disabled) return), while menu clicks are not — a user with shortcuts disabled reads a promised accelerator that silently does nothing. Low frequency × silent failure × persistent; smallest fix is omitting the displayed accelerator when the toggle is off, or exempting history chords from the toggle to match the menu.

[UX-REVIEWED] cc4a957

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Design-level review of cc4a957e461418c346870525df4e94da38ef44cc — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Verify View → Back/Forward by hand in the packaged app (macOS menu bar and Windows titlebar menu) — the PR itself flags this as not yet done.

[DESIGN-REVIEWED] cc4a957

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🔴 BLOCK

Premise-level review of cc4a957e461418c346870525df4e94da38ef44cc — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: BLOCK

Removing the shipped header Back/Forward arrows is product shape with no recorded decision, and the web dashboard is left with no on-screen replacement.

Not justified as shipped

  • Item 1 — product-shape removal without a recorded decision: "Removed the header arrows. NavHistoryArrows is gone." — evidence and clearance under Blockers.
  • Item 6 — undeclared: the menu step is silently a no-op in the narrow/mobile layout (commit 5b29dc9); harm-free, matches the chord's gate.
  • Item 10 — rides along: before/after PNGs committed under temp-screenshots/nav-history-menu/; repo convention (60+ prior files).

What this change ships

Inventory (10 items) — 7 justified

Intent: stop showing Back/Forward as header buttons and offer them as desktop View-menu items instead — a MOVE/removal, not a FIX. (The patch also carries already-merged main commits — session-control #14185, question-card RFC #13253, unread-badge opt-in, docked webview — from a stale diff base; the merge target 15184342e is #13253's own commit, so those are not this PR's work and are not inventoried.)

  1. Back/Forward arrows disappear from the top bar, web and desktop — unjustified move (product shape, no recorded decision)
  2. Back/Forward appear at the top of the desktop View menu — justified
  3. Menu Back/Forward works even with keyboard shortcuts toggled off — justified
  4. Windows/Linux items display Ctrl+←/→ unbound; macOS items show no chord — justified
  5. New history-step IPC and optional onHistoryStep bridge method — justified
  6. Menu step does nothing in the narrow/mobile layout — undeclared, harm-free
  7. Four tooltip strings removed from every locale — justified
  8. RouteHistoryTracker moved to its own file — justified
  9. Narrow-header CSS drop rung for the arrows removed — justified
  10. Two screenshots committed under temp-screenshots/ — rides along, repo convention

Blockers

product-shape change without accepted RFC — the header arrows are an existing user-facing capability, removed and replaced by desktop-only menu items. The deleted component's own comment pinned "the visible, surface-independent affordance"; the replacement is surface-dependent (Electron shell only), and the description's support is analogy ("Most sidebar-driven desktop apps … show no history arrows") — a proposal, not a decision. Base RFC list: nothing covers header navigation chrome (rfc-navigation-placement-seam is draft and is about the app rail; rfc-composable-layout-mechanism is the Members thread area). docs/decisions/ grepped for nav|back|forward|history|arrow: 0 entries.
Clears when: an RFC covering the arrows' removal merges non-draft on the base and the branch is pushed or rebased, or a maintainer records /ai-review override first-principles cc4a957e461418c346870525df4e94da38ef44cc: <decision>; if this is a fork PR, merge the RFC to base first or a maintainer pushes the branch to this repository.

[FIRST-PRINCIPLES-REVIEWED] cc4a957

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — 🔴 changes requested (blocking)

GPT 5.6 found at least one blocking issue that must be resolved before merging cc4a957e461418c346870525df4e94da38ef44cc. Adjudication upheld 1 of 1 blocking finding(s); those must be resolved before merging.

This comment is updated in place on each push.

BLOCKING -- src/kiro_crew/dashboard/session_control.py:5570 -- Tree truncation makes the omission count false
if len(children) < MAX_SESSION_STATUS_ROWS:
257 durable tree-only children -> session_status truncates before union counting -> returns 256 rows with roster_omitted: 0.
Anchor: a-bound-bounds-every-field-it-retains
Fix: Carry all tree child keys into the union; apply the cap only when rendering and calculating roster_omitted.
[BLOCK-MERGE] cc4a957
[GPT-REVIEWED] cc4a957

Adjudication (Opus 5) — is blocking on each finding proportionate?

Harm: MEDIUM — _created_tree_roster truncates at session_control.py:5570 before the union is formed, so roster_omitted = max(0, len(roster) - MAX_SESSION_STATUS_ROWS) at session_control.py:5763 computes 0 over an already-capped set; the only remaining signal is tree: "incomplete" (session_control.py:5575, surfaced at 5845), which is a quality flag, not the exact count the response promises at 5853-5857.
Anchor verified, not merely asserted: AUTOSDE.yaml:971-972 carries blocking: true with file-patterns: src/kiro_crew/**/*.py, and AUTOSDE.yaml:998-1004 requires overflow be COUNTED and said out loud once per snapshot, flagging exactly a len(...) < CAP guard whose truncated tail reads like a population never named.
Real fix is contained — carry all matching tree keys (bare slot keys, already resident in the in-memory fold read at 5561) and cap at the render loop 5764, or thread a tree_omitted count the way _created_history_roster already threads history_omitted (5630-5639) — but the rule's blocking flag outranks the weighing regardless.

[ADJUDICATION] cc4a957 total=1 uphold=1 downgrade=0
UPHOLD F1 src/kiro_crew/dashboard/session_control.py:5570 reason=autosde-blocking-rule
[GPT-ADJUDICATED] cc4a957

False positive or not applicable? A repository writer can comment:
/ai-review override gpt cc4a957e461418c346870525df4e94da38ef44cc: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5 Review — ✅ no blocking findings

Reviewed cc4a957e461418c346870525df4e94da38ef44cc — this comment is updated in place on each push.

Review details

Nothing blocks — one advisory finding: the replacement View menu items never disable, so they are silently dead in every state where the renderer suppresses the step.

FINDING — website/electron/app-menu.js:102 — the two new items carry no enabled flag (label: "Back", ... click: historyBack), while the renderer drops the step whenever canGoBack()/canGoForward() is false (useKeyboardShortcuts.ts:757-758; on a freshly launched window idx === 0 and maxIdx === null, so both are false) or isNarrowViewport() is true, so View → Back / Forward look live and do nothing with no feedback where the header arrows they replace greyed out (docs/feature-map/README.md: Each arrow disables when there is nowhere to go → A step does nothing when there is nowhere to go) → Fix: needs machinery outside this diff — subscribe to routeHistoryPosition in the renderer and push the two flags to main (the existing dev-mode-changed → devtools-toggle pattern), setting enabled on id-tagged Back/Forward items.

[OPUS-REVIEWED] cc4a957

Verdict parsed from the review's SHA-scoped output markers for commit cc4a957e461418c346870525df4e94da38ef44cc.

False positive or not applicable? A repository writer can comment:
/ai-review override fable cc4a957e461418c346870525df4e94da38ef44cc: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 28, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 28, 2026

Copy link
Copy Markdown
Contributor

Triage (automated, against origin/main @ cc7e79894e)

Rebase needed. The merge base e88e807786 is 1,163 commits behind main, and GitHub reports this PR as dirty (it has conflicts). Main has since changed files this PR edits: App.tsx (the app shell was split out in #15935, so <NavHistoryArrows /> now renders at App.tsx:1823), useKeyboardShortcuts.ts (#14873, #16779, #16348, #16757), index.css and window-lifecycle.js. The current diff can't be reviewed as-is.

Needs a merge discussion with #15656 (open, "collapse the desktop top bar instead of clipping it"). That PR treats the arrows as a live part of the top bar. It adds a collapse rung for them (.tb-flow.tbc-3 .tb-drop-navhistory{display:none} in index.css), copies NavHistoryArrows.tsx's markup into capture/topbar-search-variants.tsx, and probes .tb-drop-navhistory in capture-topbar-flow.mjs. This PR deletes the component and its 208px rung. Whichever PR lands second has to drop or rework those parts, so the two authors should agree on an order first.

Not in conflict: #11891 (open PR) maps the mouse buttons to the session MRU walk. That is a different input, and the description here already leaves it out of scope. #8258 is an issue (still open), not a PR.

There is no Breaking-Change or P0 finding, so this is a comment, not a change request. The new bridge method onHistoryStep is optional, the history-step IPC only adds behaviour, and neither menu item registers an accelerator. Two things already raised above are still open: the First-Principles BLOCK (the web dashboard loses its only on-screen Back/Forward, and no decision record covers that) and the menu items that never disable.

@iamwhatever

Copy link
Copy Markdown
Contributor

Thanks for working on moving Back/Forward into the View menu, @xuejinT. We're closing this draft because it has had no activity for over two weeks and main has moved on since (for example, website/src/test/RouteHistoryTracker.test.tsx that this PR edits no longer exists). You're welcome to reopen this or open a fresh PR against current main whenever you're ready.

@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Oct 22, 2026
@bolichen97
bolichen97 deleted the feat/nav-history-menu-no-arrows branch November 6, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants