-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Site Editor Sidebar: Add "Areas" details panel to all templates and update icon #55677
Conversation
Size Change: -2 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
if ( ! templateAreas.length ) { | ||
return null; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While working on this PR, I encountered a bug where only the title "Areas" was rendered even when the template had no template parts. This code is to fix that.
This PR looks fine to me 👍🏻 I'll wait for @jameskoster to take it for a test run. It does bring more attention to the unexpected state of the back button, whereby clicking back from a template area won't return you to the template. This is the current state in trunk however. |
Thanks for the PR, it's working well for me :) My only suggestion would be to use the |
Thanks for the review, @ramonjd, @jameskoster!
Makes sense, I made such a change in 998a75f. Furthermore, there was a lot of unnecessary code left, so I processed it with 5855481. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In terms of design this is looking good. Thanks :)
Sorry for the late reply, I forgot to ship this PR 😅 I updated this PR again with the latest trunk and it still works as intended, so I'd like to merge it as soon as the tests pass. |
Flaky tests detected in 6335b09. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7162518066
|
Closes #54933
What?
This PR adds "Areas" details panel to all templates.
Why?
The "Areas" details panel displays a list of template parts that the current template contains and allows you to quickly access those template parts.
In the current implementation, this panel is included in the
HomeTemplateDetails
component, so it only appears if the template'sslug
ishome
orindex
.However, this panel should not be limited to template types.
How?
I took the code for the Areas details panel contained in
HomeTemplateDetails
and split it out as aTemplateAreas
component. It then renders this component on the sidebar screen of all templates.Update: Additionally, I used the
symbolFilled
icon for general template parts so it matches the one you find in the block toolbar / inspector.Testing Instructions