Guidelines: Improvements to the UX#76383
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. |
|
Thanks for these updates @aswasif007! These are looking great. We also discussed updating the Edit modal CTA to read "Save guidelines" to match these other updates. |
fditrapani
left a comment
There was a problem hiding this comment.
Thanks for the update! looks good to me!
routes/content-guidelines/components/remove-guideline-confirmation.tsx
Outdated
Show resolved
Hide resolved
routes/content-guidelines/components/guideline-accordion-form.tsx
Outdated
Show resolved
Hide resolved
92ac45a to
2cdefed
Compare
|
Hey @aswasif007, appreciate the work here — the Modal → ConfirmDialog refactor is solid and everything else looks good! One small thought: the { sprintf(
__( 'You are about to remove the block guidelines for the %s block. This can be undone from revision history.' ),
selectedBlockLabel
) }I think that'd be more consistent with how the rest of the codebase uses ConfirmDialog. cc @fditrapani for visibility from the design side. |
|
Thanks @aagam-shah ! If @fditrapani agrees that we can deviate from the design a bit, we can combine it into a single string. |
2cdefed to
721efeb
Compare
routes/content-guidelines/components/guideline-accordion-form.tsx
Outdated
Show resolved
Hide resolved
routes/content-guidelines/components/guideline-accordion-form.tsx
Outdated
Show resolved
Hide resolved
No problem! That should be fine |
- "add/edit block guideline" to "add/edit guideline"
Update guideline -> Save guidelines
721efeb to
f7d9c0a
Compare
|
Thanks @ramonjd and @aagam-shah. I've addressed all your feedbacks! |
aagam-shah
left a comment
There was a problem hiding this comment.
Thanks for working on this and addressing the issue. LGTM 🚢
| onConfirm={ () => { | ||
| // We need to pass an empty string to remove the guideline. | ||
| // This is because the API will only remove the guideline if the value is an empty string. | ||
| handleSave( '' ); |
There was a problem hiding this comment.
Not a blocker but maybe something to look at in a follow up.
handleSave is mostly an async op, right? The ConfirmDialog's isBusy never really shows, because the dialog is closed right away.
Like handleClearConfirm already does we could consider only closing ConfirmDialog when save completes in a finally block, for consistency.
| title={ sprintf( | ||
| /* translators: %s: Guideline category. */ | ||
| __( 'Clear %s guidelines' ), | ||
| slug |
There was a problem hiding this comment.
Another for a follow up.
slug is from GUIDELINE_ITEMS?
slug isn't translated so it's probably better to use the title, otherwise you'll have mixed locales in the same string.
Co-authored-by: aswasif007 <aswasif007@git.wordpress.org> Co-authored-by: fditrapani <fditrapani@git.wordpress.org> Co-authored-by: aagam-shah <aagam94@git.wordpress.org> Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: aswasif007 <aswasif007@git.wordpress.org> Co-authored-by: fditrapani <fditrapani@git.wordpress.org> Co-authored-by: aagam-shah <aagam94@git.wordpress.org> Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
What?
Related issue: #75260
Improves content guidelines UX: adds a reusable remove/clear confirmation modal, uses it for removing block guidelines (from the list and from the edit modal) and for clearing category guidelines, renames the add/edit block guideline modal header, uses default font weight for modal headers, and extracts related CSS into component-level stylesheets.
Why?
How?
RemoveGuidelineConfirmationcomponentNew reusable modal component that accepts a
title(modal header),children(body content),onClose,onConfirm, optionalisBusy, and optionalactionLabel. Used for both "Remove" and "Clear" flows."Clear guidelines" button opens the confirmation modal; on confirm, that category’s guidelines are cleared and saved. Success notice: "Guidelines cleared."
remove-guideline-confirmationand has its own SCSS file.guideline-accordion-form.scssand imported by the form component.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast