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

Merged
merged 1 commit into from
Jul 11, 2024

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 a review from a team May 30, 2024 20:06
@rexxars rexxars requested a review from a team as a code owner 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 Jul 11, 2024 6:06pm
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 11, 2024 6:06pm
test-compiled-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 11, 2024 6:06pm
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 11, 2024 6:06pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 11, 2024 6:06pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Jul 11, 2024 6:06pm

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented May 30, 2024

Component Testing Report Updated Jul 11, 2024 6:11 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 36s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 6s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 27s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 31s 11 7 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 14s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 8s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 37s 3 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 35s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 15s 20 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 5s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 7s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 21s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 14s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 1m 3s 21 0 0
formBuilder/tree-editing/TreeEditing.spec.tsx ✅ Passed (Inspect) 1m 34s 30 0 0
formBuilder/tree-editing/TreeEditingNestedObjects.spec.tsx ✅ Passed (Inspect) 19s 3 0 0

juice49
juice49 previously approved these changes Jun 17, 2024
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!

sjelfull
sjelfull previously approved these changes Jun 21, 2024
@rexxars rexxars dismissed stale reviews from juice49 and sjelfull via 3a10939 July 11, 2024 17:56
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.

4 participants