-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Remove viewport check from useZoomOut hook #66341
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +6 B (0%) Total Size: 1.81 MB
ℹ️ View Unchanged
|
The useZoomOut hook should not be responsible for checking viewport width. It should respect the desired zoom out level passed by the condition. We should decide if we want to enter zoom out or not where we implement the zoom out hook (the inserter menu).
0bf119a
to
4e2af1e
Compare
Flaky tests detected in e95a1e7. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11488132224
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw this comment. I updated the useZoomOut
hook to always disable zoom out mode on small viewports, but if that's not ideal I'd like to update #66330.
I think zoom out can still be valid for smaller screens, so I'd rather not force |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Am I correct that #66330 is only needed if this is not backported in time? |
The reason I submitted #66330 is because #66308 cannot be backported to the And since this PR is a follow-up to #66308, I don't think this PR can be backported to wp 6.7. I think #66330 should be merged into the |
IIUC, should we remove the backport label on this PR? I'll remove it. Feel free to add it back if I'm misunderstanding something! 🙇 |
Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com>
The useZoomOut hook should not be responsible for checking viewport width. It should respect the desired zoom out level passed by the condition. We should decide if we want to enter zoom out or not where we implement the useZoomOut hook (the inserter menu). --------- Co-authored-by: jeryj <jeryj@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: kevin940726 <kevin940726@git.wordpress.org> Co-authored-by: PARTHVATALIYA <parthvataliya@git.wordpress.org> Co-authored-by: getdave <get_dave@git.wordpress.org>
Follow up to #66308
What?
Moves the viewport check to the inserter menu instead of within the useZoomOut hook.
Why?
The useZoomOut hook should not be responsible for checking viewport width. It should respect the desired zoom out level passed by the condition. We should decide if we want to enter zoom out or not where we implement the zoom out hook (the inserter menu).
How?
Moves the viewport check to the inserter menu instead of within the useZoomOut hook. Also, rather than matching on is wide, we're checking for the condition of "larger than medium"
Testing Instructions
On large viewport
Open inserter
Click patterns
Zoom out should initialize
Close inserter
Zoom out should exit
On small/medium viewport
Open inserter
Click patterns
Zoom out should not be active
Inserter should be full width
Testing Instructions for Keyboard
Screenshots or screencast