Problem/Motivation
What is compared is selected on the revision overview.
But on the URL that displays the visual diff, the individual revisions compared are not indicated.
The text "Comparing two revisions:" is also pretty useless in this context.

This is bad UX.
Also, the navigation is unclear, when going back and forth between revisions.
The two-col plugin indicates the revision in the column and we don't want to have too much redundant information.
While we want to have the visual diff as slim as possible, it should still be clear to the user where we are.
Proposed resolution
Remaining tasks
User interface changes
Comments
Comment #2
miro_dietikerAttaching example.
Comment #3
johnchqueshould we add the revision links next to the "Comparing two revisions" text?
Comment #4
johnchqueNot really sure where to place the revision links.
Comment #5
miro_dietikerNow "Comparing:" is redundant, see the text above "Comparing two revisions:" where i'm confused that we don't explain yet what we are comparing in the first place.
The Navigation label is present although there is no navigation.
So, thinking out loud, the reference point (what revisions are compared) belong as much to the navigation as the previous / next links. Since they are in reference to the selected revisions.
So it's more a:
0. "Changes to " Entity/Node title + Breadcrumb
2. "Comparing" X VS Y
3. "Navigation" Prev / Next
4. "Layout" Z / Advanced settings
5. Diff Data
Plus semantically, a navigation doesn't make sense if it is empty. Either remove or provide an empty statement.
Comment #6
johnchqueohhh fyi the navigation label appears in the screenshot because there was another link in the right of the screen, I checked the code and the navigation label doesn't appear when there are no more than two revisions.
Comment #7
drobnjak commentedComment #8
drobnjak commentedEdited weight typos and added values on the missing points (ex. diff display).
Currently weight for the "Comparing" div is 0 and for "Navigation" 1. They should swap but they don't. If "Comparing" weight is set to -1 then they swap the places. Screenshot included.
Comment #9
johnchqueAs discussed remove that extra wrapper for navigation, and things will work magically. :)
Comment #10
drobnjak commentedDone, it is working properly now
Comment #11
drobnjak commentedComment #12
drobnjak commentedComment 10 same as comment 8. I uploaded wrong patch.
Here it is now, with proper patch and working.
Comment #13
johnchquePlease add a white line before and after this. If you can add a comment like: "Show the revisions that are compared." is also good.
Comment #14
drobnjak commentedComment #15
johnchque"." missing at the end of the comment. Please also add a white line before this line.
Comment #16
drobnjak commentedComment #17
johnchqueDon't forget to set it as needs review.
Comment #18
johnchqueLooks nice. Not really sure if the links are fine one below the other. Besides that I would say RTBC.
Comment #19
tduong commentedTested this locally and I've noticed that if a revision is made in few seconds, the time displayed in the link is the same, thus it could confuse the user, but the revision log is also shown there (maybe needs a bit more work).
Usually this kind of page should not display too many info, but I guess it would be better to somehow show the revision log and the "date - time" (as a while link (?)) (?)
PS: @drobnjak, please remember to provide a new screenshot when you have some new UI updates ;)
Comment #20
drobnjak commentedComment #22
tduong commentedI guess you didn't update your branch before :P
Otherwise looks really nice! :)
Comment #23
johnchqueThat is an API change, not sure if we can make it now?
Comment #24
johnchqueDidn't want to change the IS.
Comment #25
johnchqueI was wondering if in the end we should remove the whole revision log since it is used also in the header. That info shouldn't go there. Not sure, would like to know Miro's feedback.
Comment #26
miro_dietikerYeah not sure about this. I will need some time to think about it and find some other references.
Brainstorming:
I quickly proposed that we could rely on the "outside in" pattern to show the navigation, similar to how Google Docs do.
The revision list could only list the two revisions we compare with a button for prev / next above / below each.
Alternatively we could list all revisions with a click handler to set it the "from" and "to" and even remove both prev / next links.
But before doing decisions, and reinventing the weel ourself, we should do proper research:
We should collect revision handling screenshots from common (content creation) applications.
Comment #27
johnchqueIn that case would be better IMHO to place all the navigation things in the outside-in tray :)
Comment #28
miro_dietikerYeah. But it would be optional. So it will be a follow-up and can be post release.
I created #2808623: Use outside-in for diff / revision navigation
We just need to decide what is the simplified minimum gpal for the release.
Comment #29
miro_dietikerComment #30
drobnjak commentedRemoved semi-colon and uploading new patch as @miro_dietiker suggested.
Comment #32
miro_dietikerWe learned in the other issue about mockup, that also the author per revision is relevant.
So we have 3 infos to display: Date, Author, Message
The author is currently missing.
Concatenating them looks bad / unaligned.
Should we use a flex display for this?
Comment #33
drobnjak commentedI added author in the middle between revision date and message since the revision message is much longer than the author name in some cases. They are concatenated now. Implementing flex or columns would be time consuming and since the current navigation will probably move into the sidebar after this issue https://www.drupal.org/node/2808623 , I think it is better to devote time to investigate outside-in possibility to implement it with the diff module before implementing flex or column layout here for the navigation.
Comment #34
drobnjak commentedComment #35
miro_dietikerSo yeah, since the message itself is variable width, it really makes sense to have the revision log last.
Really not sure about the dashes. If a readable separator then we could use " by " like on node/ID/revisions
Comment #36
miro_dietikerAh, and we should make author a link. It always is.
Comment #37
drobnjak commentedAs @miro_dietiker suggested, I implemented flex layout. I also changed author to be a link and did the css adjustments to support different resolutions, tablet and smartphone screens.
Comment #39
drobnjak commentedTest fix
Comment #40
drobnjak commentedComment #41
johnchqueWrong indentation.
Why are you changing the route?
Why this change is needed?
Comment #43
drobnjak commentedResponding to comment #41
1. Indentation fixed
2. Route change happened accidentally while searching through code and it went unseen in the commit
3. When DiffLayoutBase changes were introduced $comment moved position and its value is now "\n " which was changed in the test
New patch uploaded with fixes for the tests
Comment #44
johnchqueHmmm just tested manually, with your changes the header of the Split/Unified fields layout is broken, it basically adds too much space when a revision has a log and the other doesn't. We better need to remove the revision log when using that function on the header of those layouts. I'm not really sure how to fix this, there might be lots of ways. but for sure we cannot allow have the table headers like they are now.
Comment #45
johnchquebtw this cannot be done in this way, better if you change it to type => item and create the elements inside.
Comment #46
drobnjak commentedChanged the code, this time using type -> item
Comment #47
johnchqueThis fixes your problem of array, not really sure if the changes are according with what you wanted to do. please check the markup.
Comment #49
miro_dietikerHm, you set the type to link, but it should only be a link if the user has the permission to access user profiles, see
I tested and the link is always output, even if the user has no permission. That's bad UX.
We should apply a similar pattern like core does it.
Where uid is the entity reference field to the author.
And if you look in more detail it's as simple as an element with #theme => 'username' with #account and the User entity.
It'a not revision VS previous_revision. It's just two revisions compared.
Only \Drupal\diff\DiffEntityComparison::summary uses revision, previous_revision.
The code uses the terms left_revision, right_revision even if it's not visually left / right. Stick to it.
Comment #50
drobnjak commentedSplit revision log creation for visual inline from split fields and unified fields since it was breaking the header and DiffRevisionTest. Changed previous_revision and revision to left and right as it is used in the code.
Uploading a patch now for tests, and if it passes tests and reviews it would be ready to commit. I suggest creating follow up for the 49.1. and access to user profiles.
Comment #51
drobnjak commentedComment #54
drobnjak commentedSmall test fix
Comment #55
johnchqueunrelated change.
Indentation change unrelated.
As suggested, add #access to don't display those elements when the user doesn't have access/enough permissions.
Comment #56
tduong commentedSome more feedback details:
Add a white-space between "//" and your comment.
Here is the general Drupal API documentation standards.
And generally it starts as an "imperative verb".
As mentioned in the previous comments, you will need to wrap this block into an if checking for the "View user information" permission like
$user->hasPermission('access user profiles').And you can do this like in RevisionOverviewForm::buildForm():
Reformat/revert this, as also John said.
Let's do these as two blocks like
to make these line length less than 80 (?)
Comment #57
johnchqueplease, don't forget the # before weight.
Comment #58
drobnjak commentedAdded changes from previous comments. I also provided screenshots for different resolutions.
Comment #59
drobnjak commentedComment #60
johnchqueI actually realized that the css shouldn't be in the general css. Will change it.
Comment #61
johnchqueNow placed the code for be more plugin specific, we don't want to mix functions between layouts ;).
Comment #63
miro_dietikerCommitted... with some comment fix.
But the CSS file needs a rename similar to the plugin name. Plz create follow-up.
Comment #64
johnchqueI also noticed that. Follow-up created.