Skip to content

Button: Show the content controls everywhere and open the inspector on them - #85356

Open
jeryj wants to merge 3 commits into
trunkfrom
add/button-content-controls-everywhere
Open

jeryj wants to merge 3 commits into
trunkfrom
add/button-content-controls-everywhere

Conversation

@jeryj

@jeryj jeryj commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Part of #85961.

What?

A Button renders its content panel (Text, Link to, Open in new tab, View) in every editing context, not only inside a Navigation block or in content-only editing. The block inspector opens on a Content tab with those controls, like an Image or a Navigation Link, and the block styles, color, typography, width, and border controls move to the Styles tab.

Why?

#84854 added the content panel only for a Button in a menu or in a content-only section. A Button in post content kept its flat inspector, so the same block edited two different ways depending on where it sat. Selecting a Button, whether on the canvas or from its Buttons block's List View tab, should offer the same simplified flow as an Image or a Navigation Link: the content first, the styling on its own tab.

How?

  • packages/block-library/src/button/edit.jsx: the InspectorControls group="content" fill renders unconditionally. The Navigation-ancestor and content-only gate is removed.
  • No inspector code changes. The block inspector builds its tabs from the slot fills, so a content fill gives the Button a Content tab first, the Advanced panel (HTML element, Link relation) lands on the Settings tab, and the style supports and block styles make the Styles tab, the same way the Image block gets its three tabs.
  • The toolbar link button and its popover are unchanged.
  • A new e2e test selects a Buttons block with two Buttons, opens the inspector's List View tab, picks the first Button, and checks that the inspector opens on the Content tab with Text, Link to, Open in new tab, and View, and that editing Text and Link to there updates the block and the canvas.
  • E2E specs that assumed a flat Button inspector click the Styles or Settings tab first. The link popover test scopes its checkboxes to the popover, since the sidebar now has its own "Open in new tab" checkbox. Three color tests also wait for the text color palette to finish closing before picking from the background palette, since both palettes list the same colors and the strict locator briefly matched both.

Testing Instructions

  1. Edit a post and add a Buttons block with two Buttons. Give the first one some text and a link.
  2. Select the Buttons block, open the block inspector, and switch to its List View tab. Click the first Button's row. The inspector opens on the Content tab with Text, Link to, Open in new tab, and View.
  3. Edit the Text field, change the link from Link to, and toggle Open in new tab. The button on the canvas updates.
  4. Select the second Button on the canvas. The inspector also opens on its Content tab.
  5. Switch to the Styles tab. The Fill/Outline styles, Typography, Background, Width, and Border controls are there.
  6. Switch to the Settings tab. The Advanced panel holds HTML element and Link relation.
  7. A Button inside a Navigation block and a Button in a content-only List View behave as in Button: Add content controls for content-only editing #84854.
npm run test:e2e -- specs/editor/blocks/buttons.spec.js
npm run test:e2e -- specs/editor/blocks/navigation.spec.js -g "Button inside the menu"
npm run test:e2e -- specs/editor/blocks/navigation-list-view.spec.js -g "edits a Button"
npm run test:e2e -- specs/editor/various/block-bindings/custom-sources.spec.js -g "button"

Testing Instructions for Keyboard

Same as above. Tab into the inspector, arrow between the Content, Settings, and Styles tabs (and the Buttons block's List View tab), and Tab into the Text field, the Link to button, and the Open in new tab checkbox.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LsZq1CtjWAJVKoH1RVYdGF

@github-actions github-actions Bot added [Package] Block library /packages/block-library [Package] Block editor /packages/block-editor [Package] Edit Site /packages/edit-site labels Oct 21, 2026
@github-actions

github-actions Bot commented Oct 21, 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: jeryj <jeryj@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.

🏷️ Labels

This pull request needs exactly one label indicating its type, and has 0.

  • Required: any label starting with [Type].
  • Found: none.

Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you.

📦 Bundle size

Size Change: -50 B (0%)

Total Size: 8.56 MB

📦 View Changed
Filename Size Change
build/scripts/block-library/index.min.js 402 kB -50 B (-0.01%)

1af1004 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 5715dca trunk % Change
timeToFirstByte 56.15 ms +9.44% -2.67% 60.4 ms +3.97% -4.88% -7.04%
largestContentfulPaint 92 ms +8.7% -4.35% 104 ms +3.85% -11.54% -11.54%
lcpMinusTtfb 34.45 ms +16.69% -3.34% 38.9 ms +16.45% -10.41% -11.44%
wpBeforeTemplate 29.62 ms +6.08% -1.05% 31.23 ms +6.56% -4.26% -5.16%
wpTemplate 22.37 ms +3.44% -4.83% 24.38 ms +3.36% -3.94% -8.24%
wpTotal 52.52 ms +9.31% -2.82% 56.28 ms +4.55% -5.22% -6.68%
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 5715dca trunk % Change
timeToFirstByte 47.35 ms +9.71% -1.48% 49.7 ms +7.34% -1.51% -4.73%
largestContentfulPaint 100 ms +6% -0% 104 ms +3.85% -0% -3.85%
lcpMinusTtfb 53.8 ms +2.14% -1.39% 55.35 ms +1.81% -1.9% -2.8%
wpBeforeTemplate 26.91 ms +8.88% -0.85% 28.01 ms +7.71% -1.61% -3.93%
wpTemplate 17.02 ms +7.11% -1.65% 18.43 ms +5.59% -4.02% -7.65%
wpTotal 44.16 ms +9.69% -1.63% 46.58 ms +6.08% -1.63% -5.2%
wpMemoryUsage 6.40 MB +0% -0% 6.36 MB +0% -0% 0.53%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric 5715dca trunk % Change
mediaProcessingJpeg 402.44 ms +1.25% -0.58% 406.5 ms +0.71% -0.87% -1%
mediaProcessingAvif 6132.26 ms +0.73% -0.03% 6164.03 ms +0.22% -0.34% -0.52%
mediaProcessingJpegToAvif 4228.4 ms +0.5% -0.06% 4267.2 ms +0.32% -0.38% -0.91%

media-upload

Metric 5715dca trunk % Change
jpegUploadProcessing 1737.83 ms +13.09% -16.27% 1942 ms +0.63% -23.32% -10.51%
pngUploadProcessing 251.2 ms +10.24% -31.42% 263.77 ms +9.3% -25.9% -4.77%
largeJpegUploadProcessing 1944.42 ms +0.98% -0.19% 1957.26 ms +0.31% -0.72% -0.66%
multipleImageUploadProcessing 2083.35 ms +1.4% -1.06% 2081.21 ms +0.86% -0.86% 0.1%

post-editor

Metric 5715dca trunk % Change
serverResponse 524.08 ms +2.37% -6.5% 522.48 ms +10.75% -3.05% 0.31%
firstPaint 396.51 ms +28.06% -35.77% 243.35 ms +115.57% -13.91% 62.94%
domContentLoaded 894.32 ms +1.06% -2.45% 884.87 ms +1.49% -1.41% 1.07%
loaded 895.66 ms +1.07% -2.46% 886.16 ms +1.49% -1.41% 1.07%
firstContentfulPaint 514.61 ms +3.47% -1.33% 516.98 ms +2.2% -2.21% -0.46%
firstBlock 2992.41 ms +1.1% -1.28% 2940.29 ms +1.69% -1.61% 1.77%
type 18.3 ms +5.46% -8.14% 18.42 ms +5.81% -8.52% -0.65%
typeWithoutInspector 18.04 ms +8.76% -4.16% 18.42 ms +1.9% -4.56% -2.06%
typeWithTopToolbar 25.24 ms +5.63% -14.74% 23.13 ms +7.05% -9.94% 9.12%
typeContainer 8.73 ms +4.93% -10.08% 8.51 ms +5.29% -2.47% 2.59%
focus 114.9 ms +14.58% -5.08% 115.61 ms +1.16% -3.87% -0.61%
firstFocus 233.5 ms +0% -0% 231.47 ms +0% -0% 0.88%
selectAll 466.47 ms +7.55% -3.13% 481.84 ms +4.58% -5.27% -3.19%
undo 31.14 ms +4.01% -4.75% 32.28 ms +1.7% -7.37% -3.53%
listViewOpen 77.44 ms +7.06% -5.17% 76.75 ms +7.27% -8.27% 0.9%
inserterOpen 40.46 ms +12.21% -4.72% 39.9 ms +5.61% -3.86% 1.4%
inserterHover 11.07 ms +14.72% -7.5% 11.42 ms +8.84% -9.98% -3.06%
inserterSearch 8.65 ms +12.25% -6.82% 8.3 ms +8.92% -8.92% 4.22%
loadPatterns 642.83 ms +3.36% -4% 651.01 ms +7.69% -3.99% -1.26%
wpTotal 514.01 ms +2.4% -6.63% 511.97 ms +10.99% -3.03% 0.4%
wpMemoryUsage 14.73 MB +0% -0% 14.72 MB +0% -0% 0.1%
wpDbQueries 55 +0% -1.82% 55 +0% -1.82% 0%

site-editor

Metric 5715dca trunk % Change
serverResponse 426.95 ms +3.15% -2.32% 451.29 ms +1.05% -1.46% -5.39%
firstPaint 223.48 ms +17.61% -9.54% 237.18 ms +37.92% -11.85% -5.78%
domContentLoaded 839.62 ms +2.48% -0.71% 892.25 ms +1.86% -2.46% -5.9%
loaded 840.58 ms +2.51% -0.7% 893.58 ms +1.86% -2.51% -5.93%
firstContentfulPaint 449.3 ms +5.12% -2.66% 494.98 ms +3.77% -3.28% -9.23%
firstBlock 3634.16 ms +0.74% -0.72% 3751.4 ms +0.84% -0.43% -3.13%
type 18.7 ms +8.61% -0.7% 19.02 ms +7.78% -7.36% -1.68%
navigate 118.44 ms +5.26% -2.35% 128.39 ms +6.39% -3.8% -7.75%
loadPatterns 1206.46 ms +5.45% -3.39% 1185.62 ms +8.1% -5.08% 1.76%
loadPages 973.78 ms +2.25% -1.98% 967.33 ms +1.81% -4.19% 0.67%
wpTotal 417.9 ms +3.23% -2.35% 441.9 ms +1.1% -1.54% -5.43%
wpMemoryUsage 12.77 MB +0% -0% 12.73 MB +0% -0% 0.27%
wpDbQueries 44 +2.27% -0% 44 +2.27% -0% 0%

1af1004 Run

Base automatically changed from add/button-content-controls to trunk October 22, 2026 22:29
jeryj and others added 3 commits October 29, 2026 14:35
…n them

A Button now renders its content panel (Text, Link to, Open in new tab,
View) in every editing context, not only inside a Navigation block or in
content-only editing. The block inspector therefore opens on a Content tab
like an Image or a Navigation Link, and the block styles, color,
typography, width, and border controls move to the Styles tab. The
Advanced panel (HTML element, Link relation) sits on the Settings tab.

The e2e specs that assumed a flat Button inspector click the Styles or
Settings tab first, and the link popover test scopes its checkboxes to the
popover since the sidebar now has its own "Open in new tab" checkbox.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LsZq1CtjWAJVKoH1RVYdGF
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LsZq1CtjWAJVKoH1RVYdGF
Selecting a Button from its parent Buttons block's List View tab opens
the inspector on the Content tab, and edits to Text and Link to there
reach the block and the canvas. Keep the merged #84854 changelog entry
and give this PR its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S1u1vgir2YJpmNhb7h3ESd
@jeryj
jeryj force-pushed the add/button-content-controls-everywhere branch from 4736c8e to 1af1004 Compare October 29, 2026 19:45
@github-actions github-actions Bot removed [Package] Block editor /packages/block-editor [Package] Edit Site /packages/edit-site labels Oct 29, 2026

This branch has not been deployed

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

Labels

[Package] Block library /packages/block-library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant