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(desk): use correct dialog positioning at smaller breakpoints #4894

Conversation

robinpyon
Copy link
Contributor

@robinpyon robinpyon commented Sep 5, 2023

Description

This PR ensures that object dialogs are correctly positioned at smaller breakpoints (when the desk collapses into a single pane layout).

There was previously a mismatch between theme breakpoints (used by <DialogProvider>) and the minWidth value in <StyledPaneLayout>. Desk would collapse into a single pane at 512px whilst dialogs would only use fixed positioning at < 360px.

This PR ensures the desk tool will collapse at a theme media breakpoint instead of a hardcoded value, so it should be in lock-step with <DialogProvider> moving forward.

What to review

Collapse your viewport enough so that the studio desk collapses into a single column layout.

In the following examples, scroll to the bottom of the page and click either the 'Sydney' or 'Melbourne' events

In the after case, object dialogs should appear correctly when scrolled down the page.

One byproduct of this change is that the studio collapses to a single column breakpoint a little earlier than previously (600px vs 512px). I believe this is an acceptable trade-off, but please chime if you think otherwise @kaylasanity

Notes for release

Fixes an issue where dialogs wouldn't correctly appear at smaller breakpoints

@vercel
Copy link

vercel bot commented Sep 5, 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 11:40am
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 6, 2023 11:40am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Sep 6, 2023 11:40am

@robinpyon robinpyon requested review from ninaandal, kaylasanity and a team September 5, 2023 10:25
@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

Component Testing Report Updated Sep 6, 2023 11:41 AM (UTC)

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

Copy link
Contributor

@ninaandal ninaandal left a comment

Choose a reason for hiding this comment

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

This is great, thank you Rob 😃

Co-authored-by: Nina Andal Aarvik <nina@sanity.io>
@robinpyon robinpyon added this pull request to the merge queue Sep 8, 2023
Merged via the queue into next with commit e62906f Sep 8, 2023
16 checks passed
@robinpyon robinpyon deleted the feature/edx-197-studio-dialogs-are-incorrectly-positioned-on-mobile branch September 8, 2023 11:34
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

4 participants