WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 4 months ago

#31088 new enhancement

Post revisions in the customizer

Reported by: adamsilverstein Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Revisions Keywords: needs-patch
Focuses: javascript Cc:
PR Number:

Description (last modified by adamsilverstein)

What about viewing post revisions in the customizer?

This would leverage the existing revisions ui, dropping a slider and next/back buttons into a customizer revisions section. The preview would display the revision in the front-end preview mode (made possible with code from #20299), allowing users to preview and then restore any revision.

props to @jjj for the original idea.

Change History (15)

This ticket was mentioned in Slack in #core by ocean90. View the logs.


5 years ago

#2 @adamsilverstein
5 years ago

  • Description modified (diff)
  • Summary changed from Revisions in the Customizer to Post revisions in the customizer

#4 @DrewAPicture
5 years ago

It's worth asking the question of how that implementation might jive if/when we decide to start revisioning some core post meta. As discussed elsewhere with @adamsilverstein, the system of revisioning/restoring all or nothing right now could easily become even more unwieldy as we move into an era where it's possible to revision other types of data too.

I'd think to make revisions truly powerful we'd want the ability to individually revision and restore pieces of data separate from others. In which case, we'd need to refine the UI anyway. Something to think about.

#5 @westonruter
5 years ago

Ah, so the scope for this issue is specifically for viewing *post* revisions in the Customizer. So #31089 is not a duplicate, since it is about storing revisions of anything registered as a Customizer setting.

If posts were registered as a Customizer settings with a custom type (e.g. post), and if we had revisions of settings in #31089, then we'd potentially introduce a case where there would be two copies of revisions: one in a post revision, and another in a Customizer revision (transaction). So if we did this, we'd probably want the Customizer setting to be a shallow reference to the full data stored in the post revision. For instance, there could be a Customizer setting of type "post_revision" whose value is the post ID for the revision to apply. Then when the Customizer saves, and a Customizer revision/transaction (#30937) is made, the only reference to the post revision is the one ID, not the full post object and postmeta.

By the way, the Customize Posts plugin demonstrates how to register posts as a custom Customizer setting type. The previewing mechanism there could be used to apply a previous post revision to the preview.

#6 @iseulde
5 years ago

  • Version trunk deleted

#7 follow-up: @celloexpressions
4 years ago

One issue I've realized with the current revisions interface is that it's tricky to use for very long posts. I wonder if this might allow us to show a particular post revision in the Customizer preview and put a unified diff relative to another revision under and revision-switching UI in the customizer controls area. Lots of potential to explore here, but we'll definitely need to watch out for confusion regarding post revisions vs. customizer revisions.

#8 in reply to: ↑ 7 @adamsilverstein
4 years ago

Replying to celloexpressions:

One issue I've realized with the current revisions interface is that it's tricky to use for very long posts. I wonder if this might allow us to show a particular post revision in the Customizer preview and put a unified diff relative to another revision under and revision-switching UI in the customizer controls area.

Interesting idea, so you would show the preview in the main pane, and the diffs on the left? How about a mode with a unified view, where diffs where shown with a few lines of context instead of the full document?

#9 @celloexpressions
4 years ago

Yeah, I think it would be interesting to explore the possibilities there. Starting with identifying problems, the lack of rich media previews in revisions and the difficulty of locating changes within lengthy posts are both issues with the current system that this could solve.

#10 @karmatosed
3 years ago

I think it is important to think why this would be more useful to users and do some tests. I'm not totally sold people want to have revisions in the customizer for posts - which I think is what is being suggested. I do however think revisions for their changes in customizer they may want, infact I've seen people wanting that in tests.

What is the background to this? Why is it being suggested? Is it based on user testing? Some need? Would be great to get context and the research - or to get research.

#11 @westonruter
3 years ago

@karmatosed I recall a discussion about how the current revisions interface is too dev-friendly (i.e. a diff view). Applying post revisions to the Customizer preview would allow the user to see what the revision actually looks like when rendered.

#12 @karmatosed
3 years ago

@westonruter interesting. I'm not totally sold myself that putting it into the Customizer does make it non-dev-friendly in itself. Interesting to take a step back and see what the purpose is, what people are using revisions for and where it works for them.

I do think seeing the revision is good. However, I am really not convinced until we test and look at use cases, that putting it in the customizer makes sense. Be great to investigate though and get some research as part of the revisions UI review I'm working on.

#13 @celloexpressions
3 years ago

This could also be made more interesting by the potential to eventually have post editing in the customizer, since there would be a unified interface where you could access revisions without a significant context change from the editor.

#14 @westonruter
3 years ago

Agreed. I also just realized the Customize Posts plugin has an issue filed for this: Integrate with post revisions to preview a revert

#15 @westonruter
3 years ago

Changesets (#30937) will facilitate this feature. See recent comments on https://github.com/xwp/wp-customize-posts/issues/17

#18 @celloexpressions
7 months ago

  • Milestone set to Future Release

Using the customizer for post revision previews (the original proposal of this ticket) remains a feature that would be highly beneficial to most users. The work done on customize changesets in WordPress 4.7 laid the technical foundation for individual post revisions in addition to global site (customize changeset) revisions in the customizer environment.

The customizer is a framework for live-previewing changes to a site. As such, it is the best place to show previews of post revisions, so that users can see the various revisions in the live-previewed context. Post revisions could be integrated with the full customizer or as a more-contextual element that only exposes parts of the UI via a customize panel UI context.

The integration of post revisions with other customizer features, changesets, and the eventual ability to edit content (blocks) directly in the customizer needs further design and technical research as a next step.

Note: See TracTickets for help on using tickets.