Skip to content

Zoom Out: Reset when exiting template editor#71360

Closed
BugReportOnWeb wants to merge 2 commits intoWordPress:trunkfrom
BugReportOnWeb:fix/zoom-out-mode
Closed

Zoom Out: Reset when exiting template editor#71360
BugReportOnWeb wants to merge 2 commits intoWordPress:trunkfrom
BugReportOnWeb:fix/zoom-out-mode

Conversation

@BugReportOnWeb
Copy link
Copy Markdown
Contributor

What?

Closes #71349

This PR ensures that zoom-out mode is reset when leaving the template editor, since the zoom-out toggle is only available within template editing sessions.

Why?

The zoom-out toggle is scoped to template editing. Without this fix, the editor can remain in zoom-out mode even after exiting template mode, which is inconsistent since the toggle is no longer visible in that context.

How?

  • Checks the renderingMode from the editor store.
  • When switching to post-only mode, resets zoom-out mode.

Testing Instructions

  1. Open the post editor.
  2. Enable the "Show template" option.
  3. Enable zoom-out mode.
  4. Disable the "Show template" option.
  5. Confirm that the editor is no longer in zoom-out mode.

Screenshots or screencast

Screen.Recording.2025-08-26.at.9.47.30.PM.mov

@BugReportOnWeb BugReportOnWeb marked this pull request as ready for review August 26, 2025 18:25
@github-actions
Copy link
Copy Markdown

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: BugReportOnWeb <devasheeshkaul@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended [Feature] Zoom Out labels Aug 27, 2025
Copy link
Copy Markdown
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, but I think resetting the zoom level by using the useEffect hook isn't an ideal approach.

I think the zoom out reset should be tied to a button click event, just like when the device preview is changed.

Let's close this PR and move #71361 forward.

@t-hamano t-hamano closed this Aug 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Zoom Out [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Zoom out: should be disabled when "Show Template" is toggled off

2 participants