{{ message }}
fix: keep shared default shortcuts when resetting - #13172
Open
tiensonqin wants to merge 1 commit into
Open
Conversation
Resetting a command no longer strips the restored default key from peer commands that still use that key as a default (db-test#1152). User-customized collisions are still cleared. Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The logic change is localized, preserves intended shared-default behavior, and is covered by targeted tests for both shared-default and user-customized collision scenarios.
Pull request overview
This PR fixes shortcut reset behavior so that when two commands share the same default key binding, resetting one command no longer strips that shared default key from the other command’s binding.
Changes:
- Add reset conflict logic that preserves keys that are part of the peer command’s default binding while still removing user-customized collisions.
- Update
compute-reset-planto use the new conflict-update computation and to skip emitting conflict updates when nothing should be stripped. - Add CLJS tests covering shared-default preservation and user-customized collision stripping.
File summaries
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.

Fixes db-test#1152.
Resetting a command that shares a default key (for example Backspace on Delete Backward and Delete Selected Block) no longer removes that key from the peer command that still uses the default.
What changed
compute-reset-planstill detects keys owned by other commands, but it now leaves keys that belong to the peer's default binding. Only user-customized collisions are stripped and persisted.Tests
:editor/backspacedoes not strip Backspace from:editor/delete-selection:editor/delete-selectiondoes not strip shared defaults from:editor/backspaceor:editor/delete