Comments

pivica created an issue. See original summary.

pivica’s picture

StatusFileSize
new14.83 KB

First version of patch. Didn't want to change this much but step by step and yeah...

Some notes:

  • Refactored Comparing component to use table CSS rules
  • Added responsive table utility classes and added them for Comparing and main diff table - so stuff now works even for very small screens
  • I'm still not happy how navigation links works - for me it's strange that they are centered for smaller screens, but don't know original idea here so didn't want to change that.
johnchque’s picture

Status: Active » Needs review
StatusFileSize
new40.12 KB

Works really nice! I was just wondering if we really a ellipsis effect for the log message, or maybe we can just cut it. Discussed with @pivica, if we gonna show the log message makes sense to show it all as the patch does (shown in the picture).

Or maybe we would use Js for showing the complete log message when users requires, like when hovering or so.

pivica’s picture

StatusFileSize
new16.97 KB
new3.17 KB
new129 KB
new92.18 KB

Wanted to explore a bit more idea that we use JS code to show/hide revision messages that are bigger then 1 line. I could not find quickly this kind of pattern in Drupal core, so here is implementation with a tag .more-link.

Here is how it looks with new patch:

With more link active:

With less link active:

Note that if we would like to apply this approach then we don't need any more .diff-responsive-table-wrapper wrapper applied for comparing table because it is not overflowing horizontally any more in this case. So lets not forget to remove it if we agree to implement this approach.

Status: Needs review » Needs work

The last submitted patch, 4: ui-code-cleanup-improvements-2822007-4.patch, failed testing.

miro_dietiker’s picture

The "more" link steals an extra line. If we want to go into that direction, it should be part of the first line to stay compact.

Mobile: Agree, the centering is strange and doesn't match anything else. We need a better solution there.

You are applying height calculation / detection, that needs an update on viewport change. Does this now need a reload if the viewport changes?

miro_dietiker’s picture

Ah, the user width seems very limited to me. Real usernames are not always that compact and i fear cutting off at ~10 chars is too low. Let's reserve a little more room.

pivica’s picture

> The "more" link steals an extra line. If we want to go into that direction, it should be part of the first line to stay compact.

Okey will move more to be in line with first line.

> Mobile: Agree, the centering is strange and doesn't match anything else. We need a better solution there.

Hmmm the problem is that we have two type of layouts for navigation for big and small screens. Not easy stuff, at least i would not center nav links for small screens - usual pattern is that prev/next links are aligned left and right with the edge of parent in that case and not center aligned; we can try this and see how it looks. Later we can always try to make it better.

> You are applying height calculation / detection, that needs an update on viewport change. Does this now need a reload if the viewport changes?

Probably yes, didn't want to do more here before we figure will we add more or not. Will add now.

> Ah, the user width seems very limited to me. Real usernames are not always that compact and i fear cutting off at ~10 chars is too low. Let's reserve a little more room.

We are using display: table for this layout so cells will automatically adopt to bigger content. Speaking about this i got idea that for small screens we hide message fully and just leave more link - with this we will get even more room.
But i was not that hard on one line restriction so current CSS will allow date and name to break to multiple lines when there is not enough room, if we want to go with one line thingy for this also i can try couple of stuff with current approach.

johnchque’s picture

I also vote for moving the More to the first line.
Yes, sounds good to place the navigation links to be aligned right / left.
I think one line for smaller screens can be nice, since the screen is small we don't want to have a huge header shown by default.

I have also noticed that the Navigation links don't have the same padding as the links in the comparing element, this looks a bit odd. :)

johnchque’s picture

StatusFileSize
new22.38 KB

The padding used for the navigation links is different from the links of the comparing element:

pivica’s picture

StatusFileSize
new19.4 KB
new8.08 KB

Here is a new patch, some notes about changes:

- Resize event is covered with debounce implementation so performance are not
affected too much.
- More link will work only for comparing items that have message. Line break
is allowed only for message it self, and not other columns.
- For very small screens we hide message fully and show only more link.
- More link is floating to the right so we are not adding one more line for it.

> The padding used for the navigation links is different from the links of the comparing element:

This is also fixed.

The stuff is becoming more and more complex, if we are going to go with this solution i think we should not make stuff more complex because probably we will use outside-in for diff as a better solution for future #2808623: Use outside-in for diff / revision navigation. So if possible lets just tweak stuff little bit more if needed but lets try to stop adding more complexity to current UI.

miro_dietiker’s picture

Huh yeah, that's pretty complex to only show the more / less link for the message...
And most importantly, this wrapping only happens in rare cases as people usually enter short messages.

So really don't know if it is worth adding all this complexity...
Also BTW the key problem is that given the JS code complexity, this kind of functionality also should get (JS driver) test coverage, resulting in an even larger codebase to maintain.

So, the version without more/less link also isn't ready for commit above. What next? :-)

pivica’s picture

Okey had a discussion with Miro about 'more link' problem and we decided to drop the thing completely - its just adding too much stuff and it really try to solve very limited number of cases.
So we will try to keep table display layout for 'Comparing' component and we will not enforce 1 line rule - if revision message is long that probably means that it is important and we do want to show it to user.

So here is a new patch. Some notes about new patch:

  • Comparing component has new responsive behavior for small screens - check attached images how it looks
  • Navigation component behavior is changed a little bit - for small screens we hide label for small screens and put prev/next links left and right, again check the screenshots

And here are the screenshots:

iPhone 6 Plus

iPad

iPad Landscape

Laptop with HiDPI

miro_dietiker’s picture

Status: Needs work » Needs review

Very nice. Those screens look perfectly ready for release.

Let's challenge bot.

  • miro_dietiker committed 4422637 on 8.x-1.x authored by pivica
    Issue #2822007 by pivica, yongt9412, miro_dietiker: Improve frontend...

Status: Needs review » Needs work

The last submitted patch, 13: ui-code-cleanup-improvements-2822007-13.patch, failed testing.

miro_dietiker’s picture

Status: Needs work » Fixed

Committted. Fails are unrelated, see open issues.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.