Problem/Motivation

#2625136: Fix label visibility and add wrapper container for exposed numeric/date filters with multiple form elements is fixing a long standing bug in Views exposed forms. If a given filter requires multiple form elements (e.g. the operator is exposed, or it's a numeric filter with 'between' operation that needs min/max, etc), prior to #2625136 things were all kinds of broken:

Screenshot of exposed views filter with multiple elements in Claro before #2625136

Now, for these sorts of filters to make sense (both to folks using screen readers and other assistive technology, or to sighted users), those elements are wrapped in a fieldset. However, the default styles for Claro don't look perfect:

Screenshot of exposed views filter with multiple elements in Claro after the fix from #2625136 so the elements are in a fieldset

Proposed resolution

Tweak Claro's (p)CSS to give better spacing / alignment for these sorts of exposed form elements.

Remaining tasks

  1. Wait for #2625136: Fix label visibility and add wrapper container for exposed numeric/date filters with multiple form elements to land so we have something to style.
  2. Design what this should look like in Claro.
  3. Implement.
  4. Reviews.
  5. RTBC.
  6. Commit.

User interface changes

TBD.

API changes

N/A

Data model changes

N/A

Release notes snippet

TBD. Probably not.

Issue fork drupal-3133639

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

dww created an issue. See original summary.

kiran.kadam911’s picture

Assigned: Unassigned » kiran.kadam911
Status: Active » Needs work
kiran.kadam911’s picture

@dww as per proposed resolution can you please reply on below things for more clarity,

  • Spacing: Only in between spacing(left/right) is required?
  • Alignment of fields: At top or bottom?
  • What about elements inside fieldset do we have any design for it? OR No need to do anything with it.
dww’s picture

Version: 8.9.x-dev » 9.1.x-dev
Assigned: kiran.kadam911 » Unassigned
Status: Needs work » Postponed
Issue tags: +Needs design

Hi @kiran.kadam911. Copying the results of a Slack thread about this.

a) I don't know the details of Claro's design process, so I can't advise on the specific questions you're asking me.

b) Remaining task #2 is "Design what this should look like in Claro." @ckrina said:

feel free to add the Needs Design tag and we may be able to track it soon since we have the Claro sprint next week

c) There's no sense calling this NW or assigned to you, since you're not going to be doing that design yourself. It should probably be "postponed", until there's more progress/agreement on #2625136: Fix label visibility and add wrapper container for exposed numeric/date filters with multiple form elements. That's what I intended with the "[PP-1]" title prefix, but forgot to change the status.

When someone from the core Claro team has a chance to design this and provide some feedback, it could make sense to assign to yourself to implement the design, although it still probably makes more sense to wait for #2625136 to land, since there might be changes there that could invalidate effort here.

Thanks!
-Derek

p.s. Also, since #2625136 isn't going to happen until 9.1.x, this issue should target the same branch.

kiran.kadam911’s picture

Version: 9.1.x-dev » 8.9.x-dev
Status: Postponed » Needs work

Needs design for fields inside fieldset in views exposed filter.

kiran.kadam911’s picture

Status: Needs work » Postponed
dww’s picture

Version: 8.9.x-dev » 9.1.x-dev
dpi’s picture

Title: [PP-1] Fix Claro styles for exposed views filters wrapped in fieldsets » Fix Claro styles for exposed views filters wrapped in fieldsets
Status: Postponed » Active

PP-1 is fixed

bnjmnm’s picture

StatusFileSize
new3.6 KB
new54.81 KB
new53.59 KB

Fully aware a design does not exist yet -- this patch is intended to help the process, not to impose any design decisions.

dww’s picture

Status: Active » Needs review

@bnjmnm - That looks fantastic, thanks!

Code seems fine to me, although I'm not qualified to comment on the Claro-ness of it. ;)

Bumping to NR, at least.

Cheers,
-Derek

slv_’s picture

StatusFileSize
new23.73 KB

FWIW, I first saw this issue when setting up https://www.drupal.org/project/microcontent. Looks like autocomplete filters with a description below them are worth considering as well for testing this, in case they need specific tweaks

dww’s picture

@slv_: That's a different problem. This issue is specifically for Claro styles for Views exposed filters that are (as of 9.1.x core) wrapped in fieldsets if they contain multiple elements (e.g. an exposed operator, and/or an operation that requires multiple inputs like 'Is between'). Your screenshot looks like what folks are trying to address at #3116377: Autocomplete input in views exposed filters does not align with select and text inputs

Cheers,
-Derek

slv_’s picture

@dww ah good, thanks for pointing me to the correct one!

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

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

volkswagenchick’s picture

Adding NorthAmerica2021 and Easy Out of the Box tags for visibility.

DrupalCon NA is April 12-16 with a focus on EOOTB on Wednesday, April 14.
Thanks

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

sakthivel m’s picture

Status: Needs review » Needs work

#9 Patch Failed

sakthivel m’s picture

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

#18 Please review the patch

sakthivel m’s picture

StatusFileSize
new3.64 KB

#19 Fixed Custom command failed issue, Recreated patch

nishantghetiya made their first commit to this issue’s fork.

chetanbharambe’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new267.41 KB
new260.39 KB

Verified and tested patch #19.
Patch applied successfully and looks good to me.

Testing Steps:
# Apply claro theme
# Goto: admin/structure/views/view/content
# Scroll down and check the exposed filters
# Save it.

Expected Results:
# User should see input fields properly under exposed filters and should be aligned properly.

Actual Results:
# User is able to see input fields are broken and not aligned as per style.

Looks good to me.
Can be a move to RTBC.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 19: 3133639.19.patch, failed testing. View results

chetanbharambe’s picture

StatusFileSize
new269.54 KB
new246.78 KB

Verified and tested patch #19.
Patch applied successfully but not working as expected.

Testing Steps:
# Apply claro theme
# Goto: admin/structure/views/view/content
# Scroll down and check the exposed filters
# Save it.

Expected Results:
# User should see input fields properly below the exposed filters and should be aligned properly.

Actual Results:
# User is not able to see "is equal to filter" dropdown field

Not working as expected.
Please check the attached screenshots.
Moving to Needs Work.

bnjmnm’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new82.36 KB

This is now a merge request instead of a patch and here's evidence it works:

abhijith s’s picture

StatusFileSize
new34.78 KB
new27.59 KB

Applied patch #19 and it fixes the issue with the Claro styling of exposed views filters wrapped in fieldsets.

Before patch:
before

After patch:
after

gauravvvv’s picture

StatusFileSize
new3.65 KB
new433 bytes

Re-rolled patch #25, fixed cs errors. Please review

volkswagenchick’s picture

Issue tags: +Europe2021

Adding tag for DrupalCon Europe2021. Thanks

vikashsoni’s picture

StatusFileSize
new20.37 KB
new17.84 KB

Applied patch #19 and applied successfully
After patch the exposed views filters in claro theme issue fixed
Thanks for the patch

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

sokru’s picture

Status: Needs review » Needs work
StatusFileSize
new18.49 KB
new1.96 KB

Not sure if this is scope of this issue, but changing exposed filters from "select" to "radios" will break the layout, so setting "Needs work".
Offset of label is wrong

Steps to reproduce:

  1. Checkout 9.4.x
  2. Apply the patch
  3. Install the site with standard profile php core/scripts/drupal quick-start standard
  4. Enable Claro and set as admin theme.
  5. Visit /admin/content and see the label of "Content type" doesn't align with rest of labels.

chr.fritsch made their first commit to this issue’s fork.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

utcwebdev’s picture

#19 patch fails to apply in Drupal 10.1.6 (see new test).
https://www.drupal.org/project/drupal/issues/3133639#comment-14119137

gauravvvv’s picture

Status: Needs work » Needs review
StatusFileSize
new3.95 KB

I have attached the patch for 11.x Patch #32, no longer applies so not adding the interdiff

smustgrave’s picture

Status: Needs review » Needs work

IS seems to contain a number of TBD that should be addressed.

shweta__sharma’s picture

StatusFileSize
new3.95 KB
new1.09 KB

Tried to fix failure in #37

Prashant.c made their first commit to this issue’s fork.

prashant.c’s picture

Changes provided in the patches fixing the issue, removed duplicate code from the https://git.drupalcode.org/project/drupal/-/merge_requests/5811.

Keeping the MR in draft as there is still some work mentioned in #38.

Thanks

prashant.c’s picture

gauravvvv’s picture

I have updated logical properties in merge request !5811

sokru’s picture

StatusFileSize
new167.67 KB
new166.67 KB
new3.98 KB
new2 KB

Based on MR 1134, I added two improvements:
1. Fix alignment of grouped radio filters mentioned on #31
2. Move multi-select operator to top of flex element.

Before:

After:

ckrina’s picture

Issue summary: View changes
Issue tags: -Needs design
StatusFileSize
new32.83 KB
new26.7 KB

As commented on Slack, this is more complex that it looks like. We're giving the option to add things to a place that is not designed to have them. If you want to have a field with 5 radio buttons (more than 2 should be vertical), a top bar that is supposed to have horizontal things aligned is not its place. Basically, if we want to convert this search section in a box where anything can be thrown at, that’s not the place. We would need a classic vertical search section or any other modern pattern we can think of. But the top section if designed for quick and simple filters: takes fewer space and it's quick to access.

So my recommendation would be to totally rethink how we give people options, in a way that we can also recommend where to place them and provide that alternative place for complex search. Obviously it's out of scope here, but it's important to point out that this change is breaking the UX.

That said, here are a few design recommendations to make it look less bad in with fields that can be horizontally aligned:

  • Horizontally align items
  • Adjust field widths
  • Reduce spacing between elements within the same fieldset (4px)
  • Remove the visual border of the fielset/details
  • Increase space between all elements in this specific area if there are fieldsets/details inisde (easily done with CSS :has) and set a separation of 24px

So from this example:

Would become:

Design can't solve much more beyond this. Things like #45 just shouldn't be done in here.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

quietone’s picture

Title: Fix Claro styles for exposed views filters wrapped in fieldsets » Fix styles for exposed views filters wrapped in fieldsets

The Claro theme was approved for removal in #3576460: [policy, no patch] Deprecate and remove Claro.

This is Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.

The deprecation work is in #3576668: [meta] Tasks to deprecate Claro and the removal work in #3584638: [meta] Tasks to remove the Claro theme.

quietone’s picture

Status: Needs work » Postponed