-
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
Editor: Enable Zoom-out mode in the post editor #61293
Conversation
I'm seeing a weird "dance", when I get into the zoom-out mode. The canvas is constantly moving. I wonder why it doesn't happen in the site editor. Any idea what that is? |
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. |
@@ -705,12 +705,9 @@ $block-inserter-tabs-height: 44px; | |||
display: none; | |||
} | |||
|
|||
.is-zoom-out { |
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.
This style was relying on the existence of some global CSS class, this is not great, especially since this class is define outside the package entirely while we do have access to the mode within the package.
@@ -249,3 +249,12 @@ | |||
.components-popover.more-menu-dropdown__content { | |||
z-index: z-index(".components-popover.more-menu__content"); | |||
} | |||
|
|||
.edit-post-header__preview-options { |
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 copied the behavior of the site editor for now where we fade away to the button in zoom-out. I think that's not a great solution though, it's very adhoc and leave an empty space in the toolbar and also leaves a focusable but hidden button.
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'd prefer if keep it but disable it.
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 agree. Disabling it via aria-disabled seems like a better option. You can also hover the empty area and see the tooltip right now.
Size Change: -519 B (-0.03%) Total Size: 1.74 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.
Here's the site editor, then post editor, with zoom out engaged. A bit of a flicker going on within the post editor: CleanShot.2024-05-02.at.21.03.20.mp4I do see the experimental toggle in the header. |
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.
Read the code changes and like all these unification efforts it made things better overall. This works great for me except the device preview button which is invisible but can be clicked.
Just noting that this bug exists in trunk too in the site editor. This just moved the code to the post editor too. Happy to address though. |
e2f6bd0
to
0660c6e
Compare
0660c6e
to
d372296
Compare
@jeryj @ajlende I'm going to need to help to figure out the flickering issue in the post editor. It looks like applying the "scale" to the iframe in the post editor (when opening the patterns inserter), triggers an infinite loop where the "width" changes => "scale" changes => "width" changes back => "scale" changes.... |
Simply confirming the flickering still and the lack of option to invoke it in the header: zoomed.out.in.post.editor.test.movNeat to see this being expanded and explored. |
The option should be there (you need to enable the experiment first) |
@ntsekouras fount the flicker to be caused by a bottom padding added for the type writer effect which is only present in the post editor. |
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, thanks!
Thanks for fixing the flickering :) |
Extrated from #61273
Related #52632
What?
We're in a middle of an effort to merge the post and site editors under the @wordpress/editor abstraction. As part of this, this PR unifies the Header component between both editors.
Testing Instructions
If you have the zoom-out experiment enabled, you should be able to trigger the zoom-out manually from the header.
It also triggers automatically when you open the patterns tab in the inserter.