Skip to content
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

Template Sidebar Panel: Content panel shows even when it is empty #64472

Closed
2 tasks done
carolinan opened this issue Aug 13, 2024 · 11 comments · Fixed by #64569
Closed
2 tasks done

Template Sidebar Panel: Content panel shows even when it is empty #64472

carolinan opened this issue Aug 13, 2024 · 11 comments · Fixed by #64569
Assignees
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") Needs Design Feedback Needs general design feedback. [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@carolinan
Copy link
Contributor

carolinan commented Aug 13, 2024

Description

In the Site Editor, when editing a template and the Template panel is opened in the sidebar, I see an empty Content panel.
Should this empty panel be hidden if there is no Content?

I only see the empty content panel if Gutenberg is active.

Step-by-step reproduction instructions

Activate Twenty Twenty-Four.
Go to Appearance > Editor.
Open the editor, editing for example Blog Home.
Delete the header and footer template parts from the template.
Open the settings sidebar.
Open the Template panel.

Check if there is an empty Content panel.

Screenshots, screen recording, code snippet

site editor template content panel

Environment info

Tested with and without Gutenberg trunk
WordPress 6.6.1.

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
@carolinan carolinan added [Type] Bug An existing feature does not function as intended [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") labels Aug 13, 2024
@shreya0204
Copy link
Contributor

@carolinan I would like to work on this issue.

@Mamaduka
Copy link
Member

@shreya0204, I think this needs design decision/feedback first.

@Mamaduka Mamaduka added the Needs Design Feedback Needs general design feedback. label Aug 13, 2024
@hanneslsm
Copy link

hanneslsm commented Aug 14, 2024

Should this empty panel be hidden if there is no Content?

I don't think so - people could get confused when they cannot find the panel where they would expect it to be.
Instead we could

  1. disable it. I think this state does not exist for panels though.
  2. Add a info text as a placeholder like "Template parts and patterns will be displayed here" or "This template does not have synced content." or "Add synced content to this template by inserting template parts or synced patterns. ".… or so? I'm not a good copy writer.

Makes me think if "Content" is really the best title for the panel, but there was for sure already some discussion about it. ("Synced content" would be a little bit more descriptive, I think)

@carolinan
Copy link
Contributor Author

I like the text suggestions.
It is the extra empty space that shows because the panel is opened / expanded by default that gets me: It makes me think something broke.

@t-hamano
Copy link
Contributor

Whichever approach we choose, I think we should consider consistency with the Design panel:

image

Currently, the Design panel is hidden if no patterns are available:

if ( ! availablePatterns?.length ) {
return null;
}

If a placeholder is appropriate, I think the same approach should be applied to the Design panel.

@shreya0204
Copy link
Contributor

@t-hamano In that case, should I add placeholders for both or hide content panel if no patterns available?

@t-hamano
Copy link
Contributor

@shreya0204 Personally I'm leaning towards hiding the panel itself.

I'd like to hear from the @WordPress/gutenberg-design team as well.

@jasmussen
Copy link
Contributor

I've been thinking about elevating and improving the contentOnly experience which is currently very under-developed (#60021). The origin of the content panel was from that feature. It's also now used for synced patterns with overrides, and template parts. But the panel aside, the goal of it is to make editing the block easy, and if the panel doesn't accomplish that, then it could be worth exploring a different interface. Is that simply surfacing all available controls directly in the panel? Is it something else? Ultimately contentOnly should be about making it easy to edit what's there.

All that is to say, depending on where those explorations might or might not go, we might even look at retiring the content panel in the future, in favor of something better. To that end, I'd support Aki's suggestion that if it's empty, don't show it.

@richtabor
Copy link
Member

richtabor commented Aug 15, 2024

I don't think so - people could get confused when they cannot find the panel where they would expect it to be.
Instead we could

To that end, I'd support Aki's suggestion that if it's empty, don't show it.

I'm +1 for hiding parts of the UI which do not have purpose.

@t-hamano
Copy link
Contributor

Thanks for the feedback!

@shreya0204 I think we could go for an approach where we don't show the Content panel if it's not available.

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Aug 16, 2024
@shreya0204
Copy link
Contributor

@t-hamano Raised PR for the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") Needs Design Feedback Needs general design feedback. [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants