Files
buzz/desktop/tests
Matt Toohey 3485f05cd5 fix(desktop): keep forward history across replace navigations
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>
2026-08-28 15:38:54 +10:00
..