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

Zoom out: Pattern inserter always forces iframe editor #66671

Closed
3 of 6 tasks
t-hamano opened this issue Nov 1, 2024 · 4 comments · Fixed by #66789
Closed
3 of 6 tasks

Zoom out: Pattern inserter always forces iframe editor #66671

t-hamano opened this issue Nov 1, 2024 · 4 comments · Fixed by #66789
Assignees
Labels
[Feature] Zoom Out [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

t-hamano commented Nov 1, 2024

Description

When the Patterns tab is selected, the zoom out mode is enabled via the useZoomOut hook and the editor behaves as an iframe. On the other hand, if the editor is NOT an iframe, the zoom out toggle is not displayed (#65452).

This inconsistency leads to unintended behavior.

Step-by-step reproduction instructions

To make the useShouldIframe hook return false, do the following:

  • Activate the classic theme.
  • Activate a plugin that includes the v2 block (e.g. CoBlocks).

  • Open the post editor.
  • The editor should be running as a non-iframe.
  • Enable custom fields and refresh your browser. Ensure the meta box is legacy (not resizable).
  • Select the Patterns tab from the main inserter.
    • 🤔 You should see the zoom out toggle button in the header.
    • 🤔 The meta box should change to resizable.
  • Click the zoom out toggle button in the header.
    • 🤔 The zoom out button should disappear.
    • 🤔 The meta box should change to legacy.

What is your proposed solution?

Here are my suggested approach for the non-iframe editor:

  • For WP 6.7: Don't enable zoom out mode when accessing the Patterns tab.
  • For Gutenberg (WP 6.8): Enable zoom out mode in the non-iframe editor, i.e. displays the zoom out toggle button in the header and also provides the zoom out shortcut.

Screenshots, screen recording, code snippet

51bac6ccd36c6912d649d252502c93ea.mp4

Environment info

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure
@t-hamano t-hamano added [Feature] Zoom Out [Type] Bug An existing feature does not function as intended labels Nov 1, 2024
@ndiego ndiego moved this to 🗣️ In Discussion / Needs Decision in WordPress 6.7 Editor Tasks Nov 4, 2024
@annezazu
Copy link
Contributor

annezazu commented Nov 4, 2024

@ellatrix curious for your thoughts here

@t-hamano
Copy link
Contributor Author

t-hamano commented Nov 5, 2024

This may need to be discussed in more detail in #66718.

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Nov 6, 2024
@ndiego
Copy link
Member

ndiego commented Nov 6, 2024

As this issue is still in discussion with #66718 and the fact that #66742 has been merged, I am going to remove this from the 6.7 project board. This was also reviewed in Slack.

@ellatrix
Copy link
Member

ellatrix commented Nov 6, 2024

In this case I think we should:

  • Not put the content in zoom out when you open patterns.
  • But maybe leave it as an open in the toolbar, which will render the zoom-out view in an iframe.

Zoom-out should always be iframed, it's a new mode and we don't care about back compat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Zoom Out [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants