feat(shortcuts): delete selected annotations with the delete key - #925
Merged
Conversation
The delete key had to reach the app while a checkbox or slider held focus, which the old dispatcher could not do: it watched vueuse magic keys, rebuilt every watcher whenever a binding changed, and decided whether to suppress a shortcut by asking what kind of element had focus. Shortcuts now dispatch from one keydown listener against a table of parsed bindings. Anything a control handles in script reports itself through preventDefault, so arbitration only has to cover what the browser does natively and no handler announces: typing into a field, Space or Enter activating a focused control, and the arrow keys stepping through a group of values. An action can name more than one key, since the main delete key reports Backspace on macOS. Hold actions read their state through useActionHeld instead of each view resolving a binding itself, and a binding no keystroke could produce is dropped from a loaded config with a warning rather than rejecting the file. Removing a selection says how many annotations went, because the selection can hold annotations with no visible cue in the current view and there is no undo.
✅ Deploy Preview for volview-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
The delete key had to reach the app while a checkbox or slider held focus, which the old dispatcher could not do: it watched vueuse magic keys, rebuilt every watcher whenever a binding changed, and decided whether to suppress a shortcut by asking what kind of element had focus.
Shortcuts now dispatch from one keydown listener against a table of parsed bindings. Anything a control handles in script reports itself through preventDefault, so arbitration only has to cover what the browser does natively and no handler announces: typing into a field, Space or Enter activating a focused control, and the arrow keys stepping through a group of values.
An action can name more than one key, since the main delete key reports Backspace on macOS. Hold actions read their state through useActionHeld instead of each view resolving a binding itself, and a binding no keystroke could produce is dropped from a loaded config with a warning rather than rejecting the file.
Removing a selection says how many annotations went, because the selection can hold annotations with no visible cue in the current view and there is no undo.