Bind Cmd+[ / Cmd+] to back/forward in the desktop app#1228
Merged
Conversation
The desktop window loads the web shell, which navigates with browser history (TanStack Router pushState). On the web the browser chrome handles the standard back/forward keys, but in the Electron window there is no chrome, and the app menu is built entirely from roles, none of which carry Back/Forward. Electron binds none of these shortcuts by default, so Cmd+[ and Cmd+] were dead keys. Add a History menu with Back (Cmd+[) and Forward (Cmd+]), Ctrl+[ / Ctrl+] on Windows/Linux, driving the focused window's navigation history. The canGoBack/canGoForward guards make the keys no-ops at the ends of the stack, matching how they behave in a browser.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-marketing | 67fde7c | Commit Preview URL Branch Preview URL |
Jun 30 2026, 06:31 PM |
Contributor
Cloudflare previewTorn down — the PR is closed. |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-cloud | 67fde7c | Jun 30 2026, 06:33 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In the desktop app, the standard macOS back/forward shortcuts (Cmd+[ and Cmd+]) do nothing. The window loads the web shell, which navigates with browser history (TanStack Router pushState). On the web the browser chrome handles those keys, but inside the Electron window there is no chrome, and the application menu is built entirely from Electron roles (editMenu, viewMenu, windowMenu), none of which carry Back or Forward. Electron binds none of these shortcuts by default, so the keys were dead.
Fix
Add a History menu with Back (Cmd+[) and Forward (Cmd+]), Ctrl+[ / Ctrl+] on Windows and Linux, that drives the focused window's
webContents.navigationHistory. ThecanGoBack/canGoForwardguards make the keys no-ops at the ends of the history stack, matching how they behave in a browser. This follows the existing pattern in the same file where an explicit File menu was added purely to bind the Cmd+W close accelerator. It also places these shortcuts where Safari and Chrome put them.Verification
bun run typecheck(apps/desktop),oxlintwith--deny-warnings, andoxfmt --checkall pass.