Skip to content

Add/block width constraint notice - #82607

Merged
jasmussen merged 4 commits into
trunkfrom
add/block-width-constraint-notice
Oct 26, 2026
Merged

jasmussen merged 4 commits into
trunkfrom
add/block-width-constraint-notice

Conversation

@jasmussen

@jasmussen jasmussen commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

What?

Builds on #82600, and part of the width guidance discussed in #79285.

Adds a button in the alignment dropdown to select the block that affects a child block's width.

Before:

image

After:

image
Previous iteration

When a block's parent layout withholds wide and full alignments, the block inspector now says which block is responsible and offers to select it.

Wide and Full width unavailable
The Group around this block limits its width.
[ Select Group ]

#82600 made the alignment menu admit that Wide and Full are unavailable. This says why.

Note: There appears to be something wrong with the Notice: it's now showing a grey background in all variants. Not sure if this is intentional or not, but it seems wrong to me, as a single border feels insufficient to communicate the difference in notice type.

Also, added CSS for this one feels also wrong: it's not clear there's an alternative whe nusing the pre-tabs slot which renders flush against the inspector edges. Spacer is blocked by the same lint rule as planned for deprecation, and Stack from @wordpress/ui only exposes gap. Any recommendation on what we can do instead?

Before:

image

After:
image

Why?

"Not available" answers half the question. The other half of where to change it and why, is hard to work out. Because the block responsible is often several steps away and looks like ordinary page content.

How?

Claude wrote this:

The block support already knows which alignments the layout withheld, from useAlignmentMenu in #82600. This adds the other half: the parent that withheld them.

  • The parent comes from getBlockRootClientId, and the notice renders into the existing BlockInspectorPreTabsSlot, directly below the "Edit original" button.
  • The notice is deliberately silent in two cases: when there is no parent block, and when the parent's editing mode is not default. In both, the constraint comes from outside the post — the template wrapped around the content — and there is no block on the page to select. Explaining that case needs the template's identity and an "Edit template" action, neither of which block-editor can reach. It is a separate PR against packages/editor.
  • The heading adapts when only one of the two alignments is withheld.

Testing Instructions

  1. Add a Group block and switch off "Inner blocks use content width" in its Layout panel.
  2. Insert an Image inside it and select it.
  3. Expected: the block inspector shows "Wide and Full width unavailable", naming the Group, with a "Select Group" button. The alignment dropdown shows Wide and Full as "Not available", per Block alignment: List unavailable wide and full alignments instead of hiding them #82600.
  4. Press "Select Group". The Group should be selected, and its Layout panel is where the setting actually is.
  5. Rename the Group in the list view — call it "Hero" — and reselect the Image. The notice and the button should both use the new name.

Please also confirm it stays quiet where it should:

  • Switch "Inner blocks use content width" back on. The notice should disappear.
  • Select a block at the top level of the post, with no Group around it. No notice: the constraint, if any, comes from the template and this PR does not speak to that.
  • With "Show template" on in the post editor, select a block inside the Content block. No notice, for the same reason.
  • A block inside a Row or Grid. No notice — those layouts offer no alignments to anything rather than withholding them.

Testing Instructions for Keyboard

  1. Select the Image inside the flow Group.
  2. Open the block inspector and tab to the "Select Group" button.
  3. Press Enter. Focus should move with the selection to the Group, and the notice should no longer be present.

Use of AI Tools

Claude Opus 5.

@jasmussen jasmussen self-assigned this Sep 8, 2026
@jasmussen jasmussen added [Type] Enhancement A suggestion for improvement. [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") labels Sep 8, 2026
@github-actions github-actions Bot added the [Package] Block editor /packages/block-editor label Sep 8, 2026
@jasmussen

Copy link
Copy Markdown
Contributor Author

The off Notice colour may be fixed by #82591.

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

🎉 Props

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: jasmussen <joen@git.wordpress.org>
Co-authored-by: tellthemachines <isabel_brison@git.wordpress.org>
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
Co-authored-by: jordesign <jordesign@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>

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


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

📦 Bundle size

Size Change: +286 B (0%)

Total Size: 9.07 MB

📦 View Changed
Filename Size Change
build/scripts/block-editor/index.min.js 606 kB +286 B (+0.05%)

d03a5ef Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric ff9e8f5 trunk % Change
timeToFirstByte 53.35 ms +3.56% -2.91% 52.3 ms +13.48% -1.53% 2.01%
largestContentfulPaint 92 ms +4.35% -6.52% 90 ms +8.89% -4.44% 2.22%
lcpMinusTtfb 39.9 ms +7.52% -17.29% 35.7 ms +17.93% -7.14% 11.76%
wpBeforeTemplate 28.24 ms +6.73% -0.67% 28.16 ms +16.23% -1.42% 0.28%
wpTemplate 20.44 ms +7.44% -2.98% 20.31 ms +8.91% -1.77% 0.64%
wpTotal 49.79 ms +3.01% -2.95% 48.57 ms +12.74% -1.32% 2.51%
wpMemoryUsage 7.68 MB +0% -0% 7.65 MB +0% -0% 0.43%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric ff9e8f5 trunk % Change
timeToFirstByte 42.75 ms +8.42% -3.27% 45.45 ms +13.97% -0.88% -5.94%
largestContentfulPaint 92 ms +4.35% -2.17% 100 ms +6% -2% -8%
lcpMinusTtfb 49.3 ms +2.54% -3.25% 53.95 ms +1.58% -4.45% -8.62%
wpBeforeTemplate 26.82 ms +13.53% -1.42% 26.62 ms +9.5% -0.79% 0.75%
wpTemplate 12.29 ms +3.01% -2.44% 15.97 ms +9.02% -2.69% -23.04%
wpTotal 39.93 ms +8.72% -3.08% 42.33 ms +14.6% -0.85% -5.67%
wpMemoryUsage 6.26 MB +0% -0% 6.34 MB +0% -0% -1.22%
wpDbQueries 9 +0% -0% 13 +0% -0% -30.77%

media-processing

Metric ff9e8f5 trunk % Change
mediaProcessingJpeg 397.57 ms +0.57% -1.01% 400.59 ms +2.83% -0.17% -0.75%
mediaProcessingAvif 6085.09 ms +0.23% -0.19% 6081.07 ms +0.09% -0.38% 0.07%
mediaProcessingJpegToAvif 4209.61 ms +0.24% -0.39% 4192.31 ms +0.12% -0.17% 0.41%

media-upload

Metric ff9e8f5 trunk % Change
jpegUploadProcessing 1440.59 ms +35.01% -1.48% 1432.63 ms +0.79% -1.35% 0.56%
pngUploadProcessing 208.41 ms +2.08% -18.97% 211.75 ms +9.53% -16.05% -1.58%
largeJpegUploadProcessing 1414.9 ms +0.43% -0.27% 1430.44 ms +2.13% -1.45% -1.09%
multipleImageUploadProcessing 1597.6 ms +8.39% -1.23% 2022.91 ms +2.43% -6.65% -21.02%

post-editor

Metric ff9e8f5 trunk % Change
serverResponse 520.03 ms +4.9% -6.63% 514.9 ms +3.75% -6.31% 1%
firstPaint 296.57 ms +79.12% -26.06% 394.2 ms +41.74% -35.05% -24.77%
domContentLoaded 1297.79 ms +1.32% -4.3% 1277.21 ms +1.64% -1.45% 1.61%
loaded 1299.01 ms +1.31% -4.28% 1278.55 ms +1.64% -1.46% 1.6%
firstContentfulPaint 550.86 ms +3.74% -6.47% 543.41 ms +5.29% -4.12% 1.37%
firstBlock 3741.49 ms +1.34% -5.34% 3667.01 ms +0.47% -2.48% 2.03%
type 19.06 ms +3.15% -3.15% 17.9 ms +7.32% -5.14% 6.48%
typeWithoutInspector 18.45 ms +7.1% -3.04% 18.6 ms +5.97% -3.17% -0.81%
typeWithTopToolbar 25.44 ms +8.06% -1.45% 23.54 ms +7.56% -2.29% 8.07%
typeContainer 8.67 ms +6% -9.23% 8.58 ms +10.61% -4.31% 1.05%
focus 129.74 ms +2.53% -3.26% 130.35 ms +3.51% -4.43% -0.47%
firstFocus 238.02 ms +0% -0% 249.91 ms +0% -0% -4.76%
selectAll 593.6 ms +1.53% -0.89% 556.04 ms +9.98% -0.97% 6.75%
listViewOpen 85.98 ms +8.55% -9.65% 83.29 ms +11.72% -6.23% 3.23%
inserterOpen 47.92 ms +6.43% -13.38% 48.78 ms +3.32% -10.82% -1.76%
inserterHover 12.56 ms +16.72% -10.51% 12.11 ms +4.95% -7.51% 3.72%
inserterSearch 9.08 ms +3.74% -6.61% 8.1 ms +15.8% -5.43% 12.1%
loadPatterns 702.69 ms +1.5% -4.49% 684.98 ms +2.98% -4% 2.59%
wpTotal 509.45 ms +4.84% -6.57% 505.12 ms +3.91% -6.3% 0.86%
wpMemoryUsage 14.71 MB +0% -0% 14.68 MB +0% -0% 0.24%
wpDbQueries 55 +0% -1.82% 55 +0% -1.82% 0%

site-editor

Metric ff9e8f5 trunk % Change
serverResponse 250 ms +4.96% -5.24% 245.42 ms +3.33% -7.04% 1.87%
firstPaint 193.29 ms +68.96% -16.3% 204.67 ms +45.69% -2.32% -5.56%
domContentLoaded 768.88 ms +2.93% -4.19% 765.94 ms +1.33% -2.09% 0.38%
loaded 769.68 ms +2.91% -4.18% 766.96 ms +1.33% -2.1% 0.35%
firstContentfulPaint 337.42 ms +0.98% -8.92% 340.65 ms +2.54% -3.45% -0.95%
firstBlock 2714.54 ms +1.91% -2.55% 2680.1 ms +1.55% -1.22% 1.29%
type 14.05 ms +15.37% -2.56% 13.88 ms +2.74% -3.24% 1.22%
navigate 96.18 ms +1.52% -1.26% 98.63 ms +1.76% -3.76% -2.48%
loadPatterns 850.08 ms +31.05% -7.38% 835.56 ms +8.8% -3.32% 1.74%
loadPages 914.85 ms +4.84% -1.45% 918.6 ms +4.08% -1.75% -0.41%
wpTotal 244.01 ms +4.52% -5.59% 239.33 ms +3.4% -7.2% 1.96%
wpMemoryUsage 12.73 MB +0% -0% 12.70 MB +0% -0% 0.24%
wpDbQueries 44.5 +1.12% -1.12% 44.5 +1.12% -1.12% 0%

d03a5ef Run

🏁 Flaky tests

Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

Custom Completer: should allow newlines after multiple option completions in /test/e2e/specs/editor/various/autocomplete-and-mentions.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 1
+ Received  + 1

@@ -1,7 +1,7 @@
  <!-- wp:paragraph -->
- <p>🫐 test</p>
+ <p>🍎 test</p>
  <!-- /wp:paragraph -->

  <!-- wp:paragraph -->
  <p>🫐 test</p>
  <!-- /wp:paragraph -->

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/autocomplete-and-mentions.spec.js:466:6
Undo restores the post selection when another synced entity is loaded (RTC WebSocket) in /test/e2e/specs/editor/collaboration/collaboration-undo-redo.spec.ts, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 2
+ Received  + 2

  Object {
    "attributeKey": "content",
    "blockIndex": 0,
    "content": "abcdef",
-   "endOffset": 3,
-   "offset": 3,
+   "endOffset": 6,
+   "offset": 6,
  }

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/collaboration/collaboration-undo-redo.spec.ts:363:5
can apply custom gradient background color in /test/e2e/specs/editor/blocks/buttons.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 1
+ Received  + 1

  <!-- wp:buttons -->
- <div class="wp-block-buttons"><!-- wp:button {"style":{"background":{"gradient":"linear-gradient(135deg,rgb(255,0,0) 0%,rgb(0,255,0) 100%)"}}} -->
+ <div class="wp-block-buttons"><!-- wp:button {"style":{"background":{"gradient":"linear-gradient(135deg,rgb(6,147,227) 0%,rgb(0,255,0) 100%)"}}} -->
  <div class="wp-block-button"><a class="wp-block-button__link wp-element-button">Content</a></div>
  <!-- /wp:button --></div>
  <!-- /wp:buttons -->
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/buttons.spec.js:411:21
inserts a block in proper place after having clicked `Browse All` from inline inserter in /test/e2e/specs/editor/various/inserting-blocks.spec.js, passed after 1 failed attempt.
TimeoutError: locator.click: Timeout 10000ms exceeded.
Call log:
  - waiting for getByRole('button', { name: 'Add block' })
    - locator resolved to <button type="button" aria-pressed="false" aria-haspopup="true" aria-expanded="false" aria-label="Add block" class="components-button block-editor-inserter__toggle is-next-40px-default-size has-icon">…</button>
  - attempting click action
    - waiting for element to be visible, enabled and stable
  - element was detached from the DOM, retrying

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/inserting-blocks.spec.js:557:5
should change the indented list type in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
TimeoutError: locator.click: Timeout 10000ms exceeded.
Call log:
  - waiting for locator('role=toolbar[name="Block tools"i]').locator('role=button[name="Indent"]')

    at Editor.clickBlockToolbarButton (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/editor/click-block-toolbar-button.ts:17:15)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:727:3
should cut and paste individual blocks with collapsed selection in /test/e2e/specs/editor/various/copy-cut-paste.spec.js, passed after 1 failed attempt.
Error: expect(string).toMatchSnapshot(expected) failed

  @@ -1,3 +1,3 @@
   <!-- wp:paragraph -->
  -<p>2Cut - collapsed selection</p>
  +<p>2</p>
   <!-- /wp:paragraph -->


    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/copy-cut-paste.spec.js:45:49
should gradually multi-select in /test/e2e/specs/editor/various/multi-block-selection.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 3
+ Received  + 7

  Array [
    Object {
-     "name": "core/column",
+     "attributes": Object {
+       "content": "1",
+       "dropCap": false,
      },
-   Object {
-     "name": "core/column",
+     "clientId": "ec83f0f0-482c-457f-885f-12b699f3bb06",
+     "innerBlocks": Array [],
+     "isValid": true,
+     "name": "core/paragraph",
    },
  ]

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/multi-block-selection.spec.js:1151:5
should handle dynamic modules from new blocks in /test/e2e/specs/interactivity/router-script-modules.spec.ts, passed after 1 failed attempt.
Error: apiRequestContext.fetch: socket hang up
Call log:
  - → DELETE http://localhost:8889/wp-json/wp/v2/posts/226?force=true
    - user-agent: Playwright/1.63.0 (x64; ubuntu 24.04) node/24.20 CI/1
    - accept: */*
    - accept-encoding: gzip,deflate,br
    - X-WP-Nonce: 5f4ae5aaba
    - cookie: wordpress_test_cookie=WP%20Cookie%20check; wordpress_logged_in_23778236db82f19306f247e20a353a99=admin%7C1793157929%7CT4aLRy8JKJBmnMUdaRfz9jTFRCOzlWMlvkPiA9D4BO7%7C886de3058fbb00f8c0e2cf425261ce4efb26512d92cf815df8968ea1b16c756a; wp-settings-time-1=1792985714

    at RequestUtils.rest (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/request-utils/rest.ts:111:39)
    at map (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/request-utils/posts.ts:44:9)
    at RequestUtils.deleteAllPosts (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/request-utils/posts.ts:43:9)
    at InteractivityUtils.deleteAllPosts (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/interactivity/fixtures/interactivity-utils.ts:91:3)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/interactivity/router-script-modules.spec.ts:60:3
should insert a line break on shift+enter in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 1
+ Received  + 1

  <!-- wp:list -->
  <ul class="wp-block-list"><!-- wp:list-item -->
- <li>a<br></li>
+ <li><br></li>
  <!-- /wp:list-item --></ul>
  <!-- /wp:list -->

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:1210:52
should outdent list items when deleting an empty parent at the top in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 19
+ Received  +  1

- Array [
-   Object {
-     "innerBlocks": Array [
-       Object {
-         "attributes": Object {
-           "content": "a",
-         },
-         "name": "core/list-item",
-       },
-       Object {
-         "attributes": Object {
-           "content": "b",
-         },
-         "name": "core/list-item",
-       },
-     ],
-     "name": "core/list",
-   },
- ]
+ Array []

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:3074:41
should remove an anchored list when deleting its last item in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 1
+ Received  + 1

@@ -5,11 +5,11 @@
      },
      "innerBlocks": Array [
        Object {
          "attributes": Object {
            "anchor": "item",
-           "content": "x",
+           "content": "",
          },
          "name": "core/list-item",
        },
      ],
      "name": "core/list",

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:2961:41
should replace selected non-breaking spaces from the toolbar in /test/e2e/specs/editor/various/rich-text.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 1
+ Received  + 1

  Array [
    Object {
      "attributes": Object {
-       "content": "one two three",
+       "content": "ne two three",
      },
      "name": "core/paragraph",
    },
  ]

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/rich-text.spec.js:1050:41
should select by dragging into nested block in /test/e2e/specs/editor/various/multi-block-selection.spec.js, passed after 1 failed attempt.
Error: expect(received).toEqual(expected) // deep equality

- Expected  - 1
+ Received  + 0

  Array [
    1,
-   2,
  ]

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/multi-block-selection.spec.js:568:5
should update the URL from the last navigation if only varies in the URL fragment in /test/e2e/specs/interactivity/router-navigate.spec.ts, passed after 1 failed attempt.
Error: expect(locator).toHaveText(expected) failed

Locator:  getByTestId('title')
Expected: "Link 1"
Received: "Main"
Timeout:  5000ms

Call log:
  - Expect "toHaveText" getByTestId('title') with timeout 5000ms
  - waiting for getByTestId('title')
    14 × locator resolved to <h2 data-testid="title">Main</h2>
       - unexpected value "Main"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/interactivity/router-navigate.spec.ts:160:25
shows title and sync status while creating a new synced pattern in the post editor in /test/e2e/specs/editor/various/post-summary/post-summary.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeVisible() failed

Locator: getByRole('dialog', { name: 'Create pattern' })
Expected: visible
Timeout: 5000ms
Error: element(s) not found

Call log:
  - Expect "toBeVisible" getByRole('dialog', { name: 'Create pattern' }) with timeout 5000ms
  - waiting for getByRole('dialog', { name: 'Create pattern' })

    at createPatternFromModal (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/post-summary/post-summary.spec.js:179:26)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/post-summary/post-summary.spec.js:101:4

d03a5ef Run

@andrewserong

Copy link
Copy Markdown
Contributor

Thank you for digging into this tasks! The alignment controls are tricky to get right and they can be quite confusing to work with and to understand what is and isn't available.

For this particular PR, I think the notice is way too prominent. If you're simply working with regular content blocks within a group that doesn't allow full and wide alignments, then every time you add or work with a block you have to scroll past a large notice in the sidebar to get to common controls for, say, picking a text color or adjusting font size, or adding a background color.

E.g. here's how a heading block looks on a common laptop screen size where the design tools are nearly entirely hidden because of the notice taking up a lot of room:

image

It also isn't clear to me why we'd want this notice to show in the right-hand sidebar when the user controls alignments from within the block toolbar. Is there an approach we can take that keeps the information we're communicating with the control instead? I.e. I like what you're doing in #82600 which shows the options as "not available" in the dropdown.

What if we had a Tooltip on the disabled controls that explains "The Group around this block limits its width", so we then don't need to have this notice in the sidebar?

@jordesign

Copy link
Copy Markdown
Contributor

What if we had a Tooltip on the disabled controls that explains "The Group around this block limits its width", so we then don't need to have this notice in the sidebar?

This kind of thing makes sense to me in terms of being contextual to when the user is trying to use the alignments... But I do like the idea of there being a CTA/Button/Action which takes them to the parent container/pattern/whatever to change the layout settings there...

@jasmussen
jasmussen force-pushed the add/block-width-constraint-notice branch from 10ba868 to aa1d106 Compare September 9, 2026 10:18
@jasmussen

Copy link
Copy Markdown
Contributor Author

Good feedback, all. Based on the feedback, and because the actual problem that this PR aims to solve relates primarily to the alignments dropdown, I went ahead and moved something to the dropdown itself, like this:

image

It doesn't look ideal with longer help text. But not terrible. What do you think?

@jasmussen
jasmussen changed the base branch from trunk to add/block-width-constraint-diagnostic September 9, 2026 12:03
@jasmussen

Copy link
Copy Markdown
Contributor Author

Noting that I changed the base of this branch from trunk to add/block-width-constraint-diagnostic, as the latter (which is PR #82600) is required for this PR. 82600 can either land first, or we can merge this one into the latter, whichever is better.

@ciampo

ciampo commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

The off Notice colour may be fixed by #82591.

Should be fixed on trunk, given that #82591 got merged.

@jasmussen

Copy link
Copy Markdown
Contributor Author

It is indeed, though the notice is no longer used in this particular branch. I've others that still use it though, where it's fixed. Thanks.

@jordesign

Copy link
Copy Markdown
Contributor

It doesn't look ideal with longer help text. But not terrible. What do you think?

I like general approach of moving the notice to the bottom of the dropdown. Something about the specific wording doesn't feel right to me - but I'm trying to place it...

I wonder if there is a way to word more like your original proposed notice from the sidebar? Something like

"This block's alignment settings are limited by its parent" Select parent block/group/whatever

@andrewserong

Copy link
Copy Markdown
Contributor

Based on the feedback, and because the actual problem that this PR aims to solve relates primarily to the alignments dropdown, I went ahead and moved something to the dropdown itself, like this:

Looking much better to me, and in practice using the control it feels really nice having a button right next to the alignment controls to go to where you can make the change. As a general idea, it seems to scale nicely to editing templates, too, in your other PR that builds on this (#82675).

It doesn't look ideal with longer help text. But not terrible. What do you think?

So yes, overall I'm liking this direction! Wording is tricky, the help text needs to be very short, and I kind of wonder if the helps text should explain "it limits the block's width" or be context for the action, i.e. "to enable other alignments" 🤔. But "it limits the block's width" is probably fine to go on with.

Something else this makes me think is that if this feature is really useful, it probably highlights that the parent selection button in the block toolbar might not be clear to users. That's a different problem than giving tactile immediate control next to the alignment controls, but being able to navigate up the block hierarchy is such an important part of working in the block editor, I'm curious how we can make that easier for folks. That said, don't want to derail the discussion here!

TL;DR I think you've got a good direction here 👍

@jasmussen
jasmussen force-pushed the add/block-width-constraint-notice branch from aa1d106 to ce7f80e Compare September 10, 2026 11:25
@jasmussen

Copy link
Copy Markdown
Contributor Author

Wonderful feedback, all. I've addressed the rebase conflicts, and now the wording is:

Select Group
Its layout limits widths

What do you think?

@jordesign

Copy link
Copy Markdown
Contributor

Its layout limits widths

I'm trying not to be pedantic - but do we refer to blocks with 'its' elsewhere in notices or labels? If so - then this is great! It's just not something I've noticed before.

Otherwise - does something like 'Group layout limits widths' or '[Block] layout limits widths'.

Or 'Parent Block limits widths' to be clear it is the parent block?

@jasmussen

Copy link
Copy Markdown
Contributor Author

Parent block isn't ideal because it could be an ancestor.

I agree on "Its" being odd. But it does keep the help text on one line, as soon as it's three lines, and because the icon is vertically centred, the entire menu item starts to look slightly odd. Not the end of the world, but if we're going to go three lines, we might as well be slightly more verbose than what I've been aiming for here.

How about: "A layout limits widths". Or "An ancestors layout limits widths" (that would span 3 lines). Or "Block layout limits widths"? Tricky!

@jordesign

Copy link
Copy Markdown
Contributor

Words are hard 🤣.

Does 'containing' cover both the cases of Parent and Ancestor?

"Containing block limits widths' ?

@jasmussen

Copy link
Copy Markdown
Contributor Author

Yes, or "An ancestor". I like the idea of layout being a word that's part of it, though, as that's the panel you should look for to fix.

@jasmussen

Copy link
Copy Markdown
Contributor Author

I wonder: can we/should we ship what exists, and then follow up if someone else mentions the weird wording?

@jordesign

jordesign commented Sep 10, 2026 via email

Copy link
Copy Markdown
Contributor

Base automatically changed from add/block-width-constraint-diagnostic to trunk September 11, 2026 05:50
@jasmussen
jasmussen force-pushed the add/block-width-constraint-notice branch from ce7f80e to 66ffe8d Compare September 18, 2026 07:10
@tellthemachines

Copy link
Copy Markdown
Contributor

Sorry to get to this so late. I have a couple of thoughts here:

  • there's a bit of an awkward balance between guiding the user to select the parent and then leaving them to find out what on the parent needs changing. The word "layout" provides a clue in English but there's no guarantee it'll work the same in translation. I wonder if Andy's suggestion of a tooltip may work better, especially if we add an explicit instruction like "enable by toggling parent layout to inner blocks use content width".
  • this only works for blocks whose parents expose layout controls. For blocks inside Details, Quote, or Accordion panel, selecting the parent does nothing because we can't edit its layout. It would be simple to hide the parent selection button for those cases, but then it wouldn't be obvious why the UI is different. If we were showing a tooltip instead, we could modify the text to explain that.

@jasmussen

Copy link
Copy Markdown
Contributor Author

Really good feedback, thank you. For one I wanted to mention that I'm also trying to approach the problem in the opposite direction, parent to child, here.

I know Andrew also had some thoughts, and in the end I will defer to the both of you on what, here (if anything), can ship, as we already shipped some other improvements and more are pending in #82673. That's also my blanket permission to push any changes if improvements occur to you.

@jasmussen

Copy link
Copy Markdown
Contributor Author

This is now dependant on #83955.

@jasmussen
jasmussen force-pushed the add/block-width-constraint-notice branch from 66ffe8d to 64fbc13 Compare October 22, 2026 10:36
@jasmussen

Copy link
Copy Markdown
Contributor Author

Rebased, migrated to typescript. Same behaviour. No behaviour change.

Worth noting, CC @tellthemachines: following the spacing question on #82600, the accessible name of a menu item with info now renders glued: "Select GroupIts layout limits widths", where an assertion expecting a space passed before the migration. Something in components or dom-accessibility-api changed. The browser reasoning still holds (the info wrapper is display: flex, which blockifies the spans so the name computation separates them), but this is a second sign that jsdom can’t evidence that either way, so the test here asserts the description renders inside the action item rather than depending on the separator.

@tellthemachines

Copy link
Copy Markdown
Contributor

Quick test run: we still have the problem of blocks that don't expose layout tools (Details, Quote, Accordion). For blocks inside those, pointing to the container is confusing because you can't change anything on it:

Screenshot 2026-10-23 at 10 47 50 am Screenshot 2026-10-23 at 10 49 53 am

@tellthemachines

Copy link
Copy Markdown
Contributor

I just tried out a solution to the problem from my comment above in #85421

jasmussen and others added 3 commits October 26, 2026 11:15
The alignment area migrated to TypeScript after this branch was opened, so
the change is re-applied onto the new files rather than rebased: git cannot
follow align.jsx to align.tsx through a rewrite.

Adds a BlockAlignmentConstraint type and clientId to AlignEditProps. No
behaviour change from the previous revision.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Two type errors from the TypeScript port:

- `useBlockDisplayInformation` is typed to take a `string`, but the parent
  client ID is `string | null`. The hook already guards an empty ID and
  returns `null`, so pass `''` when there is no reachable parent.
- The hook returned `null` where `BlockAlignmentControl` accepts
  `BlockAlignmentConstraint | undefined`. Return `undefined` instead.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: tellthemachines <isabel_brison@git.wordpress.org>
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
Co-authored-by: jasmussen <joen@git.wordpress.org>
@tellthemachines
tellthemachines force-pushed the add/block-width-constraint-notice branch from 2f2fd1a to a63bbe3 Compare October 26, 2026 00:15
! rootClientId ||
getBlockEditingMode( rootClientId ) !== 'default'
) {
return null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we could probably return null earlier here if there are no enabled controls. I can push a change for this!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Done; behaviour should be unchanged.

@tellthemachines tellthemachines left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This LGTM now!

@jasmussen

Copy link
Copy Markdown
Contributor Author

Let's try this.

@jasmussen
jasmussen merged commit 9ce4330 into trunk Oct 26, 2026
89 checks passed
@jasmussen
jasmussen deleted the add/block-width-constraint-notice branch October 26, 2026 06:01
@jasmussen

Copy link
Copy Markdown
Contributor Author

Thank you all for the substantial help!

@github-actions github-actions Bot added this to the Gutenberg 24.4 milestone Oct 26, 2026
@andrewserong

Copy link
Copy Markdown
Contributor

Nice work landing this, and thanks for finishing it off @tellthemachines! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Package] Block editor /packages/block-editor [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants