govuk-design-system-backlog icon indicating copy to clipboard operation
govuk-design-system-backlog copied to clipboard

Filter a list

Open joelanman opened this issue 6 years ago • 18 comments

Also known as: faceted search

What

Help users filter a list of items for to see things that are relevant to their task. For example filtering search results.

Why

Services that use this pattern:

Anything else

joelanman avatar Apr 05 '18 17:04 joelanman

There is a conversation in the designer mailing list that is talking about examples of filter or advance search components (relevant to this issue). There is an example from Digital Market Place and GOV.UK pages

ignaciaorellana avatar Jun 04 '18 14:06 ignaciaorellana

Screenshot from GOV.UK search image

joelanman avatar Jul 19 '18 14:07 joelanman

You can see this component in GOV.UK Publishing at https://finder-frontend.herokuapp.com/component-guide/option-select

NickColley avatar Jul 19 '18 15:07 NickColley

Here's some work we've done for HMCTS on filters: https://github.com/hmcts/design-system-backlog/issues/43

Here's a demo of an AJAX-enhanced responsive filter with accessibility measures. You can turn off JS to see how things behave. http://nostyle.herokuapp.com/examples/filter-form

adamsilver avatar Oct 25 '18 09:10 adamsilver

@fordie commented on this issue on 26 Jun

This pattern allows a user to search or filter a list of items that have been returned by the system, for instance looking for only pubs or properties in a certain postcode that are in a list of properties. This is similar to search, but the user will already have been presented with a list of results that they want to reduce.

find-a-client

property filter

@benwakefield commented on 27 Sep

@stevenaproctor We're using this approach to refine results where usual closed checkbox filtering isn't appropriate, the prototype should be out for testing in the coming weeks. This UI is for an internal HMRC system fyi.

screen shot 2018-09-27 at 07 58 21

mikeash82 avatar Nov 27 '18 15:11 mikeash82

Faceted search tags (aka Chips, Tags, Pills) on GOV.UK finders e.g. https://www.gov.uk/service-standard-reports?keywords=MOT&assessment_date%5Bfrom%5D=&assessment_date%5Bto%5D=

screen shot 2019-01-21 at 14 54 47

dashouse avatar Jan 21 '19 15:01 dashouse

We've moved this card to the 'To do' column of the community backlog because it's a dependency on the Search for something pattern, which is already in the 'To do' column.

timpaul avatar Feb 04 '19 11:02 timpaul

Faceted search tags (aka Chips, Tags, Pills) on GOV.UK finders e.g. https://www.gov.uk/service-standard-reports?keywords=MOT&assessment_date%5Bfrom%5D=&assessment_date%5Bto%5D=

screen shot 2019-01-21 at 14 54 47

Curious as to why the filters selected (in a rectangle) would be separated from the filters itself. Happy to help with this design, as we are using filters for an activity feed.

FarhadUX1 avatar Mar 06 '19 17:03 FarhadUX1

It would be super if the collapsing filter component could be adopted - we've got a number of things you can filter by, and this helps keep the list manageable.

edwardhorsford avatar Mar 28 '19 11:03 edwardhorsford

This has not yet been through any user research at all

Here's a mockup of ideas for filtering GOV.UK search. I thought the accordion might work better with arrows here as people could understand plus and minus as adding filter (which is kind of true) and removing a filter (which is not true, you'd just be collapsing the group)

image

joelanman avatar Mar 28 '19 11:03 joelanman

@joelanman I noticed that a previous implementation of search on gov.uk/search had a count next to each filter, Hinting at the consequence of selecting/deselecting the filter. I notice this isn't in the mock up or current version. have you had research suggest it isn't helpful? Screenshot 2019-04-10 at 15 35 55

campbellssource avatar Apr 10 '19 14:04 campbellssource

@campbellssource sorry for the long delay! There was no deliberate change there - I think at the point I made the screenshot we just hadn't implemented that aspect yet.

joelanman avatar Jun 07 '19 10:06 joelanman

Here's the MOJ's filter a list pattern: https://moj-design-system.herokuapp.com/patterns/filter-a-list

Big screens: image

Small screens: image

adamsilver avatar Nov 29 '19 09:11 adamsilver

I'm looking into a set of filters that can be applied to a case load. I want to show how many cases there are for each filter (let's imagine there's 9 cases and there's 4 filters: case open, case closed, UK cases, international cases). e.g.

  • case open (6 cases)
  • case closed (3 cases)
  • UK cases (7 cases)
  • international cases (2 cases)

What I want to do is change the case number in brackets if another filter affects that total - so in the above example if I select UK cases (of which there's, say, 7), then I'd get:

  • case open (5 cases)
  • case closed (2 cases)

In other words, because I've not selected international cases, those two have been removed from the totals within case open and case closed, and the totals in brackets have dynamically updated when the UK cases filter has been clicked. Hope that makes sense....

Has anyone done this or knows how to do it?

jonathaninch avatar Mar 11 '21 14:03 jonathaninch

The Filters documentation has been updated in the MOJ Pattern Library: https://design-patterns.service.justice.gov.uk/components/filter/

Feedback welcome!

kelliedesigner avatar Jul 20 '21 12:07 kelliedesigner

For the CFS Service we updated the filters because the old filters had:

  • 'Clear filters' at the bottom which was hard for the user to see and reach
  • Low contrast between the text and background colours
  • No way to see what filters had been selected
  • No way for the user to show/hide all sections at once
  • Outdated Accordions
Current filters

For the updated filters we:

  • Based them off the new Accordions
  • Took inspiration from the MOJ's filter a list 'Selected filters' but decided the 'Apply filters' button wasn't necessary as 'Apply filters' could be done automatically, also the title 'Filters' doesn't add anything for the user.
  • Made 'Filter by' on each filter visually hidden for screen readers and added 'Search for' text under the funding stream and period to differ from the main 'Search' at the top of the screen.
  • A 'Clear search' button link was added so the user can clear the search separately from clearing the filters.
New filters
  • The summary line was added in from the Accordion component to shows how many items the user has selected which was originally underneath 'Filter by'.
New filters expanded

nedpowell avatar Apr 26 '22 11:04 nedpowell

We've used basic filters on the Campaigns hub to narrow down a page of campaign results. CRC v3 - Campaigns hub filters

In recent research sessions, the filters have been interacted with and useful to some – particularly with users who are familiar with the content (this is more of a B2B site). There were some expectations for things that weren’t on the site, for example specific health conditions so the labels and categories are very important (as well as the drop down options). There is also a more advanced search on this site so filters are used to help search at a topic only level.

Also noted in https://github.com/nhsuk/nhsuk-service-manual-community-backlog/issues/217

maddyow avatar May 31 '22 15:05 maddyow

We've just added some guidance on how to 'share findings about your users' with us 📝. This will help us learn more about how your users filter a list within your service.

CharlotteDowns avatar Oct 16 '23 08:10 CharlotteDowns