-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Global Styles: Add link to compare revisions #52829
Conversation
Size Change: +296 B (0%) Total Size: 1.44 MB
ℹ️ View Unchanged
|
Things are working well for me and I agree it would be helpful for some folks to have access to the WP revisions UI. I'm just not sure about the button's position/UI. I guess it depends on how prominent we want things. cc @jameskoster for a learned opinion |
Thanks for the feedback! It'd be very handy if we could pull this kind of data via an API or something. I'll have a quick poke around to see what's available. |
You have the original styles, settings and behaviors object and the revision styles, settings and behaviors object.
I think is possible to compare them and show those changes. This PR was intended as a quick win to have a way to check behaviors, but I can make a POC of that design. |
Oh definitely! 👍🏻 I only wanted to sniff around and see what things like I wonder: with which version would we compare the currently-selected? The previous or the currently-saved? |
I think it compares the currently-saved with the one selected when you click on the revisions list.
Reusing that function would be great! 👍 |
5cf7de0
to
536b417
Compare
536b417
to
5999e19
Compare
Flaky tests detected in 5999e19. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5693207882
|
After spending some time in this issue I found that comparing the styles object in order to get blocks, elements, styles, etc would at least require to work in a comparison engine with 4 or 5 levels deep. It's not trivial, but I think it could be a good addition to the Core, as it would work also to compare different themes I've been checking I will be on parental from next week until October, so I'm afraid I won't be able to keep this PR. But, if we needed an answer, yes, it is feasible, hard though and resource consuming too. @ramonjd I leave up to you the decision on this matter or to the contributors in charge of Global Styles. |
Thanks a lot for spending time experimenting here @c4rl0sbr4v0
Yeah, it seems like it could become non-performant for large changesets. I wonder if we could limit things to the top levels, e.g., In general, I'm happy to let these explorations stew a bit, and allow time for design iterations and more discussion. 🙇🏻 |
I'm closing this experiment @ramonjd It seems there will be new Global Styles Revisions enhancements, and this PR was created as a quick solution for different lightbox animations, which right now are not in the editor any more. Thanks for all the feedback! |
Thanks @c4rl0sbr4v0 I might come back to this to see if we can leverage what you've learned here. I think they'll still be very useful. I appreciate the explorations you've made! |
What?
Add a link to /wp-admin/revisions to compare Global Styles post revisions.
Why?
The current process of checking changes included in each global styles revision is done solely through the Site Editor. Users need to visually inspect the site preview on the left side to identify the modifications. However, since behaviors are only applied on the frontend, it becomes impossible to verify the differences between versions directly in the editor. Additionally, for larger websites, spotting the changes can be challenging.
How?
The quickest solution is to add a link to the existing interface of post revisions. We could in a future implement that view in the site editor canvas.
Testing Instructions
Change styles, settings or behaviors to create revisions.
Go to revisions sidebar, click on one different, use the link.
Testing Instructions for Keyboard
Screenshots or screencast
Link:
Destination:
Video:
https://github.com/WordPress/gutenberg/assets/37012961/72615a37-afa2-413d-9676-0050a29e540b