You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improve the DocumentBar post type label for the Homepage and Posts Page cases #66320
#65170 added a 'post type label' to the DocumentBar and removed the type icon to provide a clearer information about the object being edited. So far so good. Screenshot:
There are at least two edge cases though where other parts of the UI use a special label for the object being edited: The 'Homepage' and 'Posts Page' pages.
In this cases, while the DocumentBar still says just 'Page', the PostCardPanel in the Settings panel adds a more specific label to these special pages.
As such, users see two inconsistent pieces of information, which is confusing, and may think something is going wrong.
Screenshots:
I'd suggest to provide a consistent information and make the Document Bar handle these special cases by providing a consistent label:
Homepage
Posts Page
Step-by-step reproduction instructions
Go to the wp-admin Reading Settings.
Set your homepage to display a static page.
Set a Posts page.
Go to the Site editor > Pages.
Select either the page used tor the homepage or the one used tor the posts page.
Observe the Document Bar label is 'Page'.
Observe the Post card in the settings panel uses a more specific label: 'Homepage' or 'Posts page'.
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Hi @afercia, I have raised the potential PR to fix the hardcoding, however I noticed that data-views are in whole different package, which could not be used inside another package. So I had prevent updating the post fields component, and updated post-card-panel and document bar to resuse the same logic to display the badge.
Activity
afercia commentedon Oct 22, 2024
Noting that the PostCardPanel uses some hardcoded checks to determine the label based on
isFrontPageorisPostsPage.A similar check is in place in usePostFields, which is is used in the data views posts list:
Instead of hardcoding a new, third check I'd suggest to explore how to abstract this logic into a small utility and reuse it where needed.
hbhalodia commentedon Oct 23, 2024
Hi @afercia, I have raised the potential PR to fix the hardcoding, however I noticed that
data-viewsare in whole different package, which could not be used inside another package. So I had prevent updating thepost fieldscomponent, and updatedpost-card-panelanddocument barto resuse the same logic to display the badge.Thank You,