Problem/Motivation

Views UI is currently mostly based on styles inherited from Seven.

Proposed resolution

- Create a patch with proposed designs, re-purposing existing styles from other components wherever possible
- Get feedback on the proposed design patch and implement changes based on that.

Remaining tasks

  1. Create a patch with proposed designs
  2. Get approval on the designs
  3. Review for regressions

User interface changes

CommentFileSizeAuthor
#63 Screenshot 2020-10-09 at 6.57.45 PM.png38.98 KBanmolgoyal74
#61 interdiff.txt953 byteslauriii
#61 3066006-61.patch89.18 KBlauriii
#60 interdiff.txt3.47 KBeffulgentsia
#60 3066006-60.patch87.78 KBeffulgentsia
#57 3066006-57_REROLL.patch87.76 KBbnjmnm
#56 3066006-56.patch89.17 KBlauriii
#52 Screenshot 2020-08-28 at 16.41.26.png49.52 KBlauriii
#52 Screenshot 2020-08-28 at 16.41.17.png107.95 KBlauriii
#52 Screenshot 2020-08-28 at 16.39.59.png179.66 KBlauriii
#52 Screenshot 2020-08-28 at 16.39.10.png401.83 KBlauriii
#52 Screenshot 2020-08-28 at 16.36.14.png342.91 KBlauriii
#50 interdiff_47-50.txt896 bytesbnjmnm
#50 3066006-50.patch90.71 KBbnjmnm
#47 3066006-47.patch90.72 KBbnjmnm
#47 interdiff_46-47.txt1.51 KBbnjmnm
#46 interdiff_44-46.txt7.72 KBbnjmnm
#46 3066006-46.patch90.72 KBbnjmnm
#45 misaligned-groups.png17.51 KBlendude
#45 error-claro.png28.69 KBlendude
#45 error-seven.png51.76 KBlendude
#45 field-suffix.png17.08 KBlendude
#45 views-wizard.png20.97 KBlendude
#44 IE11-no-outlines.png111.91 KBbnjmnm
#44 IE11-action-wrap.png209.79 KBbnjmnm
#44 interdiff_40-44.txt14.49 KBbnjmnm
#44 3066006-44.patch86.77 KBbnjmnm
#42 IE11-options.jpg16.5 KBkatherined
#40 3066006-40.patch84.3 KBbnjmnm
#40 interdiff_38-40.txt2.17 KBbnjmnm
#39 views-filter-operator-before.jpg59.29 KBkatherined
#39 views-filter-operator-missing2.jpg51.98 KBkatherined
#39 views-filter-operator-missing.jpg63.55 KBkatherined
#39 views-filter-operator-fixed.jpg58.16 KBkatherined
#38 interdiff_31-38.txt6.87 KBbnjmnm
#38 3066006-38.patch83.02 KBbnjmnm
#35 views_rarrange_filters-extra_and.jpg72.41 KBkatherined
#35 views_rearrange_filters.jpg84.58 KBkatherined
#35 views-filter_not-null_seven.jpg47.81 KBkatherined
#35 views-filter_not-null.jpg65.85 KBkatherined
#35 views-filter_content-published.jpg60.35 KBkatherined
#32 selected_9005.png482.59 KBKondratievaS
#31 interdiff.txt6.86 KBlauriii
#31 3066006-31.patch80.92 KBlauriii
#30 3066006-27-reroll.patch79.04 KBlauriii
#29 After_4.png116.98 KBpriyanka.sahni
#29 After_3.png184.78 KBpriyanka.sahni
#29 After_2.png165.72 KBpriyanka.sahni
#29 After_1.png308.09 KBpriyanka.sahni
#27 3066006-27.patch81.24 KBbnjmnm
#27 interdiff_26--27.patch3.31 KBbnjmnm
#25 3066006-25.patch81.11 KBbnjmnm
#25 interdiff_21-25.txt4.38 KBbnjmnm
#25 Screen Shot 2020-05-20 at 10.47.40 AM.png73.25 KBbnjmnm
#22 selected_8751.png122.51 KBKondratievaS
#21 3066006-21.patch81.61 KBbnjmnm
#21 interdiff_17-21.txt2.43 KBbnjmnm
#20 interdiff_17-20.txt1.54 KBkomalk
#20 3066006-20.patch82.34 KBkomalk
#18 Fixed.png195.84 KBKondratievaS
#18 Bugs.png98.75 KBKondratievaS
#17 3066006-17.patch81.41 KBbnjmnm
#17 interdiff_12-17.txt21.28 KBbnjmnm
#15 Screenshots_OK.zip2.55 MBKondratievaS
#15 selected_8688.png259.93 KBKondratievaS
#12 views-configure-filter.png94.91 KBbnjmnm
#12 views-rearrange-field.png112.98 KBbnjmnm
#12 views-add-field.png141.82 KBbnjmnm
#12 views-general.png257.12 KBbnjmnm
#12 3066006-11.patch68 KBbnjmnm
#10 ViewsUI_Gin_1600.jpg632.27 KBsaschaeggi
#5 6b-delete view.PNG15.7 KBantonellasevero
#5 6a-duplicate-view.PNG12.66 KBantonellasevero
#5 5b-Settings-advanced.PNG31.94 KBantonellasevero
#5 5a-Settings-basic.PNG42.91 KBantonellasevero
#5 4f-individual-view-popup-page pager options.PNG67.68 KBantonellasevero
#5 4e-individual-view-popup-page menu item entry.PNG52.3 KBantonellasevero
#5 4d-individual-view-popup-page style options.PNG46 KBantonellasevero
#5 4c-individual-view-popup-configure sort criteria.PNG89.46 KBantonellasevero
#5 4b-individual-view-popup-configure filter criterion.PNG53.81 KBantonellasevero
#5 4a-individual-view-popup.PNG60.72 KBantonellasevero
#5 3b-individual-view-preview-section.PNG18.42 KBantonellasevero
#5 3a-individual-view-main-display.PNG54.76 KBantonellasevero
#5 2d-views-seven-add-view-error-msg.png29.37 KBantonellasevero
#5 2c-views-seven-add-view-options-displayed.png31.3 KBantonellasevero
#5 2b-views-seven-add-view-options-displayed.png32.63 KBantonellasevero
#5 2a-views-seven-add-view.png38.85 KBantonellasevero
#5 1b-views-seven-home-disabled-table.png80.96 KBantonellasevero
#5 1a-views-seven-home-enabled-table.png86.03 KBantonellasevero
#2 views-ui-current.png101.99 KBckrina

Comments

lauriii created an issue. See original summary.

ckrina’s picture

Issue summary: View changes
Issue tags: +stable blocker
StatusFileSize
new101.99 KB
ckrina’s picture

Status: Active » Postponed

Postponing this until the design is done.

huzooka’s picture

Project: Claro » Drupal core
Version: 8.x-1.x-dev » 8.9.x-dev
Component: Needs design » Claro theme
antonellasevero’s picture

I am attaching a series of screenshots from views in Seven that seem to give an example of different types of layouts and tried to capture all distinct formats. They are attached below numbered 1a through 6d.

Screens include:
1a-views-seven-home-enabled-table
1b-views-seven-home-disabled-table
2a-views-seven-add-view
2b-views-seven-add-view-options-displayed
2c-views-seven-add-view-options-displayed
2d-views-seven-add-view-error-msg
3a-individual-view-main-display
3b-individual-view-preview-section
4a-individual-view-popup
4b-individual-view-popup-configure filter criterion
4c-individual-view-popup-configure sort criteria
4d-individual-view-popup-page style options
4e-individual-view-popup-page menu item entry
4f-individual-view-popup-page pager options
5a-Settings-basic
5b-Settings-advanced
6a-duplicate-view
6b-delete view

saschaeggi’s picture

Assigned: Unassigned » saschaeggi
saschaeggi’s picture

Assigned: saschaeggi » Unassigned
webchick’s picture

Title: Views UI » Convert Views UI to new design system

Just re-titling slightly so this doesn't look weird in the list of core issues. :)

ckrina’s picture

Issue tags: +Needs design
saschaeggi’s picture

StatusFileSize
new632.27 KB

Maybe as inspiration this is how the Views UI currently looks currently in Gin:

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

bnjmnm’s picture

Status: Postponed » Needs review
StatusFileSize
new68 KB
new257.12 KB
new141.82 KB
new112.98 KB
new94.91 KB

This is the views redesign that @lauriii and I worked on for the past week. A few screenshots are attached but it's better to test drive the patch as this patch touches pretty much every part of views.

While evaluating keep in mind that the modal dialog styles are getting a nice restyle in #3023311: Modal dialog style update, so the titlebar and buttonpanes of dialogs will be taken care of there. The contents of the dialog, however, are in-scope for this issue.

KondratievaS’s picture

Assigned: Unassigned » KondratievaS
bnjmnm’s picture

Assigned: KondratievaS » Unassigned
Issue summary: View changes

Updated issue summary to reflect the iterative process.

@KondratievaS - I'm switching this back to unassigned as a large patch would benefit from getting as many reviewers as possible on it, and doesn't need to be assigned to a single contributor right now. If you were intending on doing something other than review, that should wait until people have had an opportunity to weigh in on the proposed designs in #12. I look forward to you being part of those reviews!

KondratievaS’s picture

StatusFileSize
new259.93 KB
new2.55 MB

Tested patch from #12 and I found several bugs for desktop and mobile display (adding other screenshots without bugs as archive):

bugs

KondratievaS’s picture

Status: Needs review » Needs work
bnjmnm’s picture

Status: Needs work » Needs review
StatusFileSize
new21.28 KB
new81.41 KB

Great finds @KondratievaS! This addresses everything in the screenshots other than the lower left. That issue extends well beyond view, is being worked on here: #3068696: Tables overflow on mobile, and seems pretty close to complete.

This also:

  • Removes several dozen css rules that target selectors that don't appear in Claro
  • Updates the styling for the display controls near the top of the views form
  • Fixed a few instances where a dropbutton appears first in taborder despite appearing last in its container
  • The problem with dropbuttons overlapping labels at narrower widths is fixed. We'll have more flexibility with how this is handled when Splitbuttons are available, but the ugliest symptom is addressed.
KondratievaS’s picture

StatusFileSize
new98.75 KB
new195.84 KB

Tested patch from #17. Bugs reported in #16 are fixed, but there are 2 more issues now

1. Displays are not aligned
2. Length of filed is too small
3. Checkbox and label is not centered

OK

KondratievaS’s picture

Status: Needs review » Needs work
komalk’s picture

Status: Needs work » Needs review
StatusFileSize
new82.34 KB
new1.54 KB
bnjmnm’s picture

StatusFileSize
new2.43 KB
new81.61 KB

These reviews are very helpful @KondratievaS, it's hard to find everything in something as complex in Views.

This addresses item 1 and 2 of #18. I couldn't reproduce item 3, though. If it's still happening, any additional details regarding how to reproduce or any CSS that seems to be causing it would be great.

The patch is#20 is appreciated but unfortunately won't work because

  1. +++ b/core/themes/claro/css/components/views-ui.css
    @@ -139,7 +139,7 @@
     .views-ui-dialog .draggable .form-type--checkbox {
       display: inline-block;
    -  margin: 0 0.25rem;
    +  margin: 0 0.125rem;
     }
    

    This doesn't appear to fix anything and causes a problem when the checkbox is focused - the focus ring overlaps with the label.

  2. +++ b/core/themes/claro/css/components/tables.css
    @@ -265,7 +265,8 @@ td.is-active {
     td > .form-item > .form-element,
     td > .ajax-new-content > .form-item > .form-element {
    -  width: 100%;
    +  max-width: 100%;
    +  width: auto;
     }
    

    This is a very broad change that impacts a variety of use cases outside of views. Any solutions should be views-specific. There was a followup created a few comments ago to explore how this style is applied to tables.

  3. It doesn't address #18.3

So this patch is built on #17

KondratievaS’s picture

StatusFileSize
new122.51 KB

Tested patch from #21
Bugs 1 and 2 reported in #18 are fixed. About bug #3 - i can not reproduce anymore

OK

Leave task in "Need review" status for more deep review from devs

indrajithkb’s picture

StatusFileSize
new19.62 KB
new8.2 KB
new7.01 KB

review of patch #21 three bugs found fixed.
Thanks @bnjmnm for the #21

issue-1
issue-2
issue-3

indrajithkb’s picture

Status: Needs review » Reviewed & tested by the community
bnjmnm’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new73.25 KB
new4.38 KB
new81.11 KB

Made a change to the tab row with display name/view page based on feedback from @ckrina at Claro weekly check-in.

Also fixed stylelint errors.

lauriii’s picture

Status: Needs review » Needs work
Issue tags: -Needs design
  1. +++ b/core/themes/claro/claro.theme
    @@ -579,6 +586,35 @@ function claro_views_ui_display_top_alter(&$element) {
    +    unset( $element['tabs_and_add']['add_display']);
    

    Nitpick: Extra space inside the function arguments.

  2. +++ b/core/themes/claro/claro.theme
    @@ -1462,3 +1506,78 @@ function claro_preprocess_links__media_library_menu(array &$variables) {
    +  // Move all form elements in controls to its parent.
    

    Can we expand this to include explanation on why?

  3. +++ b/core/themes/claro/templates/views/views-ui-build-group-filter-form.html.twig
    @@ -0,0 +1,59 @@
    + * Default theme implementation for Views UI build group filter form.
    
    +++ b/core/themes/claro/templates/views/views-ui-expose-filter-form.html.twig
    @@ -0,0 +1,77 @@
    + * Default theme implementation for exposed filter form.
    
    +++ b/core/themes/claro/templates/views/views-ui-view-preview-section--exposed.html.twig
    @@ -0,0 +1,22 @@
    + * Default theme implementation for a views UI preview section.
    

    Let's update these to say that these are theme overrides.

  4. +++ b/core/themes/claro/templates/views/views-ui-expose-filter-form.html.twig
    @@ -0,0 +1,77 @@
    +{% if form.use_operator %}
    +  <div class="views-config-group-region">
    +    <div class="views-group-box">
    ...
    +    </div>
    +{% endif %}
    ...
    +{% if form.operator['#type'] %}
    +    <div class="views-group-box">
    ...
    +    </div>
    +  </div>
    +{% else %}
    

    Could this lead to invalid markup because the closing tag is in different condition?

bnjmnm’s picture

Status: Needs work » Needs review
StatusFileSize
new3.31 KB
new81.24 KB

Addresses #26

priyanka.sahni’s picture

Assigned: Unassigned » priyanka.sahni
priyanka.sahni’s picture

Assigned: priyanka.sahni » Unassigned
StatusFileSize
new308.09 KB
new165.72 KB
new184.78 KB
new116.98 KB

Verified and tested by applying the patch#27.It looks good to me.Can be moved to RTBC.RTBC +1.

Steps to test -
1. Go to the admin site.
2. Go to /admin/appearance.
3. Install and enable the Claro theme.
4. Go to /admin/structure/views/view/content.
5. Verify the UI of different views Ui.

After Patch -
After Patch

After Patch

After Patch

After Patch

lauriii’s picture

StatusFileSize
new79.04 KB

Rerolled #27

lauriii’s picture

StatusFileSize
new80.92 KB
new6.86 KB
  • Fixed PHPCS failures ✅
  • Addressed @todo referencing this issue ✅
  • Made margin tab bucket margins more consistent 🧐
KondratievaS’s picture

StatusFileSize
new482.59 KB

Tested patch from #31 and found one more issue:

Popin changes his height when tab closes. Steps to reproduce:

1. Open Filter settings
2. Click on tab to open -> height is not changed
3. Click on tab to close -> height is changed

bug

KondratievaS’s picture

Status: Needs review » Needs work
bnjmnm’s picture

Status: Needs work » Needs review

The test fail in #31 was an unrelated Media Library test that is known for failing randomly.

The feedback in #32 is evidence of a thorough review, which is very appreciated. However, I was able to reproduce the exact symptoms in 9.0.0, which confirms that the issue was not caused by this patch. I was also able to recreate the symptoms with Seven, so it's not a Claro issue, either. It would be great if you filed a followup issue in the JavaScript component that details your findings.

katherined’s picture

Status: Needs review » Needs work
StatusFileSize
new60.35 KB
new65.85 KB
new47.81 KB
new84.58 KB
new72.41 KB

I found a few things while testing the patch in #31.

1. Under Filter Criteria -> Content: Published, the options are in a fieldset and not in a .views-group-box div, so they lack padding and the arrow overlaps. This also applies to Content: Promoted and Content revision: Sticky at the top of lists.

2. When configuring Content: [field] filter criteria, choosing a NULL or NOT NULL operator results in an extra empty form item.

For comparison, this is how the same thing looks in Seven.

3. After rearranging filter criteria, which displays the “and” operator, removing the last criteria leaves behind an “and” that should not be there. Removing an item from the middle works as expected.

lauriii’s picture

lauriii’s picture

bnjmnm’s picture

Status: Needs work » Needs review
StatusFileSize
new83.02 KB
new6.87 KB

This patch addresses #35.2 and also changes some variable names to be consistent with another issue in progress #3083256: Create smaller variations for form elements

katherined’s picture

I confirmed that the patch in #38 fixes the second issue in #35 as shown below:

But in the process, some operator icons elsewhere have gone missing. To reproduce, see the "Recipes" view in the Umami profile. Check the "Content: Published (= Yes)" filter or "Content: Content type (= Recipe)" filter.

For reference, this is the "Content: Content type (= Recipe)" filter with the patch in #31 applied.

bnjmnm’s picture

StatusFileSize
new2.17 KB
new84.3 KB

I believe this addresses #39. I've tested with as many combinations of adding/editing filters as I can think of, but due to the versatility of Views there may be a use case I didn't consider. Good reviewers like @katherined are particularly important in this case 🙂.

katherined’s picture

This addresses all the issues I've found, and your approach is as good as any I could come up with, so it looks great to me!

katherined’s picture

Status: Needs review » Needs work
StatusFileSize
new16.5 KB

I've gone through this more carefully, tracking down the actual use of selectors and manually deactivating/testing extensively, tested in Chrome, Firefox, and IE, and I've tried many views config options, and tested each dialog. All that I could find at this point is:

1. This border isn't quite right in IE. Reproduce by looking at the Content: Published filter on the recipe view in Umami, for example.

2.

+++ b/core/themes/claro/claro.theme
@@ -586,6 +593,35 @@ function claro_views_ui_display_top_alter(&$element) {
+  if (isset($element['add_display'])) {
+    foreach ($element['add_display'] as &$display_item) {
+      if (isset($display_item['#type']) && in_array($display_item['#type'], ['submit', 'button'])) {
+        $display_item['#attributes']['class'][] = 'views-tabs__action-list-button';
+      }
+    }
+  }

This could use a comment just for abundant clarity.

3.

+++ b/core/themes/claro/claro.theme
@@ -1413,3 +1457,100 @@ function claro_preprocess_links__media_library_menu(array &$variables) {
+function claro_form_views_ui_config_item_form_alter(&$form, FormStateInterface $form_state) {
+  $type = $form_state->get('type');
+  $form['#attributes']['class'][] = 'views-config-item-form';
+  $form['#attributes']['class'][] = "views-config-item-form--$type";

Are these used? I couldn't find them.

4.

+++ b/core/themes/claro/css/theme/views_ui.admin.theme.pcss.css
@@ -813,3 +666,22 @@ td.group-title {
+html:not(.no-touchevents) .views-display-top .dropbutton-wrapper {
+  top: 6px;
+}
+html:not(.no-touchevents) .views-ui-display-tab-bucket .dropbutton-wrapper {
+  top: 11px;
+}
+html:not(.no-touchevents) .edit-display-settings-top.views-ui-display-tab-bucket .dropbutton-wrapper {
+  top: 5px;
+}

I'm not sure these are necessary.

phenaproxima’s picture

Issue tags: +Needs followup

Okay, so I read the PHP parts and skipped over the rest because CSS is not my main area of expertise. I trust @bnjmnm's CSS knowledge, and it looks like @katherined has a solid handle on those aspects of this patch.

I had one overarching question -- a lot of the PHP side seems concerned with removing float-related stuff (like clearfix) in favor of flexbox. Why not simply do these things in Views UI itself, since our minimum supported browsers all support flexbox? @lauriii confirmed for me that this is something we could do in a follow-up, since it's easier to get these changes done in Claro first, then migrate them into modules later. Therefore, tagging this issue for that follow-up.

With that in mind, some of my suggested refactorings here (like a utility function to remove clearfix and other classes) probably aren't super compelling, so take them with a grain of salt. Overall these changes look good to me; it seems they're being thoroughly verified visually by @katherined, and quite frankly, if it looks good on the front-end, that's what matters most here and it's okay if the code is not perfect. (Which is not to say it's bad code -- Views UI is beyond complex and therefore it makes sense that anything which wants to alter its interface would have to deal with some really fiddly stuff.)

  1. +++ b/core/themes/claro/claro.theme
    @@ -586,6 +593,35 @@ function claro_views_ui_display_top_alter(&$element) {
    +      if (isset($display_item['#type']) && in_array($display_item['#type'], ['submit', 'button'])) {
    

    We should pass TRUE as the third argument to in_array().

  2. +++ b/core/themes/claro/claro.theme
    @@ -586,6 +593,35 @@ function claro_views_ui_display_top_alter(&$element) {
    +  if (isset($element['extra_actions']) && isset($element['tabs']) && isset($element['add_display'])) {
    

    Pro tip: isset() is variadic and only returns TRUE if every argument is set. So unless the coding standards say we can't, this can be isset($element['extra_actions'], $element['tabs'], $element['add_display']).

  3. +++ b/core/themes/claro/claro.theme
    @@ -586,6 +593,35 @@ function claro_views_ui_display_top_alter(&$element) {
    +    $element['tabs_and_add']['tabs'] = $element['tabs'];
    +    $element['tabs_and_add']['add_display'] = $element['add_display'];
    +    $element['tabs_and_add']['#weight'] = 0;
    +    unset($element['tabs_and_add']['tabs']);
    +    unset($element['tabs_and_add']['add_display']);
    

    Pro tip: unset() is variadic as well. ;) But a bigger question is: why are we setting these array keys only to immediately unset them?

  4. +++ b/core/themes/claro/claro.theme
    @@ -586,6 +593,35 @@ function claro_views_ui_display_top_alter(&$element) {
    +    foreach (array_keys($element['#attributes']['class'], 'clearfix', TRUE) as $key) {
    +      unset($element['#attributes']['class'][$key]);
    +    }
    

    This seems awkward. Couldn't we just use array_diff() to remove clearfix?

  5. +++ b/core/themes/claro/claro.theme
    @@ -636,6 +672,14 @@ function claro_views_ui_display_tab_alter(&$element) {
    +  $top = &$element['details']['top'] ?? [];
    

    This reads a little strangely -- $top is either a reference or an array-by-value, but I can't really tell which it might be, because I don't know what kind of precedence the & modifier has. Maybe there's a more straightforward way to do this that doesn't involve modifying the element by reference?

  6. +++ b/core/themes/claro/claro.theme
    @@ -636,6 +672,14 @@ function claro_views_ui_display_tab_alter(&$element) {
    +    foreach (array_keys($top['#attributes']['class'], 'clearfix', TRUE) as $key) {
    +      unset($top['#attributes']['class'][$key]);
    +    }
    

    Could we use array_diff() here?

  7. +++ b/core/themes/claro/claro.theme
    @@ -1413,3 +1457,100 @@ function claro_preprocess_links__media_library_menu(array &$variables) {
    +      foreach (array_keys($row['data'][0]['class'], 'container-inline', TRUE) as $key) {
    +        unset($row['data'][0]['class'][$key]);
    +      }
    

    Same question here.

  8. +++ b/core/themes/claro/claro.theme
    @@ -1413,3 +1457,100 @@ function claro_preprocess_links__media_library_menu(array &$variables) {
    +function claro_form_views_ui_config_item_form_alter(&$form, FormStateInterface $form_state) {
    

    &$form should be type hinted as an array.

  9. +++ b/core/themes/claro/claro.theme
    @@ -1413,3 +1457,100 @@ function claro_preprocess_links__media_library_menu(array &$variables) {
    +    $form['options']['expose_button']['#prefix'] = str_replace('clearfix', '', $form['options']['expose_button']['#prefix']);
    +    if (isset($form['options']['group_button']['#prefix'])) {
    +      $form['options']['group_button']['#prefix'] = str_replace('clearfix', '', $form['options']['group_button']['#prefix']);
    +    }
    

    So as I read through this patch, I'm seeing we're doing a lot of clearfix-removing. I wonder if this should be a utility function in Claro, which takes an arbitrary render array and just recursively removes clearfix from every level of it, indiscriminately, in $element['#attributes']['class'], $element['#prefix'], and $element['#suffix']. Maybe it could accept an arbitrary class to remove, instead of hard-coding clearfix.

  10. +++ b/core/themes/claro/claro.theme
    @@ -1413,3 +1457,100 @@ function claro_preprocess_links__media_library_menu(array &$variables) {
    +    if (isset($form['options']['value']['#prefix']) && strpos($form['options']['value']['#prefix'], $wrapper_div_to_remove) !== FALSE) {
    

    Dear lord, I cannot wait for PHP 8 and str_contains() to arrive.

  11. +++ b/core/themes/claro/claro.theme
    @@ -1413,3 +1457,100 @@ function claro_preprocess_links__media_library_menu(array &$variables) {
    +      if (strpos($form['options']['value']['#prefix'], $right_class) !== FALSE) {
    +        $form['options']['value']['#prefix'] = str_replace($right_class, 'views-group-box--value', $form['options']['value']['#prefix']);
    +      }
    

    Do we need an isset() check here around $form['options']['value']['#prefix']?

  12. +++ b/core/themes/claro/claro.theme
    @@ -1413,3 +1457,100 @@ function claro_preprocess_links__media_library_menu(array &$variables) {
    +function claro_form_views_ui_add_handler_form_alter(&$form, FormStateInterface $form_state) {
    

    &$form should have the array type hint.

  13. +++ b/core/themes/claro/claro.theme
    @@ -1413,3 +1457,100 @@ function claro_preprocess_links__media_library_menu(array &$variables) {
    +    foreach (array_keys($form['selected']['#attributes']['class'], 'container-inline', TRUE) as $key) {
    +      unset($form['selected']['#attributes']['class'][$key]);
    +    }
    

    array_diff() here?

  14. +++ b/core/themes/claro/css/components/views-ui.css
    @@ -9,6 +9,53 @@
    +  /*
    +   * Color Palette.
    +   */
    +  /* Secondary. */
    +  /* Variations. */ /* 5% darker than base. */ /* 10% darker than base. */ /* 10% darker than base. */ /* 20% darker than base. */ /* 5% darker than base. */ /* 10% darker than base. */ /* 5% darker than base. */ /* 10% darker than base. */ /* 5% darker than base. */ /* 10% darker than base. */
    +  /*
    +   * Base.
    +   */
    +  /*
    +   * Typography.
    +   */ /* 1rem = 16px if font root is 100% ands browser defaults are used. */ /* ~32px */ /* ~29px */ /* ~26px */ /* ~23px */ /* ~20px */ /* 18px */ /* ~14px */ /* ~13px */ /* ~11px */
    +  /**
    +   * Spaces.
    +   */ /* 3 * 16px = 48px */ /* 1.5 * 16px = 24px */ /* 1 * 16px = 16px */ /* 0.75 * 16px = 12px */ /* 0.5 * 16px = 8px */
    +  /*
    +   * Common.
    +   */
    +  /*
    +   * Inputs.
    +   */ /* Absolute zero with opacity. */ /* Davy's gray with 0.6 opacity. */ /* Light gray with 0.3 opacity on white bg. */ /* Old silver with 0.5 opacity on white bg. */ /* (1/8)em ~ 2px */ /* (1/16)em ~ 1px */ /* Font size is too big to use 1rem for extrasmall line-height */ /* 7px inside the form element label. */ /* 8px with the checkbox width of 19px */
    +  /*
    +   * Details.
    +   */
    +  /**
    +   * Buttons.
    +   */
    +  /**
    +   * jQuery.UI dropdown.
    +   */ /* Light gray with 0.8 opacity. */ /* Text color with 0.1 opacity. */
    +  /**
    +   * jQuery.UI dialog.
    +   */
    +  /**
    +   * Progress bar.
    +   */
    +  /**
    +   * Tabledrag icon size.
    +   */ /* 17px */
    +  /**
    +   * Ajax progress.
    +   */
    +  /**
    +   * Breadcrumb.
    +   */
    

    I assume these are placeholders for later work?

bnjmnm’s picture

Status: Needs work » Needs review
Issue tags: -Needs followup
StatusFileSize
new86.77 KB
new14.49 KB
new209.79 KB
new111.91 KB

While addressing feedback I noticed that the display tabs were not justifying properly in IE11. I added a fix for that. This results in a slightly different experience in IE11 (the actions button it in its own column), but that experience matches Views UI when using Seven so this could be classified as graceful degradation.

#42.1 The effort required to get this looking right in IE11 is difficult to justify, especially since this styling is not present in Seven. I removed this in IE11 only, so the end result matches the experience in Seven, so this can be classified as graceful degradation - IE11 doesn't have a diminished experience, but non-IE browsers will have an improved one

#42.2
Comment added

#42.3
Was part of an early iteration and no longer needed. Removed.

#42.4
Those styles are definitely not needed as the elements they target are set to position: static;. Removed

#43.1,2
yep
#43.3
Looks like that was an artifact of an approach that was not used, removed.
#43[4-8]
yep
#43.9
The helper function sounds cool - I'm not sure there's quite enough instances of this removal to justify a utility that could potentially take a while to implement, but it may be worth exploring as a core utility function. Would there be performance concerns with this due to the recursion and it happening on non-cached preprocess functions? (genuinely don't know, not the kind of thing I've ever benchmarked).
#43[10-13]
yep
#43.14
This is from the PostCSS build, any .pcss.css file that has an

@import "../base/variables.pcss.css";

gets all the comments from that file added to the top of the compiled .css file.

lendude’s picture

StatusFileSize
new20.97 KB
new17.08 KB
new51.76 KB
new28.69 KB
new17.51 KB

Nice!! Awesome awesome effort!

Just clicking around there are some things I see, these might not be in scope so feel free to ignore


Views wizard shows 'Loading...' when it's not


With the bigger focus border, the border flows into/over any prefix and suffix text making it a little hard to read



When there are multiple types of errors there is a lot of whitespace between the two types, much more then there is in Seven


.views-group-box .form-item puts some items 3px out of line with parent items. If that is on purpose it probably needs a little more to make it clear that it is a group, or it needs less to just be aligned with the items above it.

bnjmnm’s picture

Re #45.
#1 The "loading" message to be addressed in #3166068: Autocomplete "loading" message not properly hidden in inline forms. (I just created this one)
#2 Focus overlap to be addressed across two issues: #3029675: Add support for the inline variation of form elements, #3082672: Form prefix/suffix redesign in Claro
#3 The issue for messages occupying considerable space is #3082679: When multiple messages present, a large amount of content is pushed below the fold
#4 Surfaced an entire views CSS file that was still being loaded from core, mostly containing styles that are not needed in Claro. This is overridden with a copy of that file, but with the unnecessary rules removed.

A few additional changes can be seen in the interdiff that address issues that were made apparent by the not-yet-overridden CSS file, specifically some elements that should only be visible when JS is enabled.

bnjmnm’s picture

StatusFileSize
new1.51 KB
new90.72 KB

@katherined pointed out on slack some thing that weren't quite rights with the claro.theme changes in #46

katherined’s picture

Status: Needs review » Reviewed & tested by the community

Awesome! It works as intended now, and all the css refactoring makes sense to me. I don't see any further issues to comment on, so marking as RTBC.

katherined’s picture

Status: Reviewed & tested by the community » Needs work

I take it back, but only for one tiny thing.

+++ b/core/themes/claro/claro.theme
@@ -1548,12 +1548,12 @@ function claro_form_views_ui_add_handler_form_alter(array &$form, FormStateInter
+      // The wrapper ensured that it's child elements were hidden in browsers

typo: its

bnjmnm’s picture

Status: Needs work » Needs review
StatusFileSize
new90.71 KB
new896 bytes

Nuked the nit.

katherined’s picture

Status: Needs review » Reviewed & tested by the community

Thank you!

lauriii’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work
StatusFileSize
new342.91 KB
new401.83 KB
new179.66 KB
new107.95 KB
new49.52 KB

Few more things I was able to catch when I was taking screenshots for the issue summary:

Is this how messages inside Views dialogs should look like?

For some reason the bottom of the page is rendered under the button pane.

lauriii’s picture

bnjmnm’s picture

The hidden-behind button pane issue is pre-existing and not specific to Claro:
#3161840: Modal dialogue Views Messages breaks form usability

That issue also has screenshots demonstrating that this messages inside views dialogs behavior is not really specific to Claro either.

If it can be improved I think it can be scoped to another issue, but I'll let @lauriii make the final call on that instead of switching back to RTBC myself.

lauriii’s picture

Status: Needs work » Reviewed & tested by the community

The bug is slightly worse in Claro because of the message consume more vertical space, but I still think it's probably out of scope as a pre-existing bug. Moving back to RTBC

lauriii’s picture

bnjmnm’s picture

StatusFileSize
new87.76 KB

Reroll

effulgentsia’s picture

Adjusting issue credits.

effulgentsia’s picture

Adding credit to @saschaeggi for multiple design reviews that happened during Claro meetings and informed the work here.

effulgentsia’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new87.78 KB
new3.47 KB

These changes were needed to satisfy spell checking and coding standards. Please review this to make sure these changes are correct.

lauriii’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new89.18 KB
new953 bytes

Looks good except I improved the way one of the comments was broken down to multiple lines.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 61: 3066006-61.patch, failed testing. View results

anmolgoyal74’s picture

StatusFileSize
new38.98 KB

Looks like unrelated failure.
Running the test again.

anmolgoyal74’s picture

Status: Needs work » Needs review
effulgentsia’s picture

Status: Needs review » Reviewed & tested by the community

Thanks! Back to RTBC per #61.

  • effulgentsia committed 0d3f8d2 on 9.1.x
    Issue #3066006 by bnjmnm, lauriii, katherined, KondratievaS, Lendude,...
effulgentsia’s picture

Status: Reviewed & tested by the community » Fixed

This patch looks great! Pushed to 9.1.x. It's great to see Views UI looking good in Claro now!

Status: Fixed » Closed (fixed)

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