Skip to content

Add Boundary Mode to visualize block boundaries #69388

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

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

Conversation

Sukhendu2002
Copy link
Contributor

@Sukhendu2002 Sukhendu2002 commented Mar 3, 2025

What?

Closes: #66576

This PR adds a new "Boundary Mode" that helps users visualise block boundaries during editing.

Testing Instructions

  1. Create a post with various blocks (paragraphs, columns, groups with nested content)
  2. Open the Options menu (three dots in the top right) and select Preferences
  3. In the "Appearance" section, toggle on "Boundary mode"
  4. Observe that all blocks now display dashed outlines indicating their boundaries

Screenshots or screencast

Screen.Recording.2025-03-03.at.3.57.34.PM.mov

@Sukhendu2002 Sukhendu2002 marked this pull request as ready for review March 3, 2025 10:48
Copy link

github-actions bot commented Mar 3, 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.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @orionp13.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

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

Unlinked contributors: orionp13.

Co-authored-by: Sukhendu2002 <sukhendu2002@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: acketon <acketon@git.wordpress.org>
Co-authored-by: hanneslsm <hanneslsm@git.wordpress.org>
Co-authored-by: buzztone <buzztone@git.wordpress.org>
Co-authored-by: paaljoachim <paaljoachim@git.wordpress.org>
Co-authored-by: ajitbohra <ajitbohra@git.wordpress.org>
Co-authored-by: afercia <afercia@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] Enhancement A suggestion for improvement. [Package] Block editor /packages/block-editor [Package] Commands /packages/commands labels Mar 3, 2025
@Mamaduka
Copy link
Member

Mamaduka commented Mar 3, 2025

Thanks for contributing, @Sukhendu2002!

For issues like #66576, I recommend seeking feedback before moving on with the development.

@orionp13
Copy link

this mode need to be by default when editing like on elementor

@Mamaduka Mamaduka added the Needs Decision Needs a decision to be actionable or relevant label Mar 11, 2025
@afercia afercia added the [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). label Mar 12, 2025
@acketon
Copy link

acketon commented Jul 10, 2025

This is great.

I strongly believe a toggle on/off outline or boundary is needed for complex page layouts. In older WP this was done with lots of psuedo elements to add borders around blocks and the UX was much better. However the downside was the extra markup and psuedo elements often conflicted with blocks that were using pseudo elements for some aspect of styling.

Just today I'm fixing a content issue on multiple posts because a user didn't realize they nested a reusable block inside multiple group blocks and broke the layout due to styles attached to the group block. In the Editor it is nearly impossible for the typical user to understand what was wrong with the block structure because so many blocks are effectively invisible and they can't see them. Only someone experienced knows to look at the rendered HTML structure on the frontend or look at the block outline to decipher what was happening structurally.

@@ -1582,6 +1582,10 @@ _Related_

- toggleBlockMode in core/block-editor store.

### toggleBoundaryMode
Copy link
Member

Choose a reason for hiding this comment

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

I'd be supportive of this preference, but I think it should be called "showBlockBoundaries"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Needs Decision Needs a decision to be actionable or relevant [Package] Block editor /packages/block-editor [Package] Commands /packages/commands [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "Boundary View Mode" to Display Block Outlines in the Gutenberg Editor
7 participants