Skip to content

Paragraph: Don't show an empty toolbar group without alignment controls - #85796

Merged
ellatrix merged 2 commits into
trunkfrom
fix/term-blocks-without-editor-store
Oct 28, 2026
Merged

ellatrix merged 2 commits into
trunkfrom
fix/term-blocks-without-editor-store

Conversation

@ellatrix

@ellatrix ellatrix commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

What?

Removes the empty group from the Paragraph block toolbar when the theme offers neither text alignment nor wide alignment.

Why?

Paragraph always adds its "Left to right" button to the toolbar's block group, but the button renders nothing unless the editor is in a right-to-left language. Usually the group also holds "Align text" or "Align block", so nobody sees it. When a theme turns off text alignment ("typography": { "textAlign": false }) and has no wide alignment, the group holds nothing and the toolbar draws an empty box between the block icon and the formatting buttons.

The same empty box shows in any block editor outside WordPress, where those settings are off by default.

This became possible when Paragraph moved its alignment button to the text-align block support (#73111).

How?

Only add the "Left to right" fill when the editor is in a right-to-left language, instead of adding a fill that renders nothing.

Testing Instructions

Open in WordPress Playground: Twenty Sixteen (no wide alignment) with a filter that turns off text alignment, and a post with one paragraph.

  1. Click the paragraph.
  2. Check the block toolbar: the paragraph icon is followed directly by Bold, Italic, Link and More, with no empty box between them.
  3. Optional, for right-to-left: switch the site language to Arabic or Hebrew under Settings > General, open the post again and click the paragraph. The "Left to right" button is still in the toolbar.

The new e2e test in paragraph.spec.js fails on trunk and passes with this change.

Testing Instructions for Keyboard

  1. Put the cursor in the paragraph, then press Shift+Tab to move to the block toolbar.
  2. Press the arrow keys to move through the toolbar: focus goes from the paragraph icon straight to Bold.

Screenshots or screencast

Before After
Paragraph toolbar with an empty box between the paragraph icon and Bold Paragraph toolbar with no empty box

Use of AI Tools

Written with Claude Code (Claude Opus 5.5) and reviewed by the author.

🤖 Generated with Claude Code

Paragraph always filled the toolbar's block group with its "Left to right"
control, which renders nothing unless the editor is in a right-to-left
language. When the theme offers neither text alignment nor wide alignment,
that empty fill drew an empty group in the toolbar. Only add the fill in
right-to-left languages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ellatrix ellatrix added [Type] Bug An existing feature does not function as intended [Block] Paragraph Affects the Paragraph Block labels Oct 27, 2026
@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Oct 27, 2026
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground

🎉 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: ellatrix <ellatrix@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: +2 B (0%)

Total Size: 8.56 MB

📦 View Changed
Filename Size Change
build/scripts/block-library/index.min.js 401 kB +2 B (0%)

c271ccc Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 6a79f59 trunk % Change
timeToFirstByte 35.55 ms +11.25% -6.89% 35.35 ms +10.33% -6.79% 0.57%
largestContentfulPaint 64 ms +6.25% -6.25% 64 ms +6.25% -9.38% 0%
lcpMinusTtfb 26.9 ms +13.2% -5.76% 25.6 ms +22.07% -6.25% 5.08%
wpBeforeTemplate 18.64 ms +11.86% -4.67% 18.78 ms +16.35% -5.54% -0.75%
wpTemplate 12.85 ms +10.51% -3.97% 12.9 ms +4.26% -3.49% -0.39%
wpTotal 32.62 ms +9.66% -7.45% 32.31 ms +11.14% -7.06% 0.96%
wpMemoryUsage 7.70 MB +0% -0% 7.67 MB +0% -0% 0.43%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric 6a79f59 trunk % Change
timeToFirstByte 29.9 ms +11.2% -2.17% 29.45 ms +14.77% -2.21% 1.53%
largestContentfulPaint 70 ms +2.86% -2.86% 68 ms +5.88% -0% 2.94%
lcpMinusTtfb 38.75 ms +3.35% -1.16% 38.45 ms +2.6% -2.6% 0.78%
wpBeforeTemplate 16.7 ms +7.54% -3.35% 16.55 ms +11.9% -1.87% 0.91%
wpTemplate 10.41 ms +9.8% -3.27% 10.13 ms +10.37% -3.26% 2.76%
wpTotal 27 ms +12.44% -2.11% 26.9 ms +15.76% -2.68% 0.37%
wpMemoryUsage 6.39 MB +0% -0% 6.36 MB +0% -0% 0.53%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric 6a79f59 trunk % Change
mediaProcessingJpeg 226.06 ms +2.49% -1.42% 227.73 ms +1.67% -1.37% -0.73%
mediaProcessingAvif 3644.18 ms +0.2% -0.8% 3677.96 ms +1.15% -1.84% -0.92%
mediaProcessingJpegToAvif 2559.82 ms +0.73% -1.47% 2552.48 ms +2.18% -1.59% 0.29%

media-upload

Metric 6a79f59 trunk % Change
jpegUploadProcessing 939.07 ms +1.05% -4.79% 901.07 ms +0.14% -0.95% 4.22%
pngUploadProcessing 181.31 ms +3.88% -2.97% 178.7 ms +0.93% -2.56% 1.46%
largeJpegUploadProcessing 907.73 ms +0.38% -1.65% 904.04 ms +1.39% -1.7% 0.41%
multipleImageUploadProcessing 1021.63 ms +0.45% -2.63% 1023.25 ms +2.78% -1.74% -0.16%

post-editor

Metric 6a79f59 trunk % Change
serverResponse 317.03 ms +9.3% -4.09% 323.58 ms +6.3% -7.24% -2.02%
firstPaint 404.73 ms +2.23% -2.92% 176.32 ms +126.54% -9.2% 129.54%
domContentLoaded 686.91 ms +1.02% -0.73% 681.69 ms +0.33% -1.93% 0.77%
loaded 687.87 ms +1.02% -0.72% 682.72 ms +0.36% -1.93% 0.75%
firstContentfulPaint 410.71 ms +1.39% -3.21% 400.47 ms +1.63% -0.51% 2.56%
firstBlock 2331.51 ms +1.36% -1.27% 2365.95 ms +1.57% -1.55% -1.46%
type 15.26 ms +4.39% -5.31% 15.61 ms +3.65% -4.04% -2.24%
typeWithoutInspector 14.9 ms +8.46% -4.83% 14.73 ms +2.04% -0.54% 1.15%
typeWithTopToolbar 19.3 ms +1.55% -2.75% 19.35 ms +4.86% -4.81% -0.26%
typeContainer 6.52 ms +6.29% -9.2% 6.73 ms +5.79% -9.66% -3.12%
focus 96.52 ms +7.34% -6.46% 92.17 ms +1.41% -7.87% 4.72%
firstFocus 180.98 ms +0% -0% 185.28 ms +0% -0% -2.32%
selectAll 386.05 ms +5.7% -1.18% 379.08 ms +4.04% -1.2% 1.84%
undo 27.17 ms +3.68% -8.76% 26.07 ms +15.84% -5.1% 4.22%
listViewOpen 58 ms +14.6% -5.64% 59.18 ms +7.79% -11.88% -1.99%
inserterOpen 34.84 ms +4.54% -9.73% 32.66 ms +15.86% -10.66% 6.67%
inserterHover 9.34 ms +7.71% -5.14% 9.6 ms +5.52% -9.9% -2.71%
inserterSearch 7.04 ms +6.68% -3.27% 7.65 ms +5.75% -6.8% -7.97%
loadPatterns 502.19 ms +4.51% -2.43% 491.7 ms +5.33% -0.85% 2.13%
wpTotal 308.18 ms +9.18% -4.26% 314.52 ms +6.54% -7.43% -2.02%
wpMemoryUsage 14.75 MB +0% -0% 14.72 MB +0% -0% 0.24%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric 6a79f59 trunk % Change
serverResponse 505.08 ms +3.4% -5.29% 497.76 ms +4.1% -5.75% 1.47%
firstPaint 299.78 ms +16.47% -15.67% 273.51 ms +12.25% -3.64% 9.6%
domContentLoaded 912.31 ms +2.73% -1.98% 906.23 ms +2.71% -1.13% 0.67%
loaded 913.36 ms +2.75% -1.94% 907.34 ms +2.71% -1.14% 0.66%
firstContentfulPaint 512.67 ms +1.88% -4.7% 515.28 ms +3.79% -7.94% -0.51%
firstBlock 4013.32 ms +0.84% -1.64% 4011.79 ms +0.93% -1.95% 0.04%
type 19.48 ms +11.4% -6.88% 18.29 ms +6.07% -4.1% 6.51%
navigate 127.14 ms +5.34% -2.15% 120.77 ms +7.54% -1.66% 5.27%
loadPatterns 1227.69 ms +10.16% -2.62% 1157.34 ms +7.36% -3.3% 6.08%
loadPages 993.76 ms +3.5% -3.64% 967.74 ms +3.38% -2.45% 2.69%
wpTotal 495.74 ms +3.53% -5.43% 488.22 ms +4.22% -5.86% 1.54%
wpMemoryUsage 12.77 MB +0% -0% 12.74 MB +0% -0% 0.24%
wpDbQueries 44 +2.27% -0% 44 +2.27% -0% 0%

c271ccc 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.

As a site builder, I want to insert a core navigation overlay pattern with CTA and see it on the frontend (Site Editor v2) in /test/e2e/specs/site-editor/navigation-overlay-template-part.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeVisible() failed

Locator:  getByRole('option', { name: /Overlay with site info and CTA/i })
Expected: visible
Received: hidden
Timeout:  5000ms

Call log:
  - Expect "toBeVisible" getByRole('option', { name: /Overlay with site info and CTA/i }) with timeout 5000ms
  - waiting for getByRole('option', { name: /Overlay with site info and CTA/i })
    14 × locator resolved to <div role="option" tabindex="-1" data-base-ui-tooltip-trigger="" aria-label="Overlay with site info and CTA" class="block-editor-block-patterns-list__item" id="core/navigation-overlay-centered-with-extras" aria-describedby="block-editor-block-patterns-list__item-description-4">…</div>
       - unexpected value "hidden"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/navigation-overlay-template-part.spec.js:254:31
Backspace in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  -  5
+ Received  + 11

@@ -1,25 +1,31 @@
  Array [
    Object {
      "innerBlocks": Array [
        Object {
          "attributes": Object {
-           "content": "1",
+           "content": "1‸a",
          },
-         "innerBlocks": Array [
+         "innerBlocks": Array [],
+         "name": "core/list-item",
+       },
        Object {
+         "attributes": Object {
+           "content": "2",
+         },
          "innerBlocks": Array [
            Object {
              "attributes": Object {
-                   "content": "a‸2",
+               "ordered": false,
+               "values": "",
              },
-                 "name": "core/list-item",
-               },
+             "innerBlocks": Array [
                Object {
                  "attributes": Object {
                    "content": "b",
                  },
+                 "innerBlocks": Array [],
                  "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:2041:42
Delete (forward) in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  -  5
+ Received  + 11

@@ -1,25 +1,31 @@
  Array [
    Object {
      "innerBlocks": Array [
        Object {
          "attributes": Object {
-           "content": "1",
+           "content": "1‸a",
          },
-         "innerBlocks": Array [
+         "innerBlocks": Array [],
+         "name": "core/list-item",
+       },
        Object {
+         "attributes": Object {
+           "content": "2",
+         },
          "innerBlocks": Array [
            Object {
              "attributes": Object {
-                   "content": "a‸2",
+               "ordered": false,
+               "values": "",
              },
-                 "name": "core/list-item",
-               },
+             "innerBlocks": Array [
                Object {
                  "attributes": Object {
                    "content": "b",
                  },
+                 "innerBlocks": Array [],
                  "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:2056:42
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 format text across blocks in /test/e2e/specs/editor/various/multi-block-selection.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 1
+ Received  + 1

@@ -1,9 +1,9 @@
  Array [
    Object {
      "attributes": Object {
-       "content": "ab",
+       "content": "b",
      },
      "name": "core/paragraph",
    },
    Object {
      "attributes": Object {

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:2219:41
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  - 1
+ Received  + 1

  Array [
    Object {
-     "name": "core/column",
+     "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:1194:5
should indent and outdent level 2 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:933:3
should indent and outdent multi-selected items with Tab 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

@@ -1,8 +1,8 @@
  <!-- wp:list -->
  <ul class="wp-block-list"><!-- wp:list-item -->
- <li>one<!-- wp:list -->
+ <li>ne<!-- wp:list -->
  <ul class="wp-block-list"><!-- wp:list-item -->
  <li>two</li>
  <!-- /wp:list-item -->

  <!-- wp:list-item -->

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:1118:52
should indent with Space and outdent with Shift+Space at the start in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 5
+ Received  + 1

  <!-- wp:list -->
  <ul class="wp-block-list"><!-- wp:list-item -->
- <li>a<!-- wp:list -->
- <ul class="wp-block-list"><!-- wp:list-item -->
- <li>b</li>
- <!-- /wp:list-item --></ul>
- <!-- /wp:list --></li>
+ <li></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:875:52
should insert a line break on shift+enter in a non trailing list item in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 10
+ Received  + 10

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

- <!-- wp:list-item -->
+ <!-- wp:paragraph -->
- <li>c</li>
+ <p>c</p>
- <!-- /wp:list-item --></ul>
- <!-- /wp:list -->
+ <!-- /wp:paragraph -->

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:1233:52
should keep a full selection when outdenting nested items with Shift+Tab 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:1166:3
should leave the rest of the list intact when merging into an empty list item in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 32
+ Received  +  1

- Array [
-   Object {
-     "innerBlocks": Array [
-       Object {
-         "attributes": Object {
-           "content": "1",
-         },
-         "innerBlocks": 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",
-           },
-         ],
-         "name": "core/list-item",
-       },
-     ],
-     "name": "core/list",
-   },
- ]
+ Array []
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:3118:38
should merge a following sibling list into the outermost list with Delete from a nested item (#77245) in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 2
+ Received  + 2

@@ -8,11 +8,11 @@
          "innerBlocks": Array [
            Object {
              "innerBlocks": Array [
                Object {
                  "attributes": Object {
-                   "content": "b‸",
+                   "content": "b",
                  },
                  "name": "core/list-item",
                },
              ],
              "name": "core/list",
@@ -25,11 +25,11 @@
    },
    Object {
      "innerBlocks": Array [
        Object {
          "attributes": Object {
-           "content": "1",
+           "content": "‸1",
          },
          "innerBlocks": Array [
            Object {
              "innerBlocks": Array [
                Object {

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:2854:41
should place the caret at the click position when clicking a block that is not selected in /test/e2e/specs/editor/various/writing-flow.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 1
+ Received  + 1

@@ -1,9 +1,9 @@
  Array [
    Object {
      "attributes": Object {
-       "content": "First!",
+       "content": "First",
      },
      "name": "core/paragraph",
    },
    Object {
      "attributes": Object {

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/writing-flow.spec.js:952:41
should select with shift + click 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:380: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

c271ccc Run

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ellatrix
ellatrix marked this pull request as ready for review October 27, 2026 22:58
@ellatrix
ellatrix requested a review from fabiankaegy as a code owner October 27, 2026 22:58
@ellatrix
ellatrix merged commit e98fc6b into trunk Oct 28, 2026
111 of 113 checks passed
@ellatrix
ellatrix deleted the fix/term-blocks-without-editor-store branch October 28, 2026 00:59
@github-actions github-actions Bot added this to the Gutenberg 24.4 milestone Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Paragraph Affects the Paragraph Block [Package] Block library /packages/block-library [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant