Skip to content

Add a confirmation modal when clearing the customizations on a template #39124

Closed

Description

@hanneslsm

What problem does this address?

The impact on clearing a customization on a template or template part can be huge, especially when you put a lot work in building your templates with the FSE.
However, all the work can be deleted with just one or two thoughtless clicks on the menu:
image

What is your proposed solution?

Add a modal where the user has to confirm that all their work will be deleted. Maybe some additional info text to make clear what impact the clearing exactly has.

Activity

  1. changed the title [-]Add a confirm modal when clearing the customizations on a templae[/-] [+]Add a confirmation modal when clearing the customizations on a template[/+] on Feb 28, 2022
  2. ntsekouras commented on Feb 28, 2022

    @ntsekouras
    Contributor

    I agree that the impact might be big and it could be good to have an extra confirmation step.. --cc @jameskoster @jasmussen @kjellr

  3. jasmussen commented on Mar 1, 2022

    @jasmussen
    Contributor

    Keeping #25071 in mind, it seems okay to add a confirmation dialog. I'd keep it simple, though. Maybe use the new ConfirmDialog from #34153?

  4. jameskoster commented on Mar 2, 2022

    @jameskoster
    Contributor

    Worth noting that when you revert whilst editing the document there is an undo affordance:

    revert.mp4

    We used the undo pattern here for a couple of reasons:

    1. It aligns with other flows in WP like trashing posts
    2. It essentially allows you to "preview" the revert directly on the canvas before fully committing

    Obviously the second point doesn't apply on the template list view, and the first point holds less water generally since we removed the ability to retrieve templates from the trash.

    All that to say: I think it's probably okay to install the confirmation dialog on template list, but we should acknowledge that the revert flow would then differ based on the view. Is it risky to make a high impact action feel unpredictable?

    If we wanted to make reverting consistent, another option might be to make the button itself feel more like a "danger zone" (IE make the link red, to match Trash links), and add the undo action to the Snackbar on list view.

  5. afercia commented on Jul 19, 2022

    @afercia
    Contributor

    Worth mentioning that also when deleting a template (e.g. a custom template) there's no confirmation step. Is there a specific issue for that already?

    Screenshot 2022-07-19 at 13 43 50

  6. hanneslsm commented on Jan 17, 2023

    @hanneslsm
    Author

    I have created a new issue for the missing confirmation when deleting a template.

    I think most of the user do not distinguish between "clear" and "delete". They will lose all their work, no matter what they click, so a similar/same implementation should be used here for both.
    Making the "Clear customisation" buttons red, as for "Delete", is definitely an option.

    @jameskoster re while editing: I think a confirmation step should also be included while editing, not only for consistency but also for good UX.
    Even better would it be, if the Undo affordance would be also implemented in the Template list.

  7. hanneslsm commented on Jan 17, 2023

    @hanneslsm
    Author

    Another random thought: If a modal is implemented, the "Export Theme" function could be linked, so that the user can download a snapshot of the theme before clearing the customisations/ deleting a template.

    Example wording, this must surely be refined…

    Are you sure you want to clear all customisations?

    This action will remove any changes you have made and restore the original settings of the current theme. You can copy all blocks or download the complete theme with all templates and styles beforehand."

    Are you sure you want to delete this template?

    Deleting this template will remove this template. This cannot be undone. You can copy all blocks or download the complete theme with all templates and styles beforehand."

  8. added
    [Feature] Site Editor
    and removed on Jul 24, 2023
  9. added
    [Type] Enhancement
    on Sep 14, 2023
  10. ntsekouras commented on Aug 26, 2026

    @ntsekouras
    Contributor

    Resetting a template shows a confirmation modal for quite some time now (#60119), so this is done. Closing, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] Site Editor[Type] Enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions