Template Editor: Use the label 'Clear customizations' when changes are revertable#40935
Template Editor: Use the label 'Clear customizations' when changes are revertable#40935
Conversation
| isDestructive | ||
| isDestructive={ ! isRevertable } | ||
| variant="secondary" | ||
| aria-label={ __( 'Delete template' ) } |
There was a problem hiding this comment.
The component already has a text label, no need to use the aria.
| size="body" | ||
| as="p" | ||
| style={ { marginTop: '12px' } } | ||
| style={ { marginTop: '12px', marginBottom: '12px' } } |
There was a problem hiding this comment.
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