-
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
[Site Editor]: Add create pattern button in patterns page #60302
[Site Editor]: Add create pattern button in patterns page #60302
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
8896eb6
to
b8643fe
Compare
Size Change: +4.01 kB (+0.23%) Total Size: 1.75 MB
ℹ️ View Unchanged
|
So excited to see this being worked on! Minor but, for consistency's sake, can we update this to "Add new pattern"? For context: In reading through #58198, it seems like we're trying to move towards "Add new" which this doesn't do as well. As a result, for now, I'd argue for having it as "Add new pattern" and then updating all to "Add new" or whatever is decided upon in the future cc @jameskoster for a confidence check. |
It should probably read "Add pattern"—but I'm also not 100% about this big primary buttons to be honest. It's the same style as the save buttons, in nearly the same position; I think it makes the experience less predictable. And also, do we have a pattern of using a primary button as a popover container? Feels a bit unexpected, as every other primary button is a key action taken, not leading to a post-selection decision. Curious what @WordPress/gutenberg-design thinks as well. |
Based on the discussion in #58198, it seems like "Add new pattern" makes more sense than "Create pattern" following the logic in the core. In that case, should the popover menu items also be unified with "Add new"? As mentioned in ToDo #58198, I think all additional buttons should eventually be replaced with As for the button itself, it looks like its position is slightly shifted upwards compared to other buttons, so we may need to adjust the CSS. |
I updated the button's variant to |
Agree with this. "Add Template Part" gets verbose too, probably in translations too, it doesn't feel the most scalable pattern. |
@jasmussen, I think we need to keep "what" in the button labels. See #58198 (comment) and #58198 (comment). @ntsekouras, I think the label casing should match the other pages. The UX is very different from other "Add New" buttons. Maybe instead of a dropdown, we should display a new pattern modal? |
Buttons/links must have enough context for users. Add New is not good enough for accessibility, it's why we changed all of them in Core. I am good with Add New X or Add X but not just Add or Add New. https://www.w3.org/WAI/WCAG21/Understanding/link-purpose-in-context.html This applies more to links over buttons but I think we should keep the same patterns for UI/UX consistency. Thanks. |
c9c6ea7
to
74f011e
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This should be ready for another round of reviews, based on the updated description of the main issue. I can extract the labels update to remove the |
packages/edit-site/src/components/create-template-part-modal/index.js
Outdated
Show resolved
Hide resolved
Flaky tests detected in a629e26. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9175329171
|
) } | ||
<HStack expanded={ false }> | ||
<AddNewPattern /> | ||
{ !! patternCategory?.id && ( |
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.
I think this menu should move close to the "title" (left of the header) rather than staying on the right no? Anyway, not a blocker.
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.
Nice work here 👍
It would be really nice to use DropdownMenu V2 here (#61094). Fine to do that later/separately if it's not trivial. |
…60302) Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org> Co-authored-by: youknowriad <youknowriad@git.wordpress.org> Co-authored-by: jameskoster <jameskoster@git.wordpress.org> Co-authored-by: annezazu <annezazu@git.wordpress.org> Co-authored-by: richtabor <richtabor@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: alexstine <alexstine@git.wordpress.org> Co-authored-by: afercia <afercia@git.wordpress.org> Co-authored-by: joedolson <joedolson@git.wordpress.org> Co-authored-by: pablohoneyhoney <pablohoneyhoney@git.wordpress.org> Co-authored-by: SaxonF <saxonafletcher@git.wordpress.org>
…60302) Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org> Co-authored-by: youknowriad <youknowriad@git.wordpress.org> Co-authored-by: jameskoster <jameskoster@git.wordpress.org> Co-authored-by: annezazu <annezazu@git.wordpress.org> Co-authored-by: richtabor <richtabor@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: alexstine <alexstine@git.wordpress.org> Co-authored-by: afercia <afercia@git.wordpress.org> Co-authored-by: joedolson <joedolson@git.wordpress.org> Co-authored-by: pablohoneyhoney <pablohoneyhoney@git.wordpress.org> Co-authored-by: SaxonF <saxonafletcher@git.wordpress.org>
What?
Resolves: #59099
Resolves: #58198
This PR adds a
Create pattern
button in patterns page header and uses the same modal for creating patterns/template parts in the sidebar, as suggested here: #58198Testing Instructions
Create pattern
buttonScreenshots or screencast