Skip to content

Editor: Describe the post title in the sidebar instead of "No block selected" - #82673

Open
jasmussen wants to merge 5 commits into
trunkfrom
add/template-block-scope-guidance
Open

jasmussen wants to merge 5 commits into
trunkfrom
add/template-block-scope-guidance

Conversation

@jasmussen

@jasmussen jasmussen commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

What?

Aruably closes, but let's not yet, #79285, as there are some related followups still in #79285 (comment).

Clicking the post title and opening the Block tab no longer says "No block selected." It describes the title, and explains that its appearance comes from the template, with a way to go and edit it.

Before:

image

After:

image

How?

Claude wrote this:

With the template hidden, the title is not a block at all: PostTitle is editor chrome rendered outside <BlockList>, and focusing it clears the block selection. So there is nothing for the block inspector to select, and no existing state that distinguishes "the title is being edited" from "nothing is selected" — both look identical to getBlockSelectionStart().

PostTitle already tracked its own focus locally for styling. That now also records isEditingPostTitle in the editor store, following the pattern of the other small UI flags there (blockInserterPanel, listViewPanel). The sidebar renders the title panel in the Block tab when that flag is set and no block is selected.

Two details that are easy to get wrong:

Focus is not cleared on blur. Opening the sidebar's Block tab moves focus out of the title, so clearing on blur would unset the flag in the same gesture that opens the tab meant to read it — the panel would only ever appear on a second click. Selecting a block is what supersedes the title, and the sidebar checks for that directly. This mirrors how block selection already survives clicking into the sidebar.

BlockCard is now exported from block-editor's private APIs. The card describes core/post-title even though no such block exists in the tree, so the information comes from getBlockType() rather than from a selection. editor already unlocks these APIs in several places.

The notice uses status="info" rather than a warning: nothing has gone wrong, and it appears every time the title takes focus, so a persistent amber would be a lot of alarm for a routine state.

Testing Instructions

  1. On a block theme, edit a post or page with Show template off (the default).
  2. Click into the title, then open the Block tab in the sidebar.
  3. Expected: a Title block card, and a notice naming the template with a button to edit it. Previously this said "No block selected."
  4. Press the button. It should navigate to that template.
  5. Click a block in the content. The panel should give way to that block's inspector.

Please also confirm:

  • A classic theme, or any post with no template. Only the card shows — there is no template to name or offer.
  • A user without template editing permission sees the card without the notice.
  • Show template on. Unchanged: the template's own blocks are selectable and the block inspector behaves as before.
  • The title still behaves normally — typing, selection, Enter to create the first block.

Testing Instructions for Keyboard

  1. Focus the title field.
  2. Open the sidebar and move to the Block tab.
  3. The card and notice should be reachable, and the button should be in the tab order and announce which template it opens.

Use of AI Tools

Claude Opus 5.

@jasmussen jasmussen self-assigned this Sep 9, 2026
@jasmussen
jasmussen requested a review from ellatrix as a code owner September 9, 2026 11:24
@jasmussen jasmussen added the [Type] Enhancement A suggestion for improvement. label Sep 9, 2026
@github-actions github-actions Bot added [Package] Editor /packages/editor [Package] Block editor /packages/block-editor labels Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

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.

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: mirka <0mirka00@git.wordpress.org>

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

@jasmussen

Copy link
Copy Markdown
Contributor Author

Note, there's a typographic widow in the Notice. This is likely because it doesn't internally use the Text component. Does Notice V2? CC: @WordPress/gutenberg-components

@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

📦 Bundle size

Size Change: +839 B (+0.01%)

Total Size: 8.06 MB

📦 View Changed
Filename Size Change
build/scripts/block-editor/index.min.js 474 kB +31 B (+0.01%)
build/scripts/editor/index.min.js 583 kB +752 B (+0.13%)
build/styles/editor/style-rtl.css 31.9 kB +15 B (+0.05%)
build/styles/editor/style-rtl.min.css 27.2 kB +13 B (+0.05%)
build/styles/editor/style.css 31.9 kB +15 B (+0.05%)
build/styles/editor/style.min.css 27.2 kB +13 B (+0.05%)

faa3c40 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 20bb16a trunk % Change
timeToFirstByte 56.2 ms +9.07% -2.31% 54.2 ms +5.44% -1.2% 3.69%
largestContentfulPaint 100 ms +4% -10% 96 ms +4.17% -8.33% 4.17%
lcpMinusTtfb 42.7 ms +5.27% -20.49% 38.2 ms +10.47% -13.09% 11.78%
wpBeforeTemplate 27.92 ms +13.18% -2.01% 27.27 ms +1.87% -0.84% 2.38%
wpTemplate 24.14 ms +3.36% -2.9% 23.37 ms +4.32% -2.18% 3.29%
wpTotal 52.43 ms +9.8% -1.95% 50.61 ms +5.83% -1.15% 3.6%
wpMemoryUsage 7.53 MB +0% -0% 7.48 MB +0% -0% 0.58%
wpDbQueries 17 +0% -0% 17 +0% -0% 0%

front-end-classic-theme

Metric 20bb16a trunk % Change
timeToFirstByte 43.9 ms +3.64% -1.71% 43.15 ms +8.57% -2.09% 1.74%
largestContentfulPaint 100 ms +0% -4% 96 ms +4.17% -0% 4.17%
lcpMinusTtfb 54.05 ms +3.98% -1.85% 52.85 ms +3.12% -2.27% 2.27%
wpBeforeTemplate 26.39 ms +1.82% -2.77% 25.95 ms +6.86% -1.81% 1.7%
wpTemplate 14.34 ms +2.37% -0.91% 14.33 ms +4.19% -3.14% 0.07%
wpTotal 40.99 ms +3.85% -1.9% 40.41 ms +8.71% -2.3% 1.44%
wpMemoryUsage 5.52 MB +0% -0% 5.47 MB +0% -0% 0.81%
wpDbQueries 14 +0% -0% 14 +0% -0% 0%

media-processing

Metric 20bb16a trunk % Change
mediaProcessingJpeg 392.93 ms +0.08% -0.46% 393.95 ms +1.17% -0.89% -0.26%
mediaProcessingAvif 6035.35 ms +0.19% -0.08% 6032.25 ms +0.09% -0.02% 0.05%
mediaProcessingJpegToAvif 4174.09 ms +0.13% -0.1% 4172.07 ms +0.09% -0.06% 0.05%

media-upload

Metric 20bb16a trunk % Change
jpegUploadProcessing 1438.93 ms +35.58% -1.98% 1411.58 ms +1.01% -0.57% 1.94%
pngUploadProcessing 207.44 ms +4.21% -2.12% 210.08 ms +1.2% -3.34% -1.26%
largeJpegUploadProcessing 1414.64 ms +0.71% -0.61% 1400.96 ms +0.99% -0.19% 0.98%
multipleImageUploadProcessing 1581.36 ms +1.36% -1.46% 1548.77 ms +0.24% -1.16% 2.1%

post-editor

Metric 20bb16a trunk % Change
serverResponse 428.69 ms +4.34% -9.58% 424.99 ms +1.34% -8.45% 0.87%
firstPaint 194.45 ms +17.22% -10.17% 215.74 ms +9.27% -5.2% -9.87%
domContentLoaded 1241.81 ms +2.97% -1.72% 1262.61 ms +1.16% -1.65% -1.65%
loaded 1242.98 ms +2.97% -1.72% 1263.8 ms +1.16% -1.63% -1.65%
firstContentfulPaint 421.24 ms +4.08% -4.76% 421.5 ms +1.49% -1.66% -0.06%
firstBlock 3397.14 ms +0.26% -1.61% 3411.41 ms +0.34% -0.36% -0.42%
type 15.81 ms +5.88% -7.02% 14.33 ms +8.16% -10.05% 10.33%
typeWithoutInspector 13.9 ms +8.49% -3.09% 14.49 ms +7.59% -8.14% -4.07%
typeWithTopToolbar 17.86 ms +10.3% -3.25% 18.13 ms +8.55% -8.44% -1.49%
typeContainer 9.01 ms +6.1% -10.54% 9.04 ms +14.93% -3.87% -0.33%
focus 76.13 ms +24.1% -5% 78.37 ms +20.38% -11.83% -2.86%
firstFocus 175.96 ms +0% -0% 173.69 ms +0% -0% 1.31%
selectAll 561.74 ms +0.07% -3.65% 545.1 ms +0.27% -0.29% 3.05%
listViewOpen 64.86 ms +6.29% -4.01% 67.99 ms +13.1% -16.08% -4.6%
inserterOpen 22.88 ms +6.38% -12.54% 21.22 ms +10.89% -6.64% 7.82%
inserterHover 3.73 ms +6.7% -8.04% 3.65 ms +9.04% -3.84% 2.19%
inserterSearch 8.55 ms +9.24% -7.02% 8.2 ms +20.49% -2.93% 4.27%
loadPatterns 628.48 ms +7.13% -1.36% 623.19 ms +4.76% -2.92% 0.85%
wpTotal 417.57 ms +4.14% -9.86% 413.63 ms +1.43% -8.67% 0.95%
wpMemoryUsage 13.06 MB +0% -0% 13.02 MB +0% -0% 0.34%
wpDbQueries 54 +0% -1.85% 54 +0% -0% 0%

site-editor

Metric 20bb16a trunk % Change
serverResponse 507.81 ms +2.42% -4.21% 484.35 ms +6.62% -3.12% 4.84%
firstPaint 257.89 ms +60.12% -8.32% 284.57 ms +4.62% -13.78% -9.38%
domContentLoaded 1356.2 ms +0.86% -1.33% 1344.62 ms +1.37% -0.97% 0.86%
loaded 1357.46 ms +0.85% -1.33% 1345.79 ms +1.36% -0.96% 0.87%
firstContentfulPaint 432.76 ms +1.7% -3.02% 426.7 ms +2.25% -0.66% 1.42%
firstBlock 4381.83 ms +0.23% -0.26% 4246.13 ms +0.76% -0.96% 3.2%
type 13.88 ms +3.46% -4.03% 14.09 ms +4.05% -4.05% -1.49%
navigate 102.85 ms +1.93% -10.75% 98.31 ms +10.89% -7.6% 4.62%
loadPatterns 1475.15 ms +10.7% -15.85% 1521.9 ms +9.8% -5.91% -3.07%
loadPages 1079.06 ms +2.07% -2.16% 1028.08 ms +2.82% -0.72% 4.96%
wpTotal 497.93 ms +2.54% -4.25% 474.92 ms +6.8% -3.2% 4.85%
wpMemoryUsage 12.07 MB +0% -0% 12.03 MB +0% -0% 0.37%
wpDbQueries 43 +2.33% -0% 43.5 +1.15% -1.15% -1.15%

faa3c40 Run

@mirka

mirka commented Sep 9, 2026

Copy link
Copy Markdown
Member

Note, there's a typographic widow in the Notice. This is likely because it doesn't internally use the Text component. Does Notice V2? CC: @WordPress/gutenberg-components

Yes, the new Notice is doing text-wrap: pretty for both title and the description. I guess you're free to use the Text component in the old Notice, too.

@jasmussen

Copy link
Copy Markdown
Contributor Author

Thank you. I pushed Text now.

@jasmussen

Copy link
Copy Markdown
Contributor Author

Noting that I pushed a fix similar to what was discovered here#82675 (comment).

@jasmussen

Copy link
Copy Markdown
Contributor Author

Aki made a solid point here that the Notice should also be visible when you are editing a page (not template) with show template enabled, so now it is:

2026-09-10 13 13 41 localhost b86a671122ea

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 editor /packages/block-editor [Package] Editor /packages/editor [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants