Repository navigation
fix: unify desktop and Muya shortcut behavior and hints - #5887
Merged
Merged
Conversation
Contributor
|
Website preview ready: https://pr-5887-marktext-website.ransixi.workers.dev Built from |
1 task done
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.
Closes #2999
Closes #5155
Closes #4863
Muya's inline toolbar and quick-insert menu currently process their own command shortcuts and advertise bundled defaults. After rebinding or unbinding a desktop command, the old Muya shortcut can still execute and its tooltip can disagree with the application menu. For example, macOS inline code also responds to Control+Command+E even though the desktop command is Control+Command+C.
This change gives the desktop sole ownership of command shortcuts. All three Muya menus resolve hints from the active desktop map, including custom bindings and explicit unbinding. Saving settings updates open menus and editor windows immediately. Menu clicks and slash-menu navigation remain available, while native browser
format*events cannot mutate the editor DOM behind the document model.Changes
keyboardShortcuts: false,getShortcut(action)andrefreshShortcutHints(). Standalone consumers retain their default command handling.@hfelix/[email protected], following the direction recorded in [Bug] Keybindings recorder silently drops Shift for digit/punctuation combos (⌘⇧7 records as Cmd+7) #4863 / fix(desktop): preserve Shift for Cmd/Ctrl+digit keybindings (#4863) #4873. Recorder, validation, conflict checks, layout updates and Electron dispatch share the module; remove the dependency and untyped shim, and include the retained license in shipped notices.Ctrl+Plus.Explicit Shift chords now stay distinct:
Command+Shift+=does not silently executeCommand+=. The documented macOS Promote Heading binding remainsCommand+=.Registered command descriptions now refresh after the new locale finishes loading, while custom labels, command objects and active bindings are retained. The three Muya menus share their inherited options instead of keeping a second shortcut-options object. International-symbol and incomplete dead-key-layout regressions have dedicated tests.
Validation
All 21 GitHub checks passed for
b444a65e: Linux Electron E2E 482 passed / 5 skipped, Muya Chromium E2E 591 passed / 6 skipped, and all six OS/architecture packaging jobs passed.Desktop unit suite: 1366 passed. Muya unit suite: 3087 passed.
New Electron integration suite: 7 passed — custom binding / unbinding, native
formatBoldcancellation and DOM checks, old inline-code alias removal, Duplicate and undo, live hints, slash navigation, Preferences recording / Save / Unbind / Reset, restart persistence, multiple windows, equivalent shifted-symbol conflict rejection, and registered command names / Chinese search after cold and cached language changes.Existing Electron menu / paragraph / source-mode regressions: 19 passed.
Standalone Muya Chromium toolbar / shortcuts / front-menu / slash-menu regressions: 33 passed. Post-cleanup Muya toolbar / host-integration tests: 25 passed.
pnpm run build:unpack,pnpm run typecheck, root and Muya ESLint, Muya typecheck and circular-dependency check passed. Both modified stylesheets pass stylelint. Full Muya CSS lint still reports 7 existing specificity errors in untouchedblockSyntax.cssandinlineSyntax.css.Third-party notice generation verified with the vendored MIT copyright and license.
The current Preferences UI successfully records, saves and reloads custom bindings. After retesting with a fresh profile, #5117 was closed as not reproducible; this does not establish the cause of its original v0.19.1 failure. Related historical reports include #4687, #3630 and #4128. Thanks to @FurkaanBoraa for the earlier #4862 work; that overlapping PR was closed with thanks while consolidating this implementation.
Application-level injected events exercise Electron dispatch but bypass macOS global shortcut interception. Physical-keyboard macOS verification remains pending, as does Windows/Linux physical-keyboard verification. Platform packaging CI has passed. No claim of physical Dock-shortcut verification is made by these tests.
The desktop quick-insert E2E cases now use platform-specific desktop accelerators through Electron dispatch. Linux additionally checks that the old Muya Meta+Alt aliases no longer execute commands. The prior Linux failure exercised those intentionally disabled aliases.