-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Zoom Out: Add a control to enter and leave zoom out mode #63870
Conversation
Size Change: +166 B (+0.01%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
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.
If we're automatically entering zoom-out mode from the pattern inserter, I think it's a better experience to automatically exit zoom out mode when the pattern inserter is closed.
I removed the hook as with it we end up stuck in zoom out mode. |
@richtabor Should the device preview icon also change when 50% is selected? Something that shows the desktop zoomed out or to indicate zoom out? |
I was thinking |
The menu item can be |
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. |
if ( isZoomOutExperiment && deviceType === 'Desktop' ) { | ||
return zoomIcon; | ||
} |
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.
Should it be the Desktop SVG + the %? Like [desktop icon] 50%
?
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.
Or maybe the text can be within the desktop icon? Like, the percentage is displayed on the screen if it's at 50%?
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 think to do that we would need new SVGs
Maybe too much of an edge case for right now, but you get in an incorrect state if you:
This shouldn't block this pr though. Screen.Recording.2024-07-29.at.10.36.19.AM.mov |
Yes, it should reset to 100%. |
Fixed in 76c6a8c |
5c12586
to
436b8d9
Compare
I think this is ready for a review. There's still a bug when switching modes using the toolbar but I think that's probably for a different PR. |
Another thought (for a potential next quick iteration to try) is to associate desktop with zoom a bit more: Not exactly this, but communicate the idea that zoom is relative to desktop and not tablet/mobile. Something to consider. cc @mtias |
{ window.__experimentalEnableZoomedOutPatternsTab && | ||
isZoomOutMode && ( | ||
<ZoomOutModeInserters | ||
__unstableContentRef={ __unstableContentRef } | ||
/> | ||
) } |
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.
Removing the <ZoomOutModeInserters />
from behind the experimental window.__experimentalEnableZoomedOutPatternsTab
flag, as you can manually enter zoom out mode via this preview dropdown. I think this is the right call here. Otherwise you don't see the zoom out mode inserters unless you have the experiment on.
@richtabor Updated to use the desktop icon. I think it feels a lot nicer with Desktop and Desktop (50%) and clarifies the relationship. I added the 50% on the left side of the icon because it allowed the Desktop icon to stay in the same location when selecting Desktop (50%). Screen.Recording.2024-08-02.at.4.07.34.PM.mov |
Flaky tests detected in bfc4bcc. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10222055557
|
Thank you for working on this feature! I find it very helpful to have a Desktop (50%) zoom feature. I see that this view has another focus compared to the regular Desktop view. The focus on the 50% view seems to me to be about the general layout of the content on the screen. Moving Group/container kind of blocks or clicking to trash these. This means that Desktop has the regular editing experience and that the 50% view contains another editing experience. |
I'm still a believer, and it remains for me the visual of the trigger itself. I don't know that the chevron down mixes well with the other items, or that the text mixes with the icons. Not a blocker per se, but an opportunity to improve that dropdown overall. Even in trunk it's not the clearest, sans-zoom features. Our best bet is to probably revisit the toolbar organization in the right side, as has been discussed elsewhere, and see how those pieces come together. Even little things like #64187 might play a role. |
With the latest changes from @jeryj this no longer uses the chevron down: |
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.
Thanks for all the work on this @jeryj I think it looks great. Let's bring it in and we can iterate on the design.
It's not quite working as is, but it's good to move this forward. Let's circle back design wise on this. |
When I select "Desktop (50%)", the breadcrumbs are hidden. I think this is because the editor mode is Please refer to this issue: #64259 |
Yes, the "Desktop (50%)" is zoom out. |
So does that mean that the breadcrumbs only disappear in this mode? |
Yes, it looks like no breadcrumbs when zoomed out. |
if ( ! isZoomedOut ) { | ||
prevContainerWidth.current = containerWidth; |
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 wonder what led to this change? As I understand it the value of prevContainerWidth
should be that of containerWidth
before Zoom Out is engaged because the scale calculation needs to arrive at a scale which preserves the document width. That calculation wasn’t perfect before but this seems to have thrown it off a good deal when Zoom Out is engaged by way of the Inserter (not through the control added by this PR).
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.
Good catch, I made a PR for that here: #64478
What?
Add a control to allow users to select between zoom out and edit mode.
Why?
Sometimes users might want this level of control rather than us doing it for them.
How?
Add a control to the device preview dropdown.
Testing Instructions
Screenshots or screencast