fix(settings): classify every find command as global so a grid binding cannot shadow one - #2458
Merged
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Signed-off-by: Ngô Quốc Đạt <datlechin@gmail.com>
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.
Follow-up to #2453. That PR was squash-merged carrying only its first commit, so the fix below never reached
main.Codex
adversarial-reviewreturnedNo-shipon #2453:The defect
Assign
Cmd+Fto Find Next, accepting the conflict against Find. Then assignCmd+Fto Toggle Filters. The second assignment is accepted, becausefindNextis classified.editorwhiletoggleFiltersis.dataGrid, sofindConflicttreats them as non-overlapping. Both are nil-targetedNSMenuItemkey equivalents, so AppKit blanks one of the two and the user silently loses a command.That classification was wrong on its own terms.
MainSplitViewController.findNextandfindPreviousboth branch onhasActiveGridFindand route to the grid or the editor, exactly asperformFinddoes. Context is what the conflict resolver uses to decide whether two bindings can collide, and a menu key equivalent is claimed window-wide, so a menu-backed command serving both surfaces has to declare the context that overlaps both..findwas already.globalfor precisely this reason in #2453. Its two siblings were left behind.The change
All three find commands are now
.global. That is the whole fix.Also fixed, and released rather than new
This closes a pre-existing hole with the same cause: binding a data grid action to
Cmd+Graised no conflict against Find Next, because.dataGridand.editordo not overlap, and AppKit then blanked one.MainMenuStructureTests.keyEquivalentsAreUniquecould not catch it, because it only builds the default menu. There is now a regression test for it, and a CHANGELOG entry, since unlike theCmd+Fpath this one is in a shipped build.Verification
Built and tested against merged
main:verify.sh buildverify.sh test(14 menu + keyboard suites)Tests added: every find command reports
.global;Cmd+Fparked on Find Next is still reported against a later filter bar claim; and a grid binding onCmd+Gconflicts with Find Next.Note on scope
The uniqueness guarantee lives in conflict detection, not in the data model:
KeyboardSettings.shortcut(for:)returns an explicit override unconditionally, so two overrides on one key would both resolve. Detection is what prevents that pair being created, and after this change it does. Closing the model-level gap as well would be defense in depth against anything writingKeyboardSettingswithout going through the recorder, and is deliberately left out of this PR.