Skip to content

Quick view hotkey tooltips#9567

Draft
AndrejOros wants to merge 1 commit intodevelopfrom
fb-quick-view-hotkey-tooltips-696b
Draft

Quick view hotkey tooltips#9567
AndrejOros wants to merge 1 commit intodevelopfrom
fb-quick-view-hotkey-tooltips-696b

Conversation

@AndrejOros
Copy link
Contributor

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:

  1. CSS class mismatch: The <kbd> elements for hotkeys were rendered with the class lsf-hotkey__key, but the corresponding styling in App.scss was defined for lsf-key-group__key. This resulted in unstyled, unseparated text.
  2. Missing separators: There was no explicit + symbol rendered between individual keys in multi-key combinations.

Solution

  1. web/libs/editor/src/core/Hotkey.ts:
    • Updated the class name for <kbd> elements from cn("hotkey").elem("key") to cn("key-group").elem("key") to match the existing CSS.
    • Introduced <span>+</span> elements as visual separators between keys in multi-key hotkey combinations.
  2. web/libs/editor/src/components/App/App.scss:
    • Added styling for the new .key-group__separator elements.
    • Adjusted .key-group display properties for proper alignment.
    • Removed the now-redundant &__key + &__key margin 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

  • Manually verified that hotkey tooltips for Play/Pause (video/audio), Create Relation, and Edit Region Meta now display correctly with proper key styling and + separators.
  • Ran tsc and eslint to 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

  • Pay close attention to the class name change in Hotkey.ts and the addition of separator <span> elements.
  • Review the new CSS rules in App.scss for the separators and the key-group adjustments.

General notes

This fix applies to all instances where Hotkey.Tooltip is used, ensuring a consistent and correct display of hotkey combinations across the Annotation UI.


Open in Web Open in Cursor 

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
Copy link

cursor bot commented Mar 10, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@netlify
Copy link

netlify bot commented Mar 10, 2026

Deploy Preview for heartex-docs canceled.

Name Link
🔨 Latest commit 1b705e4
🔍 Latest deploy log https://app.netlify.com/projects/heartex-docs/deploys/69afea0e0e6cb8000842c405

@netlify
Copy link

netlify bot commented Mar 10, 2026

Deploy Preview for label-studio-docs-new-theme canceled.

Name Link
🔨 Latest commit 1b705e4
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-docs-new-theme/deploys/69afea0e2d8255000879d891

@netlify
Copy link

netlify bot commented Mar 10, 2026

Deploy Preview for label-studio-storybook ready!

Name Link
🔨 Latest commit 1b705e4
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-storybook/deploys/69afea0e7a29e90008c22fbd
😎 Deploy Preview https://deploy-preview-9567--label-studio-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Mar 10, 2026

Deploy Preview for label-studio-playground ready!

Name Link
🔨 Latest commit 1b705e4
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-playground/deploys/69afea0e298019000871843c
😎 Deploy Preview https://deploy-preview-9567--label-studio-playground.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants