-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Editor: Disable zoom out mode for non-iframe editor #71233
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
Conversation
|
Size Change: +44 B (0%) Total Size: 1.92 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 84990c9. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/17033379511
|
|
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. |
|
Sorry, I haven't yet investigated the root cause of the issue, but can we fix this for non-iframe editors? The Zoom Out feature already has enough conditions to make it confusing when it can be used (example). Adding one more will make it even more confusing and complicated to debug, IMO. |
|
@Mamaduka Thanks for the review!
I'll look into why the zoom out mode doesn't work when the editor isn't iframed and whether we can fix that 👍 |
|
I found the root cause. This change was what initially caused the problem: #67481 changed the gutenberg/packages/block-editor/src/components/iframe/use-scale-canvas.js Lines 312 to 320 in 814a01d
I'll try a different approach to solve this problem. |
|
Whoa, that's a lot going on inside the I'm also not against going with the original proposal and disabling Zoom Out mode for non-iframed editors, if resolving this becomes too complicated. We'll just need to document or update existing documentation for the Zoom Out feature. |
|
I haven't been able to solve it yet, but
3e48692d4c947404fd04820db690a37b.mp4I think we have two choices:
Personally, I'd prefer to move forward with this PR, since ultimately the editor will always run as an iframe, and the prop added by this PR will likely be removed in the future (#70743). |
|
It's been awhile since I looked at this code, but I recall the solution needing to be tied to the iframe due to scroll bar behavior and some code only needed because we were scaling within an iframe. I'm also fine removing the animation from non-iframed editors if we can't find a solid solution without too much difficulty. |
|
Thanks for the feedback! I've tried getting the zoom out mode to work in the non-iframe editor and I think I was able to fix it without any regressions. |
Related:
What?
This PR disables zoom out mode for the non-iframe editor.
Why?
I submitted #66789 before the WP 6.8 release to get the zoom out mode working in the non-iframe editor. At the time, the zoom out mode should have worked in the non-iframe editor, but for some reason, it appears to no longer work in the 6.8 release.
As I recall, there were a lot of changes to the zoom out mode in the 6.8 release, which might have caused it to stop working in the non-iframe editor.
How?
It's easier to disable zoom out mode than to try to get it to work in a non-iframe editor.
As mentioned in #70743, eventually the editor will always run as an iframe, so in the future we won't need to worry about non-iframe editors. The
isEditorIframedprop can eventually be removed altogether.Testing Instructions
We need to activate a block theme to test this PR, but please note that with block themes and the Gutenberg plugin enabled, the editor always runs as an iframe, so this PR cannot be tested in the usual way:
gutenberg/packages/edit-post/src/components/layout/use-should-iframe.js
Lines 21 to 25 in 5b9c8dd
Therefore, please set
IS_GUTENBERG_PLUGINtofalsebefore building.gutenberg/package.json
Line 22 in 5b9c8dd
wp.blocks.registerBlockType( 'test/v2', { apiVersion: '2', title: 'test' } );Screenshots or screencast
Before
b4531c3396ff71f3e8a4069ae163cd53.mp4
After
d149f1d8b42e267acbbe76144b3d5baf.mp4