Skip to content
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

Add "Clear customisations" template action to other views #36303

Closed
Tracked by #41241
jameskoster opened this issue Nov 8, 2021 · 12 comments · Fixed by #41743
Closed
Tracked by #41241

Add "Clear customisations" template action to other views #36303

jameskoster opened this issue Nov 8, 2021 · 12 comments · Fixed by #41743
Assignees
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") Needs Design Feedback Needs general design feedback. [Status] In Progress Tracking issues with work in progress

Comments

@jameskoster
Copy link
Contributor

It's currently possible to reset customisations to a template whilst editing it via the dropdown in the top bar:

Screenshot 2021-11-08 at 13 09 01

We may remove this dropdown in the Appearance Editor (#36207), but it should however still be possible to reset template customisation in this view, so we should explore ways we can make that possible.

One idea would be to add an actions dropdown in the Template tab of the inspector:

Additionally, it may be worthwhile making this action available on the list views at Appearance > Templates and Appearance > Template parts.

Screenshot 2021-11-08 at 13 12 30

@jameskoster jameskoster added Needs Design Feedback Needs general design feedback. [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") labels Nov 8, 2021
@shaunandrews
Copy link
Contributor

shaunandrews commented Nov 8, 2021

Adding a ToolsPanel-like menu to the template sidebar makes a lot of sense to me, and I think it something we'll want to do for posts/pages as well. Here's a mockup that shows how a "..." menu could work for a post:

image

I think this could also make sense in the Block tab as well, allowing you to reset blocks to their defaults and/or saving settings as a new style.

Do you think it'd make sense to try and follow the design language of the ToolsPanel for the menu you've shared? (i.e. Does it need an "Actions" heading, and should it match the width...)

--

I'm not so sure about adding it to the table-view for templates; It seems like a really easy way to accidentally reset a template. I feel like there should be some more friction as I'd expect this to be a destructive action.

@jameskoster
Copy link
Contributor Author

Do you think it'd make sense to try and follow the design language of the ToolsPanel for the menu you've shared?

Certainly 👍

I'm not so sure about adding it to the table-view for templates; It seems like a really easy way to accidentally reset a template. I feel like there should be some more friction as I'd expect this to be a destructive action.

Yeah we can mimic trashing – red link, confirmation notice with undo option.

@mtias
Copy link
Member

mtias commented Jun 15, 2022

There's a parallel flow here which is "Update template with new changes from theme". We had a similar flow for the template property when defining custom post types.

@jameskoster
Copy link
Contributor Author

Unpacking that a little...

  1. You activate AwesomeTheme 1.0
  2. You customize the Page template in the Site Editor
  3. You update to AwesomeTheme 2.0, which includes changes to the Page template

In this case you do not receive the 2.0 updates to the Page template, because your customised version of the Page template that was bundled in 1.0 is being used. However, wouldn't resetting the customizations essentially do the same thing as "update template with new changes from theme"?

Or are you thinking about some kind of diff checker / conflict resolution tool that allows you to update the template and keep your customisations? Seems hard to do that update automatically without some kind of user intervention.

@mtias
Copy link
Member

mtias commented Jun 15, 2022

The wording of "revert to theme" doesn't imply an update or awareness that there is an update. And I am thinking of a merge between updates from the theme and local customizations. We've done some of that for the template update, I believe, in that user content transferred but other things were discarded. It's also an overlapping problem with the idea of pattern transforms, which we also have partially solved by selecting some attributes (text, images, etc) and discarding others.

@jameskoster
Copy link
Contributor Author

OK so it's not just a case of conditionally updating the "Clear customizations" button label :D

The merging sounds fraught with quirks. Updating attributes on existing blocks seems easy enough, but what if I deleted a block entirely, or swapped out a template part? Seems like something to explore in a different issue.

@mtias
Copy link
Member

mtias commented Jun 15, 2022

We can still improve the copy so that it doesn't only imply a setback.

@jameskoster
Copy link
Contributor Author

So we need something more generic that doesn't refer to reversion. Perhaps:

Delete custom template
Use the template as supplied by the theme

would be more versatile than the current

Clear customizations
Restore template to theme default

This would make more sense after theme switches as well.

In the future we can augment this with a merge option, either as a subsequent action, or a dedicated flow.

@ntsekouras
Copy link
Contributor

Hm... Should I reopen and create a quick follow up to update the copy like this?

Delete custom template
Use the template as supplied by the theme

The merging seems quite convoluted and should be a different issue IMO.

@jameskoster
Copy link
Contributor Author

@ntsekouras I think it's worth opening a PR to discuss, if it's an easy one :)

@mtias
Copy link
Member

mtias commented Jun 16, 2022

I think we should open an issue with the ideas for the merging and connect it conceptually to the work we've done in updating patterns and transforming patterns.

@jameskoster
Copy link
Contributor Author

Opened an issue for the merging idea here: #41764

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") Needs Design Feedback Needs general design feedback. [Status] In Progress Tracking issues with work in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants