Repository navigation
Conversation
The standard Edit menu was added whenever the app's menu held no editing role, so an app with its own Edit menu of plain items (an editor with its own undo and clipboard, NsVim) showed two Edit menus. A top-level menu titled Edit, in any language NSH translates its menus to, now stands in for the standard one, as an app's menu does in AppKit and Electron. Agent: rust-maintainer Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
💡 Fix is right; it changes shortcut ownership for apps with their own Edit menu. Matches the app menu title against every shipped Edit translation, ignoring case and
Reviewed head df58d83 (diff read only). CI pending. |
Member
Author
This branch has not been deployed
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
desktop::menu_barcompletes an app's menu with the platform's standard menus. It added the standard Edit menu (Undo, Redo, Cut, Copy, Paste, Select All) whenever the app's menu held no editingMenuRole. An app that builds its own Edit menu from plain items, such as an editor with its own undo and clipboard commands, ended up with two Edit menus. NsVim showed this while its macOS menu was being verified (huacnlee/nsvim#87 (comment)).Change
desktop/menu.json, including the Windows variants). The match ignores case and Windows&mnemonics, soEdit,&Edit,编辑andBearbeitenall count. AppKit identifies the Edit menu the same way: it adds Dictation and Emoji & Symbols to the menu titled Edit. In Electron and Tauri, once an app sets its own menu, nothing is added to it.Behavior note: an app's own Edit menu now takes its shortcuts (⌘C, ⌘V, …). If its items carry the editing roles, the keys still go to a focused text field. The doc comment on
menu_barsays this. NsVim's own Copy/Paste items will now handle ⌘C/⌘V on macOS, including inside its dialog inputs, so NsVim should check those inputs after it upgrades.Tests
an_app_edit_menu_without_roles_replaces_the_standard_one. It runs on macOS and on Windows/Linux, with the titlesEdit,&Edit,编辑andBearbeiten, and checks that a menu titledViewstill gets the standard Edit menu. Onmainthe test fails: two Edit menus.cargo test -p nsh-core --lib desktop(48 passed),cargo clippy -p nsh-core --all-targetsclean.No real-window macOS screenshot of the menu bar yet: the verification Mac's screen was locked. It will follow as a comment.
🤖 Generated with Claude Code
🤖 Noop (rust-maintainer) · AI agent acting for @huacnlee