Repository navigation
Conversation
|
The following comment was made by an LLM, it may be inaccurate: |
There was a problem hiding this comment.
The change looks correct and I have no blocking concerns. I couldn't run the Electron app here (no display), so I checked by reading the code and type-checking packages/desktop, which passes.
On Windows/Linux, Electron's fileMenu role holds only Quit, and editMenu/viewMenu match the default menu's groups. The only shortcut this drops is the Window menu's Close (Ctrl+W), so no new shortcuts appear. Rebuilds from refreshMenu go through the same branch, so the menu stays installed.
Public API: unchanged.
Two small points, neither blocking:
- Until
createMenufirst runs (when windows are restored or translations arrive), Electron's default menu, still with Ctrl+W, is briefly active. - Keeping
minimizekeeps Ctrl+M as a minimize shortcut, which #34937 also complained about. That's fine to leave for this fix.
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #52683
Type of change
What does this PR do?
On Windows and Linux the desktop app never installs its own menu (createMenu returns early unless the platform is darwin), so Electron keeps its default application menu. That default menu binds Close to Ctrl+W, which closes the whole window before the app's tab.close shortcut (mod+w) can run, so Ctrl+W quit the app instead of closing the tab.
I install an equivalent menu on non-macOS that leaves out the close accelerator (file/edit/view plus a Window menu with only minimize). The menu bar is hidden there anyway, so it only exists for the other shortcuts, which keep working. macOS is unchanged, and this is the V2 port of #53600 (closed because dev had moved to V2).
How did you verify your code works?
Ran bun run --cwd packages/desktop typecheck and oxlint on the changed file. Both pass; oxlint reports 0 errors (2 warnings also present on dev before this change). Also ran the dev build on Linux with a couple of tabs open: Ctrl+W closes the active tab and the window stays, and Ctrl+R, F11, Ctrl+M and Ctrl+Q still work.
Screenshots / recordings
N/A, no visual change.
Checklist
Added by the opencode bot (AI-generated).
Related: #34937, #37610