Skip to content

Improve the DocumentBar post type label for the Homepage and Posts Page cases #66320

Closed

Description

@afercia

Description

#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:

Image

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:

Image

Image

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.

  • Yes

Activity

  1. added
    [Type] Bug
    on Oct 22, 2024
  2. afercia commented on Oct 22, 2024

    @afercia
    ContributorAuthor

    Noting that the PostCardPanel uses some hardcoded checks to determine the label based on isFrontPage or isPostsPage.

    A similar check is in place in usePostFields, which is is used in the data views posts list:

    Image

    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.

  3. self-assigned this
    on Oct 23, 2024
  4. hbhalodia commented on Oct 23, 2024

    @hbhalodia
    Contributor

    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.

    Thank You,

  5. added
    [Package] Editor
    Needs Design Feedback
    on Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Needs Design Feedback[Package] Editor[Type] Bug

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions