Files
multica/apps/web/platform
d1e9a2ccb9 feat(shortcuts): browser-style Cmd+[ / Cmd+] history navigation (#6728)
* feat(shortcuts): add browser-style Cmd+[ / Cmd+] history navigation

Wire Mod+[ (back) and Mod+] (forward) to the shared navigation history so
users can move through their in-app history like a browser, on both web and
desktop. The bindings are added as configurable navigation actions in the
existing keyboard-shortcut registry, so they surface in Settings and can be
rebound or disabled. They do not fire while focus is inside an input,
textarea, or contenteditable.

The navigation adapter gains an optional forward() (web -> router.forward,
desktop -> tab-store goForward); back() already existed. GlobalShortcuts maps
the two new actions to navigation.back() / navigation.forward?.().

Refs #1727

* fix(shortcuts): route desktop Cmd+[ / ] through the registry, not the tab-history hook

useNavigationInputBindings (#6667) already binds Cmd/Ctrl+[ and +], and this
PR also registers them as goBack/goForward in packages/core/shortcuts (driven
by <GlobalShortcuts>). DesktopShell mounts both, so a single bracket press
navigated twice — hidden below a history depth of 3 by stepHistory's clamp.
Drop the [ / ] branches from useNavigationInputBindings (keeping Cmd/Ctrl+arrows
and the mouse side buttons); both surfaces now take the rebindable brackets
from the shared registry. Addresses review feedback on #1727.

* docs(navigation): correct the forward() optionality rationale

The dedicated issue window was cited as an adapter whose missing forward()
makes the chord a no-op, which reads as if the history shortcuts reach that
window. They do not: issue-window.tsx never mounts <GlobalShortcuts>, so
goBack/goForward are not wired there at all. Its adapter does step back with
navigate(-1) and genuinely has no forward counterpart, so the optionality is
still right — state that as a contract property rather than a live no-op path.

Co-authored-by: multica-agent <[email protected]>

---------

Co-authored-by: Bohan-J <[email protected]>
Co-authored-by: multica-agent <[email protected]>
2026-08-11 13:47:47 +08:00
..