-
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
Add the template title and type to the site hub #46736
Conversation
const entityLabel = | ||
record.type === 'wp_template_part' | ||
? __( 'template part' ) | ||
: __( 'template' ); |
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.
There was a bug in trunk where these strings were not translated.
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.
Couldn't we rely o the post type labels provided by the rest API?
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.
These labels are only available in plural form for all users. If we can reword here to use plural that would work, but let's leave this separate and just keep the bug fix for now.
Nice, this is feeling solid to me. One small issue, the text remains in-editor: I think there's an open question on whether the type or the name should be on top or below, and white or gray. I know @jameskoster has a lot of thoughts on this, and he's AFK for the moment. But I also think we can arguably launch with one set, and then revisit. Similarly, there are some margins and site logo dimensions we can polish, nothing that I think need block this. One thing that I expect we'll want to refine is eliding of text, and how that works for templates with very long titles. I think we can use |
Size Change: +362 B (0%) Total Size: 1.32 MB
ℹ️ View Unchanged
|
Fixed the bug and added the text ellipsis. |
Seems good to me! |
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.
const entityLabel = | ||
record.type === 'wp_template_part' | ||
? __( 'template part' ) | ||
: __( 'template' ); |
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.
Couldn't we rely o the post type labels provided by the rest API?
Good catch @jorgefilipecosta pushed a fix for the breakpoint issue. |
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.
This one is important for #46700. The colors and sequence of title + type we can refine, but this works well as is, with eliding and such.
I'd still like to see a 360px wide sidebar. There's room for it.
e0835ee
to
9d1bdbf
Compare
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.
Works well and the breakpoint issue is fixed 👍
Builds on top of #46700
Related #36667
What?
This PR adds the template title and type to the site hub in the site editor to match the proposed designs.
Why?
These titles and type gives clarity about the entity that is currently being shown on the site editor frame.
How?
useEditedEntityRecord
hook from the DocumentActions component and used it in the site hub to grab the title.SiteHub
component from theLayout
component as it was getting a bit complex.Testing Instructions
1- Open the site editor
2- Navigate templates, template parts...