Revisions: Clarify revision comparison and restore states - #12574
Revisions: Clarify revision comparison and restore states#12574Sukhendu2002 wants to merge 5 commits into
Conversation
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
| font-weight: 600; | ||
| } | ||
|
|
||
| .comparing-two-revisions .diff-meta-to strong { |
There was a problem hiding this comment.
why are these styles removed? did you test comparing two revisions against each other? (the comparing-two-revisions class)
There was a problem hiding this comment.
These styles previously hid the From metadata and the To heading outside “Compare any two revisions” mode. They were removed intentionally because this change displays both sides of the comparison in the standard mode as well.
I tested both the standard mode and “Compare any two revisions” mode. In compare mode, both metadata rows and both slider handles remain visible and functional. I have added before/after screenshots below.
Standard mode
Before: From metadata and To heading are hidden.
After: Both From and To metadata are visible.
Compare any two revisions
Before
After: Both metadata rows and slider handles remain available.
There was a problem hiding this comment.
After: Both From and To metadata are visible.
This is not showing from and to, it is showing what was added and removed in the (single) revision.
you can see in your screenshot from and to are the same.
I think you may have been confused about what the default revisions screen shows, which is the changes (diff) for each safe - what was added and removed in that save.
Lets keep the changes to those that address the original issue in the trac ticket.
There was a problem hiding this comment.
ps. See this comment for what I think the user really wanted: https://core.trac.wordpress.org/ticket/61447#comment:3 maybe going immediately to the previous revision or better labeling the "last save" in the UI?
Also, we should consider whether we really need to fix this, since the revisions screen is already being replaced entirely in Gutenberg with a more visual representation that is easier for users to understand.
|
@Sukhendu2002 - I left some questions. It would be great top add some screenshots here to show before and after this change so we can see what it does. |
| fromHandle = handles.first(), | ||
| toHandle = handles.last(); | ||
|
|
||
| if ( isRtl && handles.length > 1 ) { |
There was a problem hiding this comment.
I don't think the revisions screen is loaded when there is only one handle.
There was a problem hiding this comment.
The standard comparison mode does use one slider handle, while “Compare any two revisions” mode uses two. However, you are right that the length check is unnecessary: with one handle, first() and last() refer to the same element, so the RTL swap is a no-op. I have removed the length condition.
Trac ticket: https://core.trac.wordpress.org/ticket/61447
This PR clarifies the Revisions screen so users can more easily identify which versions are being compared and which revision can be restored.
It:
Testing Instructions
Use of AI Tools
AI assistance: Yes
Tool(s): OpenAI Codex
Model(s): GPT-5.6
Used for: Ticket analysis, initial code skeleton, accessibility review.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.