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

Revision History: Display "Revision History" item when there has been at least one set of saved revisions #52951

Closed
kathrynwp opened this issue Jul 25, 2023 · 5 comments · Fixed by #52965
Labels
[Feature] History History, undo, redo, revisions, autosave. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Enhancement A suggestion for improvement.

Comments

@kathrynwp
Copy link

What problem does this address?

After saving one set of style revisions, it's not yet clear that there's a revision history available.

Details:

  1. Go to Appearance > Editor
  2. Click into the preview area on the right
  3. Click the Styles icon near the top right

Note the default state of the Revisions icon, it's greyed out:

Blog_Home_‹_Template_Part_‹_Editor_‹_LearnWP_—_WordPress
  1. Make a change in the Styles area (under Typography, Colors, or Layout) and click Save

Note that the Revisions icon is now active (black). Clicking the icon now displays "Reset to defaults":

Blog_Home_‹_Template_Part_‹_Editor_‹_LearnWP_—_WordPress_and_New_Issue_·_WordPress_gutenberg

However, this can be confusing. When I first saw it, I wondered where the new Revisions side panel was, and why it wasn't working.

Once I made and saved another revision, however, I saw that the number "2" appeared in a black square next to a new item "Revision history" – and I then understood that the "Revision history" item would only appear once at least two sets of changes have been saved:

Blog_Home_‹_Template_Part_‹_Editor_‹_LearnWP_—_WordPress

What is your proposed solution?

I think it would be much clearer, consistent, and less confusing to display the "Revision history" item even when there's only been only one saved revision. That will remove any doubt in a user's mind that the revision history panel maybe isn't working.

@kathrynwp kathrynwp added [Type] Enhancement A suggestion for improvement. [Feature] History History, undo, redo, revisions, autosave. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Jul 25, 2023
@ramonjd
Copy link
Member

ramonjd commented Jul 26, 2023

👋🏻

Thanks for filing this issue. It raises a question we grappled with initially, when introducing the revisions feature.

It was a deliberate choice to only show the revisions after two changes. See #50089 (comment)

It's because the initial global style custom post isn't considered a "revision" . So if we reduce the condition to const hasRevisions = revisionsCount >= 1;, there's nothing with which we can compare it

If we reveal the panel with one revision, it would show it fine but we can't interact with it:

Screenshot 2023-07-26 at 4 35 20 pm

An alternative, and I've already tested this, is to show the "reset to default" version as the first revision.

I've thrown up a PR to demonstrate:

#52965

cc @jameskoster with whom we originally chatted about this idea 🙇🏻

@kathrynwp
Copy link
Author

Thanks for the context, @ramonjd .

If we reveal the panel with one revision, it would show it fine but we can't interact with it:

What if clicking that initial revision just did the same thing as "reset to defaults"? That would be quite consistent and less confusing, in my opinion. But maybe there's a technical reason preventing that?

@ramonjd
Copy link
Member

ramonjd commented Jul 26, 2023

What if clicking that initial revision just did the same thing as "reset to defaults"? That would be quite consistent and less confusing, in my opinion. But maybe there's a technical reason preventing that?

Do you mean the initial revision with the first changes, or the "defaults" revision we're adding in #52965?

If the latter, then that's the road we're going down. I think that's consistent.

If the former, I'm not sure that I'd expect to reset styles by clicking on a revision that contains changes different to the theme base 🤔

@kathrynwp
Copy link
Author

@ramonjd Oh yes, I see what you're saying. I think a "Reset to defaults" item as shown in #52965 would definitely serve to avoid the confusion I ran into!

@ramonjd
Copy link
Member

ramonjd commented Aug 3, 2023

Resolved by #52965

@ramonjd ramonjd closed this as completed Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] History History, undo, redo, revisions, autosave. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants