Problem/Motivation

In views when we click add fields. Then there is a type field which is misaligned.

To reproduce bug go to structure->views->content->edit->add fields

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Bug
Unfrozen changes Unfrozen because it only changes CSS to fix a broken admin layout

CommentFileSizeAuthor
#38 fields-ltr.png52.92 KBrteijeiro
#38 fields-rtl.png38.54 KBrteijeiro
#36 Content.png50.25 KBmanjit.singh
#34 interdiff-2296261-31-34.txt415 byteslduerig
#34 2296261-34.patch2.15 KBlduerig
#33 Screenshot 2015-03-28 10.17.30.png89.11 KBlduerig
#33 Screenshot 2015-03-28 10.17.12.png97.12 KBlduerig
#32 interdiff-2296261-31-32.txt1.5 KBlduerig
#32 2296261-32.patch0 byteslduerig
#31 interdiff.txt734 bytesrteijeiro
#31 2296261-31.patch2.03 KBrteijeiro
#28 arabic-after-applying-patch.png88.31 KBmanjit.singh
#28 arabic-before-applying-patch.png92.51 KBmanjit.singh
#28 after-aplying-patch.png80.14 KBmanjit.singh
#28 before-apply-patch.png81.04 KBmanjit.singh
#25 SS-view-type-fields.png59.73 KBsabreena
#24 Screen Shot 2015-02-25 at 7.54.48 PM.png28.92 KBlokapujya
#24 2296261-24.patch2.04 KBlokapujya
#23 Views_add_fields_core_Drupal8_fixed_.png58.53 KBrakesh.gectcr
#22 2296261-21-after.png278.3 KBidebr
#21 interdiff-2296261-21.txt1.16 KBlokapujya
#21 2296261-21.patch1.27 KBlokapujya
#18 2296261-16.patch1.61 KBherom
#16 2296261-16.patch1.27 KBherom
#16 interdiff-2296261-14-16.txt1.44 KBherom
#16 misaligned-type-field-rtl.png9.25 KBherom
#15 interdiff-2296261-7-14.txt1.67 KBGemVinny
#14 2296261-14.patch1.8 KBGemVinny
#13 screenshot.png175.84 KBGemVinny
#11 views-field-type-after.png8.55 KBherom
#11 views-field-type-before.png9.86 KBherom
#10 views-field-type.png251.94 KBrteijeiro
#9 2296261-7.patch1.52 KBGemVinny
#6 2296261-6.patch1.51 KBGemVinny
#4 2296261-4.patch1.46 KBGemVinny
#2 2296261-2.patch404 byteslokapujya
views misalligned field.png130.53 KBnitishchopra

Comments

nitishchopra’s picture

Title: Misalligned type field in Drupal 8.x » Misalligned Type field in Drupal 8.x views
Issue summary: View changes

The type field is misaligned when we add fields in a default view named content.

lokapujya’s picture

StatusFileSize
new404 bytes

This happened in: #1832872: Fix broken Views UI search box/filtering Referencing that issue because it gives some context to this issue.

This patch will put it back closer to how it was. But, better would be to make it responsive so that the form items can all fit on one line, and then stack when there isn't enough space. Ideally, the labels will stay on the same line as the associated form item.

GemVinny’s picture

Assigned: Unassigned » GemVinny
Issue tags: +FUDK
GemVinny’s picture

StatusFileSize
new1.46 KB

Here's a patch for styling.

GemVinny’s picture

Assigned: GemVinny » Unassigned
Status: Needs work » Needs review
GemVinny’s picture

StatusFileSize
new1.51 KB

Changes to make the fields online. Responsive and pixel perfect needs work.

The last submitted patch, 4: 2296261-4.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 6: 2296261-6.patch, failed testing.

GemVinny’s picture

StatusFileSize
new1.52 KB

I have changed RTL as well.

rteijeiro’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new251.94 KB

Now it looks pretty bad-ass. Thanks @lilGemVinny

herom’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work
StatusFileSize
new9.86 KB
new8.55 KB

This is how it looks like for me, and my screen width is 1280px.

I agree this is still an improvement than before, but we might want to do better.

+++ b/core/modules/views_ui/css/views_ui.admin.theme.css
@@ -195,6 +195,11 @@ input.form-radio {
 .container-inline .details-wrapper > * + * {
   padding-left: 4px; /* LTR */
 }
+
+.container-inline > .form-item-override-controls-group {
+  padding-left: 0px;
+}
+
 [dir="rtl"] .container-inline > * + *,
 [dir="rtl"] .container-inline .details-wrapper > * + * {
   padding-left: 0;

That's not a good place to add that. It's between a rule and its RTL version. Move it to after that. Also, the rule you added needs an RTL version too.

Edit: There is also some extra whitespace over the fields, that we can get rid of, i.e. :

#views-filterable-options-controls .form-item {
  margin-top: 0;
}
GemVinny’s picture

Assigned: Unassigned » GemVinny
GemVinny’s picture

Assigned: GemVinny » Unassigned
Status: Needs work » Needs review
StatusFileSize
new175.84 KB

Good point @hermon

I have made your suggested changes.

Does it look any better for you? I have attached a screenshot of what it looks like for me.

GemVinny’s picture

StatusFileSize
new1.8 KB

Here's the patch...

GemVinny’s picture

StatusFileSize
new1.67 KB

Interdiff !!!

herom’s picture

Issue tags: +RTL
StatusFileSize
new9.25 KB
new1.44 KB
new1.27 KB

Thanks. That fixes it for the 1280px screen width.
There was a small RTL issue, and a missing space, that I fixed.
Here's an RTL screenshot:

Status: Needs review » Needs work

The last submitted patch, 16: 2296261-16.patch, failed testing.

herom’s picture

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

oops! wrong patch.

jhedstrom’s picture

Issue summary: View changes
Issue tags: +Needs manual testing

Patch in #18 still applies and resolves the issue in Chrome. This could use verification in a few other browsers I think.

I've added a beta phase evaluation to the issue summary.

lewisnyman’s picture

Status: Needs review » Needs work

The problem with this patch is it makes some major changes to system.module.css which means it could cause regressions everywhere. Can we restrict the changes to just the views ui css?

lokapujya’s picture

Status: Needs work » Needs review
StatusFileSize
new1.27 KB
new1.16 KB

Well, I was surprised to find out that the views-ui CSS doesn't get loaded on the /nojs pages. Is that intentional? See: /admin/structure/views/nojs/add-handler/comments_recent/block_1/field

Search for .css, and most CSS that is in the overlay version, is not on the /nojs page.

Since, the prior patch was only making select box labels into blocks and not the Search field, I assumed that we didn't mean to do change the nojs page and so I further scoped the CSS within ".views-ui-dialog". Although, now that the CSS is in the views-ui it wouldn't affect the /nojs page anyway since the CSS doesn't get loaded anyway.

idebr’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: -Needs manual testing
StatusFileSize
new278.3 KB

I did a manual test for the filters in the 'Add fields' dialog.

  1. The field labeling is inconsistent between fields. For select elements the label is displayed above elements, for textfields the label is displayed inline. Let's place all form element labels consistently.
  2. We abstracted a class .form--inline for this pattern to be applied in #2333719: Abstract Views Exposed Form styling out into a reusable class. Instead of adding more CSS, let's clean up the markup and existing CSS so this pattern can be applied. For an example implementation, have a look at the filter options on /admin/content
rakesh.gectcr’s picture

StatusFileSize
new58.53 KB

@idebr. After applying the patch from https://www.drupal.org/node/2429457
Its look like..add_fields

lokapujya’s picture

Status: Needs work » Needs review
StatusFileSize
new2.04 KB
new28.92 KB

Trying to take the direction suggested by idebr in #22.

sabreena’s picture

Issue summary: View changes
StatusFileSize
new59.73 KB

@lokapujya: Tested the patch (https://www.drupal.org/files/issues/2296261-24.patch) on local, the alignment of fields look good. However spacing between the fields is inconsistent. Attaching a shot.

lokapujya’s picture

What browser were you using? It looks good on Mac Chrome and Firefox.

sabreena’s picture

I am also using Mac(10.9.5) Chrome and Firefox. The attached shot is of chrome (Version 40.0.2214.115).

manjit.singh’s picture

Tested patch locally and attaching some screenshots.

@Sabreena @lokapujya : Fields looks good in Chrome-40.0 (windows 8). But space is inconsistent in Arabic. Please check screenshots for Arabic as well.

lokapujya’s picture

Issue summary: View changes

One possibility is to move the search box to be the last element so that the two dropdowns are next to each other. Then the spacing might not be as much of a concern. If someone else wants to fix the spacing, go ahead; I was only interested in fixing the alignment.

sabreena’s picture

rteijeiro’s picture

StatusFileSize
new2.03 KB
new734 bytes

Just fixed coding standards for arrays.

lduerig’s picture

StatusFileSize
new0 bytes
new1.5 KB

Here's a patch that fixes the spacing, but I never had all fields in one line for RTL either before or after applying previous patches. Using Mac with Chrome. LTR looks fine, but RTL breaks onto two lines for me. Can someone please test this for RTL and verify whether or not fields are breaking onto two lines?

--SEE #34 for patch and interdiff

lduerig’s picture

After patch in #34, this is what I find for LTR vs RTL. RTL was behaving the same before patching.

lduerig’s picture

StatusFileSize
new2.15 KB
new415 bytes

Previous patch was empty. This is replacement for #32.

manjit.singh’s picture

StatusFileSize
new50.25 KB

@lduerig I think fields are still aligned, Please check screenshot captured after applying #34 patch.

rteijeiro’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me!

rteijeiro’s picture

StatusFileSize
new38.54 KB
new52.92 KB

Provided screenshots

Fields LTR

Fields RTL

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

CSS is not frozen in beta. Committed 2004f74 and pushed to 8.0.x. Thanks!

  • alexpott committed 2004f74 on 8.0.x
    Issue #2296261 by GemVinny, lokapujya, lduerig, herom, rteijeiro:...

Status: Fixed » Closed (fixed)

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

martin107’s picture

This issue inserted bug.

https://www.drupal.org/node/2472751