-
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
Template Editor: Use the label 'Clear customizations' when changes are revertable #40935
Conversation
variant="secondary" | ||
aria-label={ __( 'Delete template' ) } |
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.
The component already has a text label, no need to use the aria.
@@ -32,7 +32,7 @@ export default function TemplateDescription() { | |||
className="edit-post-template-details__description" | |||
size="body" | |||
as="p" | |||
style={ { marginTop: '12px' } } | |||
style={ { marginTop: '12px', marginBottom: '12px' } } |
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.
This fixed "padding" mentioned in the issue :)
Size Change: +357 B (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
Thanks for looking in to this :) Could the button be the same as the one in the Site Editor, IE with the description? I think the description is helpful in this context, otherwise you might think that the "Customisations" refer to unsaved changes to the page itself. |
@jameskoster, sure. I will try to do a follow-up (in this PR) later today or tomorrow. |
2c714b3
to
30b4e26
Compare
Hi, @jameskoster I added the info text and adjusted styles a bit to match the dropdown from the Site Editor. Screenshot |
packages/edit-post/src/components/header/template-title/style.scss
Outdated
Show resolved
Hide resolved
Thanks, @jameskoster.
I was thinking the same but considering some of the differences; I think it's okay to keep them separate for now. |
Appreciate it's probably something to do separately, but they probably shouldn't be different at all, right? |
Delete action is a bit different, and we probably don't want to display the permanent delete action in Site Editor. This can be abstracted, but we also want to avoid early abstractions 😅 |
What?
Resolves #40885.
PR updates the delete button label to "Clear customizations" when changes to a template are revertable (template has theme file). It also makes the button non-destructive for this case.
Testing Instructions
Using TT2
Screenshots or screencast