Draft
Conversation
The Hotkey.Tooltip component was generating <kbd> elements with the class
'hotkey__key' (via cn('hotkey').elem('key')), but no CSS rule existed for
that class. The actual key badge styles are defined under '.key-group__key'
in App.scss.
Changes:
- Fix BEM class name in Hotkey.Tooltip from cn('hotkey').elem('key') to
cn('key-group').elem('key') so <kbd> elements match existing CSS styles
- Add explicit '+' separator elements between keys in multi-key combos
(e.g. Ctrl+Alt+Space) for clarity even without full CSS rendering
- Add .key-group__separator CSS for the plus sign between keys
- Add inline-flex and align-items to .key-group for proper alignment
Affected tooltips: Play/Pause (video/audio), Create Relation, Edit
Region Meta, and all other buttons using Hotkey.Tooltip.
Co-authored-by: AndrejOros <AndrejOros@users.noreply.github.com>
|
Cursor Agent can help with this pull request. Just |
✅ Deploy Preview for heartex-docs canceled.
|
✅ Deploy Preview for label-studio-docs-new-theme canceled.
|
✅ Deploy Preview for label-studio-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for label-studio-playground ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Reason for change
This PR fixes a long-standing visual bug where hotkey tooltips (e.g., for Play/Pause, Create Relation, Edit Region Meta) displayed key combinations incorrectly, showing "ctrlaltspace" instead of "Ctrl+Alt+Space".
The root causes were:
<kbd>elements for hotkeys were rendered with the classlsf-hotkey__key, but the corresponding styling inApp.scsswas defined forlsf-key-group__key. This resulted in unstyled, unseparated text.+symbol rendered between individual keys in multi-key combinations.Solution
web/libs/editor/src/core/Hotkey.ts:<kbd>elements fromcn("hotkey").elem("key")tocn("key-group").elem("key")to match the existing CSS.<span>+</span>elements as visual separators between keys in multi-key hotkey combinations.web/libs/editor/src/components/App/App.scss:.key-group__separatorelements..key-groupdisplay properties for proper alignment.&__key + &__keymargin rule.Screenshots
(Please add "Before" and "After" screenshots of affected tooltips, e.g., Play/Pause, Create Relation, Edit Region Meta, to demonstrate the fix.)
Rollout strategy
Standard deployment. No feature flags are involved.
Testing
+separators.tscandeslintto ensure no new compilation or linting issues were introduced.Risks
Low. The changes are primarily visual (CSS and minor JSX adjustments) and do not alter the underlying hotkey functionality or logic.
Reviewer notes
Hotkey.tsand the addition of separator<span>elements.App.scssfor the separators and thekey-groupadjustments.General notes
This fix applies to all instances where
Hotkey.Tooltipis used, ensuring a consistent and correct display of hotkey combinations across the Annotation UI.