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

[6.7] Mobile/tablet preview and meta box issues #66629

Closed
t-hamano opened this issue Oct 31, 2024 · 4 comments · Fixed by #66706
Closed

[6.7] Mobile/tablet preview and meta box issues #66629

t-hamano opened this issue Oct 31, 2024 · 4 comments · Fixed by #66706
Assignees
Labels
[Feature] Meta Boxes A draggable box shown on the post editing screen [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@t-hamano
Copy link
Contributor

WordPress 6.7 introduced resizable meta boxes. The combination of meta boxes and device previews can cause some unintended problems. Let me explain.

Desktop Preview

✅ If the post editor is an iframe, the meta box is now resizable and the editor canvas and meta box will have separate scroll areas, which is the correct behavior:

Image

✅ On the other hand, if a block with API version 2 or lower is registered, the editor works as a non-iframe: the editor canvas and meta box together form a scrolling container, and the meta box is not resizable. This is also the correct behavior:

Image

Tablet/Mobile Preview

❌ If the post editor is an iframe, the resizable meta box will obscure the bottom of the editor canvas. Even if you resize the meta box to a minimum height, you may not be able to access the bottom content of the editor canvas:

Image

❌ If the editor is not an iframe, the meta box is not resizable. The meta box will obscure the bottom of the content. Furthermore, when you open the meta box, you will not be able to access the editor:

Image

Image

What is your proposed solution?

I think the previous behavior should be maintained for mobile/tablet previews. That is,

  • Meta boxes are not resizable.
  • The editor canvas and meta box together form a scrolling container.

This is the same as in WordPress 6.6 and should look like this:

Image

cc @stokesman

@t-hamano t-hamano added [Feature] Meta Boxes A draggable box shown on the post editing screen [Type] Bug An existing feature does not function as intended labels Oct 31, 2024
@stokesman
Copy link
Contributor

stokesman commented Oct 31, 2024

Thanks for raising this Aki. Unfortunately, it looks like this was something we overlooked in #66494, because the canvas in device previews was at least scrollable before that though it did clip the margin that’s supposed to create a space below the canvas.

I’ve only given a cursory look at how we might fix this but I think it’d be preferable to allow scrolling the canvas independently of the meta boxes instead of the single scrolling area. E.g. like this:

device-preview-and-meta-boxes.mp4

That is done by adding overflow: auto on .block-editor-iframe__scale-container but I’m not sure that’s ideal or doesn’t cause other issues. Also, when not iframed that obviously won’t work. I’ll keep looking into it.

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Nov 4, 2024
@ndiego ndiego moved this to 🏗️ In Progress in WordPress 6.7 Editor Tasks Nov 4, 2024
@stokesman
Copy link
Contributor

stokesman commented Nov 4, 2024

I’ve opened #66706 that will fix this. It does so by making the split view work even when the editor is not iframed and fixing the device preview overflow in the split view. It seems like the ideal resolution to me and it’s something I’d had a branch for even before the split view landed in #64351 (I just wanted to keep that PR minimal by not including it there). The only hesitation I expect we may have for 6.7 is that it is probably not as minimal a fix as the one proposed by Aki here. I’ll give Aki’s proposal a try in a separate PR.

@stokesman
Copy link
Contributor

Now I’ve opened #66726 targeted to the wp/6.7 branch with Aki’s proposed solution. It seems to resolve this well enough and makes for a lighter and more isolated changeset.

@ndiego
Copy link
Member

ndiego commented Nov 6, 2024

Given the discussion here, I am punting this to 6.7.1.

@ndiego ndiego moved this from 🏗️ In Progress to 🐛 Punted to 6.7.1 in WordPress 6.7 Editor Tasks Nov 6, 2024
@cbravobernal cbravobernal moved this from 🔎 Needs Review to 🐛 Punted to 6.7.2 in WordPress 6.7.x Editor Tasks Nov 19, 2024
@cbravobernal cbravobernal moved this from 📥 Todo to 🎯 Needs core commit / move to 6.7 branch in WordPress 6.7.x Editor Tasks Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Meta Boxes A draggable box shown on the post editing screen [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
Status: 🎯 Needs core commit / move to 6.7 branch
3 participants