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

fix(core): restore platform-aware keyboard shortcuts #6819

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

rexxars
Copy link
Member

@rexxars rexxars commented May 30, 2024

Description

Seems the facelift PR caused a regression that basically reverted this PR in terms of end result.

This PR reverts to using the <Hotkeys> component from the sanity core, which is platform aware.

What to review

  • Shows Ctrl + Option + P on publish and similar, when on Mac
  • Shows Ctrl + Alt + P on publish and similar, when not on Mac

(This should be uncovered by the test suite, fwiw)

Testing

I added one test for this in the publish action. Ideally I would test all the different locations that use any kind of hotkeys that may involve the Alt key, but that would be a lot of tests in a lot of different places. I may introduce an ESLint rule to disallow the use of <Hotkeys> from @sanity/ui later.

Notes for release

  • Fixes a regression causing platform-aware hotkeys not to be displayed in tooltips

@rexxars rexxars requested review from a team as code owners May 30, 2024 20:06
@rexxars rexxars requested review from sjelfull and ricokahler and removed request for a team May 30, 2024 20:06
Copy link

vercel bot commented May 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2024 1:14pm
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2024 1:14pm
test-compiled-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2024 1:14pm
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2024 1:14pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2024 1:14pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Jun 21, 2024 1:14pm

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented May 30, 2024

Component Testing Report Updated Jun 21, 2024 1:18 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 37s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 7s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 26s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 32s 11 7 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 15s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 9s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 44s 2 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 36s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 16s 20 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 6s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 7s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 22s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 15s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ❌ Failed (Inspect) 1m 10s 20 0 1

Copy link
Contributor

@juice49 juice49 left a comment

Choose a reason for hiding this comment

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

Looks good to me!

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.

None yet

3 participants