Repository navigation
Conversation
|
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 If 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. |
🤖 PR meta 🤖📦 Bundle sizeSize Change: +520 B (+0.01%) Total Size: 8.01 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
|
|
I followed the testing instructions, but I can't get the message to show, sorry. What theme are you using? |
| 'postType', | ||
| TEMPLATE_POST_TYPE, | ||
| getCurrentTemplateId() | ||
| )?.title?.rendered |
There was a problem hiding this comment.
I think we should be using getTemplateInfo, which will display the name of the template, rather than title?rendered which will show the slug.
| __( | ||
| 'Editing template. Changes made here affect all posts and pages that use the template.' | ||
| ), | ||
| { type: 'snackbar' } |
There was a problem hiding this comment.
Should we add a back action, like we do for other snackbars?
|
Thanks for the reviews, Ben. I tried to address it best as I could. If I read it right, you surfaced an issue I will apply in one of the other PRs as well. On reproduction steps, the first catch may be why you couldn't reproduce it. As my Claude suggests:
Try these new steps to repro:
Expected: Wide and Full are listed as "Not available", then a separator, then Edit Pages template, with "The template limits this block's width." Choosing it navigates to that template and raises a snackbar with a Back action. |
aa1d106 to
ce7f80e
Compare
ce7f80e to
66ffe8d
Compare
|
Hey 👋 I wanted to give you a heads-up since this pull request is affected by recent validation changes for changelog files. #83043 adds additional validation for changelog files. You'll note that this pull request is currently failing a "Required changes from trunk" check. What you'll need to do: You will need to either rebase or merge the latest code from |
|
This is now dependant on #83955. |
What?
Builds on #82607, and part of the width guidance discussed in #79285.
#82607 explains a width constraint when the block responsible is on the page. This does the same when it is the template.
Before:
After:
How?
Claude wrote this:
block-editorcan already tell that the constraint comes from outside the post:useAlignmentConstraintreturnednullin exactly that case. What it cannot do is say what a template is, or navigate to one — those are not its concepts.So the detection stays where it is and the explanation is passed down. A new private setting,
outerWidthConstraintKey, carries a description and an action;packages/editorfills it in, since it is the layer that knows the template. When there is no template, no permission to edit it, or no way to navigate, the setting isundefinedand the menu is unchanged.This is the established shape for handing host knowledge to the block editor —
sectionRootClientIdKey,mediaEditKeyandopenMediaEditorModalKeyall pass data or callbacks the same way. It keeps the layering honest:block-editornever learns what a template is, and being private, it does not become API anyone depends on.Two details worth calling out:
No new UI. The menu already renders a
constraintwith a description and an action, from #82607. This only supplies a second source for one, so the two cases are the same affordance rather than two designs that happen to look alike.The shared-edit warning is raised here too. Navigating to a template from the Template panel, the template actions panel, or the classic-theme equivalents all dispatch "Editing template. Changes made here affect all posts and pages that use the template." That notice belongs to each call site rather than to
onNavigateToEntityRecord, so leaving from this menu would otherwise have dropped it silently. Same string, same preference gate.Testing Instructions
You need a block theme whose template limits width — the simplest is to switch off "Inner blocks use content width" on the Content block of the Pages template.
Please also confirm it stays quiet where it should:
Testing Instructions for Keyboard
Use of AI Tools
Claude Opus 5.