Skip to content

feat(desktop): add back and forward history menus - #6858

Draft
matt2e wants to merge 5 commits into
mainfrom
jitter/back-history-menu
Draft

feat(desktop): add back and forward history menus#6858
matt2e wants to merge 5 commits into
mainfrom
jitter/back-history-menu

Conversation

@matt2e

@matt2e matt2e commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add browser-style history menus to both Back and Forward in the desktop top chrome
  • open either menu by right-clicking or holding the button, with up to 10 destinations in navigation order
  • share one menu implementation across both controls, preserve guarded multi-entry jumps, and assert right-click and hold render pixel-identically from the same state

Testing

  • pnpm test (5,513 passed)
  • pnpm typecheck
  • pnpm check
  • pnpm build:e2e
  • CI=1 playwright test tests/e2e/navigation.spec.ts --project=smoke (20 passed, 1 pre-existing fixme skipped)

@matt2e
matt2e requested a review from a team as a code owner August 26, 2026 05:35
@matt2e
matt2e marked this pull request as draft August 26, 2026 05:41
@matt2e matt2e changed the title feat(desktop): add back history menu feat(desktop): add back and forward history menus Aug 26, 2026
matt2e and others added 5 commits August 28, 2026 10:37
Co-authored-by: Jitter <d14dfe033ef0f809866f9f984de04821b0d900d7652fd85a54776ee40ca3a68f@buzz.block.builderlab.xyz>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Co-authored-by: Jitter <d14dfe033ef0f809866f9f984de04821b0d900d7652fd85a54776ee40ca3a68f@buzz.block.builderlab.xyz>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Co-authored-by: Jitter <d14dfe033ef0f809866f9f984de04821b0d900d7652fd85a54776ee40ca3a68f@buzz.block.builderlab.xyz>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Resolves the review comments on the back/forward history menus.

A `replace: true` navigation mints a fresh __TSR_key at the *same*
history index, which the old heuristic read as "the forward stack was
truncated". Mid-history replaces — the huddle redirects, settings
section switches, `goHome({ replace: true })` — therefore wiped the
tracked forward entries and disabled the forward control even though
`history.go(1)` still worked. Only a push moves the index forward, so
truncation now keys off an index that advanced past a stale entry.

The fold is extracted as a pure `recordHistoryVisit` reducer so the
push/replace/traverse cases are unit-testable without a renderer.

Also:

- Route labels move to a table that falls back to the raw pathname. The
  old chain ended in `return "Inbox"`, so any future route would have
  shown up in the menus as the inbox with nothing to flag the omission.
- The right-click vs long-press E2E now compares menu geometry and item
  text instead of raw screenshot bytes; a mismatch names the field that
  drifted rather than handing back an opaque Buffer diff.

The reported left-click-while-open double action does not reproduce:
Radix's modal dismiss layer sets `pointer-events: none` on the body, so
the click lands on the layer and never reaches the button — one click
dismisses and nothing else, matching the native control. Locked in with
an E2E case that also proves the next click still navigates.

Verified: pnpm typecheck, pnpm check, pnpm test (5517 pass),
check:file-sizes, and the navigation smoke spec (21 pass, 1 pre-existing
fixme).

Signed-off-by: Matt Toohey <contact@matttoohey.com>
AppShell.tsx crossed the 1000-line desktop ratchet again after the
forward-history wiring. Move the community destination restore effect
into its own hook alongside useCommunityNavigationTransitions instead of
squeezing the call site further.

Signed-off-by: Matt Toohey <contact@matttoohey.com>
@matt2e
matt2e force-pushed the jitter/back-history-menu branch from cea3f22 to 25a8579 Compare August 28, 2026 00:45
@github-actions

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is 350caf1de3136f6ec473a69d394544e99dfd4d85...25a8579b0756e362286a028431562af840c1f9b3.
A new review must complete for this exact range. When manual authorization
is required, a Block organization member must comment exactly
@buzz-security-review 25a8579b0756e362286a028431562af840c1f9b3 to authorize a new review.
Any previous review applies only to its recorded range.

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.

1 participant