-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Patterns: Add renaming, duplication, and deletion options #52270
Patterns: Add renaming, duplication, and deletion options #52270
Conversation
@kevin940726 you might have some insight around the keyboard delete functionality. Do you think we need to replicate something similar for the rename and duplicate options, or should we explore the change suggested in #52253 to switch the listbox/options approach with a simple list? |
The addition of further options to the pattern dropdowns was raised in #52009. If I'm understanding that discussion correctly, the solution proposed there is to replace the "delete" shortcut with a shortcut that opens the actions menu. Perhaps we could implement that as a follow-up to this PR, in the interests of making the deadline for the next beta? |
Size Change: +1.16 kB (0%) Total Size: 1.42 MB
ℹ️ View Unchanged
|
Flaky tests detected in fee8340. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5483162145
|
Thank you for the great feedback @jameskoster 👍 I've pushed a range of changes that include:
Here's the current state of the PR now: Screen.Recording.2023-07-05.at.6.29.02.pm.mp4A few things to note:
If you're happy with the new direction, I can polish up this PR tomorrow and aim to get it merged this week. |
✅ 🎉
When duplicating a theme pattern, being redirected to "My patterns" is perhaps a little heavy-handed. Could try displaying a confirmation Snackbar saying something like "'Pattern name (copy)' added to my patterns", potentially with an action to "View my patterns"? A confirmation snackbar would probably make sense for all duplications. It could include an "Edit pattern" action.
Duplicate names seems like something to avoid generally. But I noticed you can reuse existing names when creating a pattern manually too, so perhaps it's something to address separately?
Yes probably. Perhaps instead of "Are you sure you want to delete this pattern/template part" we could say "Are you sure you want to delete 'pattern name'?"
It needs more reviewers, but I'm pretty happy with the overall direction here. |
Appreciate the continued feedback @jameskoster 🙇 I've made the suggested tweaks, which include:
These patterns leverage the Given existing reusable blocks can potentially have duplicate names, retroactively enforcing uniqueness might lead to some issues. We might be able to enforce this constraint on new patterns however we'd also have to update the REST API as well. I'm not sure we can address this for 6.3, unfortunately. I'll create an issue and add it to the Patterns tracking issue. Let me know what you think of the current state. I'll get some extra reviews on this tomorrow. |
Thanks for the updates, I think this is working pretty well now. Just a couple of minor points:
If you'd like to simplify, the action could probably just be "Edit". Where names appear in Snackbars I think they should be wrapped in double quotes instead of single. Snackbar position seems to be broken when there are many patterns: snackbar.mp4 |
As per feedback: #52263 (comment)
Thanks for the quick fixes @glendaviesnz, I've just pushed a minor tweak to improve readability. Once the tests are green I'll get this merged so we can iterate further on the a11y side. |
Thank you for keeping keyboard operability into consideration. Yes, I'd say this is one more reason to reconsider the grit/roving tabindex implementation and just use a simple list instead. |
Thanks for the sanity check @afercia 👍 @glendaviesnz is currently working on those accessibility improvements to the patterns list in #52357 and we discussed landing this PR so #52357 could be rebased and take into account the full scope of interactions intended for 6.3. Unfortunately, I'll be unavailable next week, but if you do foresee any problems please create issues and Glen, among others, will be able to take a look. There's also a Patterns tracking issue that they could be added to, to raise awareness. |
Thanks for pointing me at #52357, will follow up there. 🌴 |
I just cherry-picked this PR to the update/beta-4-second-round branch to get it included in the next release: 3e5bc99 |
* Post and Comment Template blocks: Change render_block_context priority to 1 (#52364) * Footnotes: fix lingering format boundary attr (#52439) * Footnotes: Fix incorrect anchor position in Firefox (#52425) * Scope CSS rules for the wp admin reset to js support only. (#52376) * Fix: Patterns & template parts: remove "apply globally" option from block settings (#52160) * Advanced styles panel: add an early return * Update index.js * Minor styling changes * Use array of features --------- Co-authored-by: George Mamadashvili <georgemamadashvili@gmail.com> * make the body of the editor minimmum viewport height so that smaller contents maintain clickability (#52406) * Patterns: Add renaming, duplication, and deletion options (#52270) * Patterns: Update manage pattern links to go to site editor if available (#52403) * [Patterns] Separate sync status into a filter control (#52303) Co-authored-by: Saxon Fletcher <saxonafletcher@gmail.com> Co-authored-by: Glen Davies <glen.davies@automattic.com> * Patterns: Add missing decoding entities processing in Patterns and Template/Parts pages (#52449) * Fix document title icon appearance (#52424) * Quote block: Add transform to paragraph (#51809) * Add ungroup transform as transform to p * Lint * Update test and snapshot. --------- Co-authored-by: Juan Aldasoro <juanfraa@gmail.com> * remove sidebar group descriptions (#52453) * Patterns: alternative grid layout to improve keyboard accessibility (#52357) * add sync tooltip (#52458) * Patterns: Update section heading levels (#52273) * Ensure that the unsaved title is not persisted when reopening the modal (#52473) * Iframe: avoid asset parsing & fix script localisation (#52405) * Iframe: avoid asset parsing & fix script localisation * Add e2e test for script localisation * Update descriptions (#52468) * Footnotes: show in inserter and placehold (#52445) * Footnotes: show in inserter and placehold * Fix placeholder block membrane; fix copy; add icon, label --------- Co-authored-by: Miguel Fonseca <150562+mcsf@users.noreply.github.com> * Fix: Focus loss on navigation link label editing on Firefox. (#52428) * Update tooltip (#52465) * Refactor, document, and fix image block deprecations (#52081) * Refactor, document, and fix image block deprecations * Fix v5 attributes & supports * Fix v1 & v2 deprecation tests * Rename deprecated test descriptions * Respect custom aspect ratio (#52286) * add image width and height via css inline style, update width and height attrs to be string * keep width and height as attributes too, keep the attributes as numbers * updates image fixtures * RichText/Footnotes: make getRichTextValues work with InnerBlocks.Content (#52241) * RichText/Footnotes: make getRichTextValues work with InnerBlocks.Content --------- Co-authored-by: Miguel Fonseca <150562+mcsf@users.noreply.github.com> * Footnotes: save numbering through the entity provider (#52423) * Footnotes: save numbering through the entity provider * Add sup so no styling is needed at all * Migrate old format * Restore old styles, fix nested attribute queries * Fix anchor selection * Migrate markup in entity provider instead * Fix tests * Fix typo * Fix comment --------- Co-authored-by: Miguel Fonseca <150562+mcsf@users.noreply.github.com> * Revert "Post editor: Require confirmation before removing Footnotes (#52277)" (#52486) This reverts commit e6426ea. * List block: Fix selected type option (#52472) * Library - make pattern title clickable (#51898) * Use button inside title * Remove href * Preserve roving tab index * Fix link colors to match trunk $gray-600 * Remove redundant var * Amend colors as per review * remove old files again --------- Co-authored-by: scruffian <ben@scruffian.com> * remove status icon (#52457) * Rename block theme activation nonce variable. (#52398) --------- Co-authored-by: Bernie Reiter <96308+ockham@users.noreply.github.com> Co-authored-by: Ella <4710635+ellatrix@users.noreply.github.com> Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com> Co-authored-by: Andrea Fercia <a.fercia@gmail.com> Co-authored-by: Carolina Nymark <myazalea@hotmail.com> Co-authored-by: George Mamadashvili <georgemamadashvili@gmail.com> Co-authored-by: Andrei Draganescu <me@andreidraganescu.info> Co-authored-by: Aaron Robertshaw <60436221+aaronrobertshaw@users.noreply.github.com> Co-authored-by: Kai Hao <kevin830726@gmail.com> Co-authored-by: Saxon Fletcher <saxonafletcher@gmail.com> Co-authored-by: Glen Davies <glen.davies@automattic.com> Co-authored-by: James Koster <james@jameskoster.co.uk> Co-authored-by: Rich Tabor <hi@richtabor.com> Co-authored-by: Juan Aldasoro <juanfraa@gmail.com> Co-authored-by: Miguel Fonseca <150562+mcsf@users.noreply.github.com> Co-authored-by: Jorge Costa <jorge.costa@developer.pt> Co-authored-by: Alex Lende <alex+github.com@lende.xyz> Co-authored-by: Héctor <27339341+priethor@users.noreply.github.com> Co-authored-by: Petter Walbø Johnsgård <petter@dekode.no> Co-authored-by: Dave Smith <getdavemail@gmail.com> Co-authored-by: scruffian <ben@scruffian.com> Co-authored-by: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com>
Fixes: #51919
Related:
NOTE: This PR still needs some polishing and updates to ensure better a11y
What?
This PR allows for:
Known Issues / Follow Ups
See: #52253
Why?
This improves management options for patterns and template parts and avoids convoluted flows to affect relatively minor changes such as renaming.
How?
Testing Instructions
Testing Instructions for Keyboard
TBA
Screenshots or screencast
Screen.Recording.2023-07-04.at.4.13.46.pm.mp4