This repository has been archived by the owner on Apr 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 316
fix: LEAP-248: Fix app crashing by hotkeys #1653
Merged
Merged
Conversation
This file contains 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
The 'unbind' function in Hotkey.ts has been enhanced to handle multiple keys provided as a string. A new helper function 'getKeys' was added to split the key string and return an array of keys. Each key in the array is then processed individually in the 'unbind' function. This helps keymaster to handle more that one hotkey.
Added a new mapping for the comma key in the ALIASES object. Also, refactored the applyAliases function to use the getKeys function for better tokenization and handling of keys. This change helps in fixing the keymaster inconsistencies with certain keys.
Gondragos
changed the title
Fb leap 248/multiple hotkeys
fix: LEAP-248: Fix app crashing by hotkeys
Dec 29, 2023
This was referenced Dec 29, 2023
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1653 +/- ##
=======================================
Coverage 64.56% 64.57%
=======================================
Files 443 443
Lines 28693 28699 +6
Branches 7519 7519
=======================================
+ Hits 18527 18532 +5
- Misses 10166 10167 +1 ☔ View full report in Codecov by Sentry. |
hlomzik
approved these changes
Jan 4, 2024
src/core/Hotkey.ts
Outdated
@@ -82,6 +82,7 @@ keymaster.filter = function(event) { | |||
const ALIASES = { | |||
'plus': '=', // "ctrl plus" is actually a "ctrl =" because shift is not used | |||
'minus': '-', | |||
',': '¼', // This should be a comma but it's not working with keymaster |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is it ¼
? pretty confusing
/git merge master
|
MasherJames
pushed a commit
to HelloPareto/label-studio-frontend
that referenced
this pull request
Feb 29, 2024
* fix: LEAP-248: Fix app crashing by multiple hotkeys The 'unbind' function in Hotkey.ts has been enhanced to handle multiple keys provided as a string. A new helper function 'getKeys' was added to split the key string and return an array of keys. Each key in the array is then processed individually in the 'unbind' function. This helps keymaster to handle more that one hotkey. * Add alias for comma to prevent keymaster fails Added a new mapping for the comma key in the ALIASES object. Also, refactored the applyAliases function to use the getKeys function for better tokenization and handling of keys. This change helps in fixing the keymaster inconsistencies with certain keys. * Add regression tests for hotkeys problem * Fix import paths * Improve the comment --------- Co-authored-by: hlomzik <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR
,
to avoid problems with itPR fulfills these requirements
Describe the reason for change
Keymaster can't handle unbinding of multiple keys. It also misunderstands
,
and thinks that it is two hotkeys in one (','
and''
). So that,
breaks application in two ways related to each other.What alternative approaches were there?
This change affects (describe how if yes)
Does this PR introduce a breaking change?
What level of testing was included in the change?
Which logical domain(s) does this change affect?
Hotkeys
,Labels