Problem/Motivation

Buttons in the Views UI wrap oddly. They overlap each other or fail to wrap to the next row properly. The markup for the buttons is not handled consistently, with some markup added by a theme (but not all themes) and some added by the module.

Proposed resolution

The problem is in the CSS, so the solution involves revising the styles applied in the Views UI module. The Seven theme adds a tabs__tab class to the markup. Classy and Bartik themes do not. By eliminating use of tabs__tab in the UI stylesheet, we can avoid potential issues caused when a theme does not apply the tabs__tab class to these buttons.

Remaining tasks

Review the patch

User interface changes

None.

API changes

None.

CommentFileSizeAuthor
#55 2307227-views-UI-layout-button-wrapping-beta14-expected.png211.86 KBcharles belov
#55 2307227-views-UI-layout-button-wrapping-beta14-actual.png189.51 KBcharles belov
#54 classy-wide-no-errors.jpg124.34 KBjimsmith
#54 classy-narrow-no-errors.jpg62.15 KBjimsmith
#54 bartik-narrow-no-errors.jpg73.16 KBjimsmith
#54 bartik-wide-no-errors.jpg109.05 KBjimsmith
#54 seven-wide-no-errors.jpg113.27 KBjimsmith
#54 seven-narrow-no-errors.jpg61.46 KBjimsmith
#49 views-tabs-after-applying-patch.png44.12 KBmanjit.singh
#49 views-tabs-before-applying-patch.png48 KBmanjit.singh
#46 buttons-in-views-ui-wrap-2307227-46.patch1.92 KBjimsmith
#45 not-aligned.jpg36.87 KBjimsmith
#43 buttons-in-views-ui-wrap-2307227-43.patch1.17 KBjimsmith
#43 before-after.jpg54.06 KBjimsmith
#42 Screen Shot 2015-05-15 at 1.02.01 PM.png53.58 KBmu5a5hi
#36 buttons-in-views-ui-wrap-2307227-36.patch2.78 KBmanjit.singh
#32 2307227-31-bartik-after.png106.52 KBidebr
#32 2307227-31-seven-after.png160.21 KBidebr
#31 views-ui-tabs-2307227-31.patch2.82 KBemma.maria
#23 views-ui-tabs-2307227-23.patch1.99 KBandybroomfield
#18 views-ui-tabs-2307227-18.patch2.7 KBlewisnyman
#18 Screen Shot 2014-12-18 at 22.52.54.jpg369.19 KBlewisnyman
#18 Screen Shot 2014-12-18 at 22.52.42.jpg366.07 KBlewisnyman
#17 Archive__Content____drupal8_localhost_and_node_html_twig.png40.89 KBemma.maria
#16 2307227 beta-3 plus patch 15.png127.98 KBcharles belov
#15 2307227-15.patch1.26 KBrpayanm
#15 2307227-interdiff.txt407 bytesrpayanm
#14 872_after.png248.82 KBemma.maria
#14 872px_before.png39.79 KBemma.maria
#14 Chrome_OSX_680px.png46.22 KBemma.maria
#14 Chrome_OSX_555px.png45.71 KBemma.maria
#14 Chrome_OSX_437px.png50.94 KBemma.maria
#13 2307227-9-views-buttons-wrap-oddly-12.patch1.44 KBBoaah
#13 Bildschirmfoto 2014-12-04 um 12.08.37.png137.61 KBBoaah
#11 Screen Shot 2014-11-27 at 16.11.59.png299.95 KBemma.maria
#11 Screen Shot 2014-11-27 at 16.06.06.png134.93 KBemma.maria
#10 2307227-9-views-buttons-wrap-oddly-10.patch1.33 KBlewisnyman
#10 Screen Shot 2014-11-09 at 15.35.29.jpg565.91 KBlewisnyman
#9 2307227-9-views-buttons-wrap-oddly.patch1.72 KBamitgoyal
#6 Screen Shot 2014-09-07 at 15.30.23.png39.1 KByvesvanlaer
#6 2307227-6-views-buttons-wrap-oddly.patch1.68 KByvesvanlaer
#1 2307227-views-UI-layout-button-wrapping-v3.png96 KBcharles belov
#1 2307227-views-UI-layout-button-wrapping-v2.png97.18 KBcharles belov
#1 2307227-views-UI-layout-button-wrapping.png97.17 KBcharles belov

Comments

charles belov’s picture

charles belov’s picture

Issue summary: View changes
nod_’s picture

Version: 8.0-alpha13 » 8.0.x-dev
Issue tags: +frontend, +CSS, +JavaScript, +mobile
charles belov’s picture

I'm not sure why the Mobile tag was added. This particular issue is from a desktop.

nod_’s picture

Oh mobile tag because they're the guys you want when something looks bad on a smaller screen.

yvesvanlaer’s picture

Status: Active » Needs review
Issue tags: +DUGBE1409
StatusFileSize
new1.68 KB
new39.1 KB

Hey all

I added a patch which will make the buttons bar responsive.

lewisnyman’s picture

Status: Needs review » Needs work

I was going to test this but it needs a reroll.

+++ b/core/themes/seven/css/style.css
@@ -359,7 +359,6 @@ li.tabs__tab a {
 .tabs.secondary .tabs__tab {
-  display: block;
   padding: 5px 15px 5px 16px;

This looks like it's going to affect tabs across the whole site?

lewisnyman’s picture

Issue tags: +Needs reroll
amitgoyal’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new1.72 KB

Reroll of #6.

lewisnyman’s picture

I rerolled this patch and removed the line changed that affects tabs globally and it seems to work:

emma.maria’s picture

Title: Buttons wrap oddly and overlap » Buttons in Views UI wrap oddly and overlap
Status: Needs review » Needs work
Issue tags: +Novice
StatusFileSize
new134.93 KB
new299.95 KB

The solution in this patch does not work, the list items in the tabs definitely need the float that has been removed. They are all stacking right now no matter what screen width.
See screenshot...

I tested adding the float: left back in within the browser and it looks good...

Small update to the patch needed, tagging the issue with Novice.

Boaah’s picture

Assigned: Unassigned » Boaah
Boaah’s picture

Assigned: Boaah » Unassigned
Status: Needs work » Needs review
StatusFileSize
new137.61 KB
new1.44 KB

This patch should fix the Problem.

image

emma.maria’s picture

Status: Needs review » Needs work
StatusFileSize
new50.94 KB
new45.71 KB
new46.22 KB
new39.79 KB
new248.82 KB

This looks much better now, the Page/block buttons now have the behaviour you expect.

I tested IE9, FF - Windows & OS X, Safari OS X and Chrome - Windows & OS X.
I found no differences between browsers and operating systems so here are my Chrome OS X screenshots at various widths where the bottoms drop into new rows...



However the only problem I now see is that at various points the "Edit.." button and the "Add +" button overlap at every instance when the buttons wrap onto another line, see below.


The two buttons overlap as they are both positioned absolute and their margins are taken out of context from everything around them. So if we adjust the Views display buttons this fixes this easily. See below.

Existing styles:

.views-displays .tabs.secondary {
margin-right: 240px;

change to

.views-displays .tabs.secondary {
margin-right: 265px;


At the same width the buttons now look like this...

This occurs at every instance the buttons wrap (I have a lot more screenshots if needed? But the one fix suggestion above fixes all of them).

After this fix is added I see no more bugs to be fixed from a visual standpoint.

rpayanm’s picture

Status: Needs work » Needs review
StatusFileSize
new407 bytes
new1.26 KB

Please review.

charles belov’s picture

StatusFileSize
new127.98 KB

Patch 15 is technically correct. I would have hoped that it wouldn't leave all that blank space.
Only local images are allowed.

emma.maria’s picture

Status: Needs review » Needs work
StatusFileSize
new40.89 KB

@Charles Belov That is how the code works unfortunately. The +Add and Edit button are taken out of context as they are positioned absolute to other elements and a margin was added to the right of the View items buttons to allow for the spacing of the +Add and Edit buttons, so you end up with this on mobile.

But this section does not look broken at all now and I think this is the least of anyone's worries if you are adding/editing Views on a mobile device :)

Only local images are allowed.

However the one thing no one has picked up on yet are the RTL styles! Things look very broken right now when the site is set to RTL. The RTL styles need to be added in the CSS please.

lewisnyman’s picture

Status: Needs work » Needs review
StatusFileSize
new366.07 KB
new369.19 KB
new2.7 KB

Ok wow. I tried to figure out what the problem was but this CSS is a complete puzzle. There's too much CSS overriding other CSS in other files and some that just does nothing at all. Really frustrating.

I rewrote the patch from scratch and started by just deleting stuff. Seems to work well now.

Status: Needs review » Needs work

The last submitted patch, 18: views-ui-tabs-2307227-18.patch, failed testing.

sivaji_ganesh_jojodae’s picture

Status: Needs work » Needs review

Requesting for retest.

andybroomfield’s picture

Assigned: Unassigned » andybroomfield
Status: Needs review » Needs work
Issue tags: +Needs reroll

I tried to apply the patch, however it failed to apply.

Going to reroll.

andybroomfield’s picture

Assigned: andybroomfield » Unassigned
Issue tags: -Needs reroll
StatusFileSize
new1.99 KB

Rerolled Patch

emma.maria’s picture

Status: Needs work » Needs review
lewisnyman’s picture

Status: Needs review » Needs work
  1. +++ b/core/modules/views_ui/css/views_ui.admin.theme.css
    @@ -444,6 +444,7 @@ td.group-title {
    +<<<<<<< HEAD
     .views-display-top .secondary > li {
       margin-right: 6px; /* LTR */
       padding-left: 0; /* LTR */
    @@ -454,6 +455,8 @@ td.group-title {
    
    @@ -454,6 +455,8 @@ td.group-title {
       padding-right: 0;
     }
     
    +=======
    +>>>>>>> applying patch views-ui-tabs-2307227-18.patch
    

    Looks like the remains of the reroll are still in here. Also this reroll seems to be missing a lot of the changes from before. I will try and reroll it again

lewisnyman’s picture

Status: Needs work » Needs review

Actually the patch in #18 still applies. Weird

The last submitted patch, 18: views-ui-tabs-2307227-18.patch, failed testing.

emma.maria’s picture

Status: Needs review » Needs work

#18 does not apply anymore.

Patch in #23 applies but needs work to remove leftover reroll git conflict messages as stated in #25.

lewisnyman’s picture

Issue tags: +Needs reroll

It looks like #23 is missing a few changes in #18. Let's reroll 18

emma.maria’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new2.82 KB

Patch in #18 rerolled. I diffed between my new patch and the one in #18 and it found no differences.

idebr’s picture

Issue summary: View changes
Status: Needs review » Needs work
StatusFileSize
new160.21 KB
new106.52 KB

There is still some inconsistent wrapping taking place in Seven as well as Bartik. This might be caused by the red border for displays with unsaved changes that I don't see in previous screenshots in this issue.

lewisnyman’s picture

@idebr Ah good catch, I guess it's because the border is bigger, which makes every unsaved tab a different size to the first one?

copaingeorge’s picture

I'm working on it, for the Drupal Dev Days 2015. I am mentored. I'll try to do my best for my first time.

cilefen’s picture

Issue tags: +Needs reroll
manjit.singh’s picture

StatusFileSize
new2.78 KB

Re-rolling a patch #31

@emma.maria you have changed the

margin-left: 200px;
margin-right: 0;

to

margin-right: 0;
margin-left: 200px;

Also

left: 12px;
right: auto;

to

right: auto;
left: 12px;

in views_ui.admin.theme.css

Why is it so ? Is it due to [rtl] ?

manjit.singh’s picture

Status: Needs work » Needs review
lewisnyman’s picture

@Manjit.Singh It looks like any changes between #18 and #31 would be unintentional.

disasm’s picture

Lets get the screenshots added to the issue summary and clean it up a bit. Lets also list remaining tasks for this issue in the issue summary.

googletorp’s picture

Issue tags: -Needs reroll
jimsmith’s picture

I reviewed this issue and then attempted to test the problem. Before applying a patch I could not duplicate the problem of overlapping buttons. There were still some positioning inconsistencies depending on browser width.

I then applied patch #36, but I couldn't find any differences the patch made.

Perhaps other changes were made in a different issue that affected this?

mu5a5hi’s picture

Issue summary: View changes
StatusFileSize
new53.58 KB

Viewed in Chrome/Mac OS Mavericks, and IE11/Windows 8.1, before and after applying patch #36

Before patch: vertical space between button was inconsistent. seemed to be related to css padding on the 'active' button. Also caused 'INDENT' from the left of your active button was not the first one. Inconsistent. I was not able to duplicate -overlapping- buttons in these two browsers.

After Patch: Both systems/browsers showed a whole line for each button.

https://www.drupal.org/files/issues/Screen%20Shot%202015-05-15%20at%201....

jimsmith’s picture

StatusFileSize
new54.06 KB
new1.17 KB

The attached patch cleans up the positioning inconsistencies in the buttons.

lauriii’s picture

Status: Needs review » Needs work

Setting for needs work since we still need issue summary update.

jimsmith’s picture

StatusFileSize
new36.87 KB

The patch I submitted needs work too. The Add button does not properly align in Bartik and Classy.

jimsmith’s picture

Status: Needs work » Needs review
StatusFileSize
new1.92 KB

The markup for the buttons is not handled consistently. The Seven theme applies the tabs__tab class to all buttons except "add". For that, the add class is added. The Classy and Bartik themes do not use the tabs__tab class.

Because different themes may insert their own classes, but we wish for consistent positioning, I have removed CSS references to tabs__tab.

The attached patch makes the display nice and tidy regardless of admin theme. I am marking this "needs review" to trigger the testbot, but will then reset to "needs work" because #44 still applies.

jimsmith’s picture

Status: Needs review » Needs work

Resetting to "needs work" until the summary is updated.

jimsmith’s picture

Issue summary: View changes
Status: Needs work » Needs review

The summary has been updated.

manjit.singh’s picture

I have tested a patch manually in views (bartik theme). seems fine.

views-tabs-before-applying-patch

views-tabs-after-applying-patch

RavindraSingh’s picture

Assigned: Unassigned » RavindraSingh
Issue tags: +SrijanSprintDay

Reviewing this issue at SrijanSprintDay

RavindraSingh’s picture

Assigned: RavindraSingh » Unassigned
jimsmith’s picture

Status: Needs review » Postponed

The patch at #46 no longer applies.

Additionally, while testing the Views menu with the latest updates I did not see evidence of the previous problems. They must have been fixed in the course of fixing other issues, as some of the changes contained in #46 were found.

I am marking this postponed. Not being a regular core contributor, I'll leave this issue for someone else to close, but it looks to me as though it can be.

emma.maria’s picture

Status: Postponed » Needs review

@JimSmith We do not set issues to Postponed based on not being able to replicate them.
We usually post screenshots showing that there is no longer a problem and mark the issue as 'Closed (cannot reproduce)'. Also if you can find the issue that fixed this issue in the process (sometimes not possible due to this being fixed indirectly by another issue) that would be great also.

jimsmith’s picture

@emma.maria Thanks for the advice. I recognize that Postponed mis-identifies the status of the issue. As I noted, I was not comfortable setting the issue to Closed (cannot reproduce). I felt it best for now to leave that to someone who is a regular core contributor, just as it is bad etiquette to close a contrib issue when you are not the maintainer of that project. I was merely trying to bring attention to the fact that it can be closed. At any rate, I understand what you are saying and thank you.

I attempted to find the issue that fixed this, but as you noted, it is difficult. I gave up after spending about 30 minutes on that last night and another 15 minutes today. Though I was unable to find a specific issue that fixed it I carefully tested all core themes and did not find the same problems noted when this issue was created.

I have now added screen grabs showing a test views admin page containing several view displays. There are two versions of each of the three core themes set for the administration theme, showing a wide and narrow viewport.

See:

charles belov’s picture

I can confirm that the issue I originally reported is no longer happening in beta 14. The layout aggressively wraps to the next row when it doesn't need to, but at least does no harm (that is, nothing is obstructed). The obstruction that is happening in the attached image (beta 14 actual) appears to be outside of the scope of the current issue, and I will file a separate issue for that obstruction.

I've also attached a mockup of what I would have expected as a solution to this issue (beta 14 expected) but (1) that might be a separate issue and (2) it is more of a nice to have than the necessity the original issue was when I originally reported it.

For people trying to reproduce this, I am using Google Chrome on Windows 7 with the Windows Display control panel set to 150%. At some point in the past year or so, Chrome started reflecting this setting and displays fonts larger automatically.

emma.maria’s picture

Status: Needs review » Closed (cannot reproduce)

As two individuals have pointed out that they cannot reproduce this issue anymore, I am closing this issue.