-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Sections: Remove hover outlines in outline mode. #73263
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
Sections: Remove hover outlines in outline mode. #73263
Conversation
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes hover outlines for inner blocks within sections when "Show template" is selected in outline mode. The change prevents visual clutter by disabling the is-hovered class application for blocks that are within a section block.
Key changes:
- Modified
useIsHoveredhook to accept anisEnabledparameter to conditionally disable hover detection - Added
isWithinSectionBlockcontext variable to track if a block is within a section - Connected the new context flag to control hover behavior in
useBlockProps
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| use-is-hovered.js | Added isEnabled parameter to conditionally disable hover event listeners |
| index.js | Added logic to disable hover when within a section block |
| block.js | Added isWithinSectionBlock context variable and propagated it through context |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/block-editor/src/components/block-list/use-block-props/use-is-hovered.js
Outdated
Show resolved
Hide resolved
|
Size Change: +1 B (0%) Total Size: 2.41 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 1c7604f. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/19349196723
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
When showing the template, the inner content blocks no longer have border.
I can, however, trigger the border if I move my mouse inhumanely fast. 🤔 But I can also reproduce that with the template hidden and in trunk.
I still believe it's an improvement and makes things consistent.
I checked in post editor and site editor (page)
Before
2025-11-14.11.16.27.mp4
After
2025-11-14.11.38.17.mp4
…s/use-is-hovered.js Co-authored-by: Copilot <[email protected]>
27e4aee to
366ca9f
Compare
|
Thank for merging :) |
What?
This removes outlines when hovering inner blocks inside sections. At the moment they show up when "Show template" is selected.
Why?
We shouldn't show outlines when hovering inner blocks in sections.
How?
Pass
isWithinSectionBlockthrough context - I'm concerned that this might have performance implications.Testing Instructions
Screenshots or screencast