Skip to content

feat(shortcuts): list Undo, Redo, Cut, Copy and Paste in the shortcuts panel - #1049

Merged
PathGao merged 1 commit into
masterfrom
feat/shortcuts-list-clipboard-undo
Oct 29, 2026
Merged

PathGao merged 1 commit into
masterfrom
feat/shortcuts-list-clipboard-undo

Conversation

@PathGao

@PathGao PathGao commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #997. After 2.9.0 added Undo and Redo to the editor's right-click menu, the reporter asked for them in Settings › Shortcuts too. The panel now lists Undo, Redo, Cut, Copy and Paste at the top of Edit. A toolbar button is not part of this: the toolbar is already full.

Cut, Copy and Paste are the app's own bindings (cutToClipboard, custom-copy, pasteFromClipboard), so their rows use the existing editorCommand and editorAction checks. The registry had left them out on purpose, so that exclusion and the matching exemption lists in the tests are removed. Undo and Redo are Monaco's own commands, and nothing the existing checks read can confirm them. Those rows get a new monacoCommand field. A test in editor.chords.spec.ts checks each such row against Monaco's real keymap on all three platforms, and also checks that the app doesn't bind the chord itself. Redo shows only Mod+Shift+Z, because Mod+Y is not bound on macOS and a row has one chord list for every platform. toMonacoLabel moves into keymapHarness.ts so the spec can use it, which also removes the two copies in the shortcuts tests.

Verified: npm test (945 pass), npm run test:vitest (741 pass), npm run check, eslint on the changed files. Changing Redo's chord to Mod+Y makes the new spec fail with "macOS: edit-redo (Meta+Y) is not Monaco's redo". On a macOS release test bundle, Settings › Shortcuts shows the five rows with Cmd+Z, Cmd+Shift+Z, Cmd+X, Cmd+C and Cmd+V. Not checked on Windows or Linux.

…s panel

Undo and Redo are Monaco's own commands, so their rows name the Monaco command and editor.chords.spec.ts checks them against Monaco's keymap. toMonacoLabel moves into keymapHarness so that spec can use it.
@PathGao
PathGao merged commit dd491fa into master Oct 29, 2026
4 checks passed
@PathGao
PathGao deleted the feat/shortcuts-list-clipboard-undo branch October 29, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant