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: Prevent showing Quick Inserter in zoom out mode #68636

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

yogeshbhutkar
Copy link
Contributor

What, Why and How?

The Quick Inserter remained visible during zoom out mode due to a missing check in the rendering logic. The issue was resolved by adding a condition to verify if zoom out mode is active before displaying the Quick Inserter.

Testing Instructions

  1. Navigate to Site Editor.
  2. Create a paragraph block.
  3. Notice, that the Quick Inserter becomes visible when the paragraph block is selected.
  4. Try zooming out and confirm the Quick Inserter is not visible when zoomed out.

Screencast

Screen.Recording.2025-01-13.at.4.29.35.PM.mov

Closes: #68287

@yogeshbhutkar yogeshbhutkar changed the title Block Tools: Prevent showing Quick Inserter in zoom out mode Zoom Out: Prevent showing Quick Inserter in zoom out mode Jan 13, 2025
@yogeshbhutkar yogeshbhutkar marked this pull request as ready for review January 13, 2025 11:18
Copy link

github-actions bot commented Jan 13, 2025

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: yogeshbhutkar <yogeshbhutkar@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: Infinite-Null <ankitkumarshah@git.wordpress.org>
Co-authored-by: getdave <get_dave@git.wordpress.org>

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

@yogeshbhutkar
Copy link
Contributor Author

Hi @Mamaduka,
When you have a moment, could you please review this PR? Your feedback would be greatly appreciated!

const _showEmptyBlockSideInserter =
clientId &&
! isTyping() &&
// Hide the block inserter on the navigation mode.
// See https://github.com/WordPress/gutenberg/pull/66636#discussion_r1824728483.
editorMode !== 'navigation' &&
! isZoomOutMode &&
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not entirely sure if this is a regression, as I couldn't identify the specific commit that introduced the bug. However, I believe this is the most appropriate place to implement the change to effectively address the issue.

@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended [Feature] Zoom Out labels Jan 13, 2025
@Mamaduka
Copy link
Member

At first glance, this proposal does not seem like the proper fix. It just hides the issue instead of fixing it.

Unfortunately, I don't have any alternative suggestions since I'm less familiar with the internals of the "Zoom out mode" feature.

@yogeshbhutkar
Copy link
Contributor Author

Got it, Thanks for the review @Mamaduka.

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.

Quick Inserter button is visible but skewed outside the content window when zoomed out
2 participants