cmux NEXT: mouse buttons 4 and 5 go back and forward

Merged
TE
18d ago
+242-12

Mouse buttons 4 and 5 now go back and forward in cmux NEXT, as they do in Chrome, Safari, Claude and Codex. Before this, nothing listened for them.

  • Over a browser tab (its page or its toolbar), they walk that tab's history. They use the same BrowserChromeView command as browserBack / browserForward.
  • Anywhere else, they run Go Back / Go Forward (focusHistoryBack / focusHistoryForward). That's the shown page's own history first (App Store, New Tab to chat), then the location trail, as plans/cmux-next/history.md 4.2b describes.
  • A remote desktop in control mode keeps the buttons and sends them to its host, like every other button.
  • A Chromium page draws in its own child window, so a click there arrives in that window. The tab is found in the cmux window that holds it.
  • The press is consumed and the release navigates, as in Chrome.
  • Debug Settings > Back and Forward > navigation.mouseSideButtons is on by default and turns this off.

The trackpad swipe (in progress, separate PR) uses the same browser path.

Changelog

Added: mouse buttons 4 and 5 go back and forward in browser tabs and through Go Back / Go Forward elsewhere.

Proof

Not UI: an input route with no new view. MouseSideButtonsTests cover:

  • the button mapping
  • the routing split
  • the remote-desktop hit test

Observed / Not run

  • Observed: the PR's CI compile and tests (see checks).
  • Not run: a click with a physical mouse on a running build. No GUI runner has a mouse with side buttons, and debug.mouse can't synthesize buttons 4 and 5 yet.

šŸ¤– Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Mouse buttons 4 and 5 now go back and forward in cmux NEXT, matching Chrome, Safari, Claude, and Codex. Before this, nothing listened for them.

Details

  • Over a browser tab they walk that tab's history via the same command as browserBack / browserForward; anywhere else they run Go Back / Go Forward.
  • A remote desktop in control mode keeps the buttons and sends them to its host, like every other button.
  • The release follows the route its press chose, so a press that went to a remote host never navigates after control mode changes or the pointer moves.
  • The press is consumed and the release navigates, as in Chrome. A Chromium page draws in its own child window, so the tab is found in the cmux window that holds it.
  • Debug Settings > Back and Forward > navigation.mouseSideButtons is on by default and turns this off.
  • The regenerated defaults schema drops a stale key.agentPane.searchFiles entry and adds setting.browser.verificationAutofill.enabled.