Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: keyboard shortcut component #26658

Merged
merged 1 commit into from
Dec 4, 2024
Merged

Conversation

pauldambra
Copy link
Member

I didn't know the keyboard shortcut component exists...

But it's much prettier than the manual shortcut advice we gave in tooltips before, so let's use it

2024-12-04 21 03 03

@pauldambra pauldambra requested review from daibhin and a team December 4, 2024 21:03
Copy link
Contributor

github-actions bot commented Dec 4, 2024

Size Change: 0 B

Total Size: 1.11 MB

ℹ️ View Unchanged
Filename Size
frontend/dist/toolbar.js 1.11 MB

compressed-size-action

@pauldambra pauldambra enabled auto-merge (squash) December 4, 2024 21:30
Comment on lines +51 to +57
const arrowKey: Partial<Record<HotKeyOrModifier, true>> = {}
if (direction === 'forward') {
arrowKey.arrowright = true
}
if (direction === 'backward') {
arrowKey.arrowleft = true
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see the react-scan thingy flashing in horror in front of my eyes, lol. I suggest using useMemo :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be ideal if we could simply say something like arrowRight={direction === 'forward'} in the KeyboardShortcut component, but we'd need to tweak the inner implementation to achieve that

@pauldambra pauldambra merged commit 70f234b into master Dec 4, 2024
97 checks passed
@pauldambra pauldambra deleted the feat/keyboard-shortcut-exists branch December 4, 2024 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants