-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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: Split the templates list #47841
Conversation
Size Change: +267 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
Flaky tests detected in f583353. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4115567117
|
Note: the two headings 'Customized templates' and 'Default templates' don't necessarily need to be 'big and bold'. While there should be some typography hierarchy, they could also be a bit smaller and light it that's desirable from a design perspective. |
I worry that separate tables will create headaches down the road when we add bulk actions. How would this convention work if you wanted to apply an action to templates across tables? Could a filter be another option? IE a UI to sort the table:
This could be scaled in the future to include filtering by template type, by author, and more. |
I'm not 100% sure there's anything to distinguish 'User-created templates' from 'customized' templates, as it seems to me both have the Regardless, also taking into consideration #42505 / #42555 I'd love to show the 'Actions' column only when needed. For the default templates there shouldn't be an Action column in the first place.
Not sure that would solve the problem. How we communicate in the UI a template is 'custom' when displaying all templates?
Hm, to my understanding, also the available bulk actions would be different depending whether a template is 'custom' or not. For example., the 'delete' action is not available for default templates. |
🤔 The only bulk actions I can imagine us having is |
Nope, it's true this is the status quo. The only other bulk action I can think of that all templates might entertain in the future is exporting, but I acknowledge that exporting specific templates will probably be an edge case. Still, it's an example of a flow that would be made quite awkward by this table split. Another consideration here is how things like filtering and pagination would work. Say I want to see all templates associated with a specific plugin, would I need to filter each table separately? Would pagination be per-table?
Would it be a bad idea to add an 'Edit' action item for default templates?
I feel like there's opportunity to explore more lightweight solutions to this. Instead of the blue dot, perhaps template names are suffixed with "– customized", similar to how we mark drafts in wp-admin list views. Alternatively, would the presence of the "Clear customisations" action be a sufficient indicator on its own (if we were to remove the ellipsis in favor of simply displaying the actions)? Perhaps I am being overly cautious. I'd just like to solve these issues in a way that is compatible with how we might want to scale these list views in the future. |
For reference: this is the issue about the Bulk Actions: #41946 |
Fair enough, I'll close this PR.
I'd like to remind a similar text-based solution was already tried in #42589.
I'm not sure that would be sufficient. Inferring from the context is always a costly operation in terms of cognitive load. Also, it's based on visuals. There wouldn't be any textual information. |
Fixes #42557
Related: #42505 / #42555
What?
As suggested in #42555, a more clear indication of the custom / customized templates and templates parts may benefit from splitting the templates table in two tables.
Why?
Right now, custom / customized templates and templates parts are only distinguished by the other ones by the means of a blue dot and a tooltip that appears only on hover. The blue dot is only visual and it's also a very small target to hover. Teh tooltip is not keyboard accessible. There's no other semantic information.
Splitting the table in two tables, one for the default templates and the other one for custom / customized templates, makes things way cleared and allows to entirely remove the blue dot and tooltip. Headings before the table further clarify what the tables are about.
How?
This PR splits the array of templates in two, based on whether the template source is
custom
. Based on that, it renders two tables conditionally:Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast