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: make splitpanes responsive for minimal breakpoint #4893

Merged
merged 3 commits into from
Oct 5, 2023

Conversation

kmelve
Copy link
Member

@kmelve kmelve commented Sep 2, 2023

Description

This PR makes the Vision plugin somewhat more responsive for narrow(er) screens by:

  • Tuning the responsive grid column values so the 3-4 option boxes collapse more neatly
  • Adjust the vertical/horizontal props and sizing to the split panes so they change direction beneath the narrowest breakpoint (600px).

This is useful when you want to test a query on mobile or with a narrow studio in a browser‘s split pane. The balance between the query/param/results panes could probably be tuned a tiny bit more, but it's at least functional.

localhost_3333_test_vision(iPhone 12 Pro)

What to review

I did try to see if there was a way to reuse the Sanity UI logic to get the breakpoints but ended up doing a simple window.innerWidth < 600 wrapped in the narrowBreakpoint() function.

Notes for release

Responsive improvements to the Vision plugin to accommodate narrower screens.

@kmelve kmelve requested a review from sjelfull September 2, 2023 22:56
@vercel
Copy link

vercel bot commented Sep 2, 2023

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

Name Status Preview Comments Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview Sep 6, 2023 1:38pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 6, 2023 1:38pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Sep 6, 2023 1:38pm

@github-actions
Copy link
Contributor

github-actions bot commented Sep 2, 2023

Component Testing Report Updated Sep 6, 2023 1:35 PM (UTC)

File Status Duration Passed Skipped Failed
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 8s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 8s 3 0 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 10s 6 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 12s 9 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 45s 18 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 10s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 6s 3 0 0

@sjelfull sjelfull requested a review from a team September 4, 2023 13:40
@bjoerge bjoerge changed the title feat: Chore/fix vision reponsiveness feat: make splitpanes responsive for minimal breakpoint Sep 5, 2023
Copy link
Member

@bjoerge bjoerge left a comment

Choose a reason for hiding this comment

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

Nice - thanks @kmelve!

packages/@sanity/vision/src/components/VisionGui.tsx Outdated Show resolved Hide resolved
Copy link
Member

@sjelfull sjelfull left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM!

@bjoerge bjoerge force-pushed the chore/fix-vision-reponsiveness branch from 0d92f82 to e860660 Compare September 6, 2023 13:31
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.

4 participants