Repository navigation
Paragraph: Don't show an empty toolbar group without alignment controls - #85796
Conversation
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>
🤖 PR meta 🤖🎉 PropsIf 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +2 B (0%) Total Size: 8.56 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome 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
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The new e2e test in
paragraph.spec.jsfails on trunk and passes with this change.Testing Instructions for Keyboard
Screenshots or screencast
Use of AI Tools
Written with Claude Code (Claude Opus 5.5) and reviewed by the author.
🤖 Generated with Claude Code