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

Implement undo/redo in the widgets customizer #30400

Closed
kevin940726 opened this issue Mar 31, 2021 · 7 comments · Fixed by #31653
Closed

Implement undo/redo in the widgets customizer #30400

kevin940726 opened this issue Mar 31, 2021 · 7 comments · Fixed by #31653
Assignees
Labels
[Feature] Widgets Customizer Ability to add and edit blocks in Customize → Widgets. [Status] In Progress Tracking issues with work in progress [Type] Task Issues or PRs that have been broken down into an individual action to take

Comments

@kevin940726
Copy link
Member

Implement undo/redo as shown in #27343 (comment).

Customizer.Block.Editor.for.Sidebars.mp4
@kevin940726 kevin940726 added [Type] Task Issues or PRs that have been broken down into an individual action to take [Feature] Widgets Customizer Ability to add and edit blocks in Customize → Widgets. labels Mar 31, 2021
@noisysocks
Copy link
Member

noisysocks commented Mar 31, 2021

Not sure that we should prioritise this. In my mind it wouldn't make sense to add undo/redo to only the Widgets section of the Customizer. I'd instead expect undo/redo to work throughout the Customizer.

I'd prefer that we punt this out of the v1 product that we launch and implement it properly throughout the Customizer some time in the future.

cc. @shaunandrews

@critterverse
Copy link
Contributor

Just wanted to chime in to say that I think we should try to include the undo/redo feature in v1 if possible, since these actions are primary functionality that many people rely on in the editor. I worry that the user experience will suffer/be confusing without being able to do this!

Agree that it would be nice to have this functionality across the whole Customizer but it does seem especially important for the launch of the Widgets screen.

@noisysocks
Copy link
Member

@kevin940726: Any ideas on how to implement this?

Unlike the Widgets screen, we aren't using core-data entities which means we don't get undo/redo "for free".

Ideally the undo tree would be stored close to the source of truth is which is the wp.customize changeset.

@kevin940726
Copy link
Member Author

I'm thinking maybe we should do this in useSidebarBlockEditor and store the tree in React though. React should make it easier to implement this feature, and some logics could probably be reused from core-data.

@celloexpressions
Copy link

There is some history of exploring undo/redo in the customizer globally. It would be best to implement this functionality throughout the customizer so that widgets inherit that functionality, instead of only building it out for widgets. I also think adding block editing in the customizer greatly increases the need for undo/redo.

There are two types of undo/redo: step-by-step during editing and batched revisions. Step-by-step seems like the first priority, and batched revisions would be a great future enhancement (also with a goal to bring that feature to site/template editing in the future).

This is the core ticket for granular undo/redo (note it was originally for a global "reset" button that I still wouldn't support). It includes designs and proposed technical implementation details from a few years ago: https://core.trac.wordpress.org/ticket/21666

This is the core ticket for batched revision management. The underlying technical framework (customize changesets) is already in place (same as the draft and publish features). We "just" need to develop UI to browse revisions. This feature could have a huge usability upside relative to development effort given the amount of backend work already in place. It would likely be straightforward to show a given revision in the customize preview in addition to diff-style changesets.
https://core.trac.wordpress.org/ticket/31089

@noisysocks
Copy link
Member

Thanks for the links @celloexpressions.

Step-by-step seems like the first priority, and batched revisions would be a great future enhancement (also with a goal to bring that feature to site/template editing in the future).

Agreed.

@kevin940726
Copy link
Member Author

#30654 just got merged, which should pave the way for the step-by-step undo/redo feature. The core functionality is already there, we just need to implement the UI and improve the performance if needed.

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Widgets Customizer Ability to add and edit blocks in Customize → Widgets. [Status] In Progress Tracking issues with work in progress [Type] Task Issues or PRs that have been broken down into an individual action to take
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants