Improve the layout of the filters

Created on 13 March 2025, 3 months ago

Problem/Motivation

This is a follow-up from โœจ Present boolean filters as checkboxes Active .

In that issue, we made the boolean filters into a set of checkboxes, which makes more sense than a row of selects, but is also trickier from a layout perspective. It doesn't look as nice as we'd ideally like it to.

Proposed resolution

There are three filter types: text, multi-choice, and boolean. We should group them into a grid layout by filter type.

The text filters should go in the "top" region of the grid, which spans the full width of the container. If there are multiple text filters, they just go one on top of the other.

The multiple choice filters should go in the bottom-left part of the grid, taking up, say, 30% of the full width of the grid container. If there is more than one multi-choice filter, they should go one after the other, vertically.

The boolean filters should go in the bottom-right part of the grid, mirroring the multiple-choice filters. As with the other filter types, if there is more than one boolean filter, they just go one after the other, as a list.

On small screens (phone width), the grid simply collapses and the filters are all just one on top of the other. Text filters first, then multi-choice filters, then booleans.

โœจ Feature request
Status

Active

Version

2.0

Component

User experience

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @phenaproxima
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States lyntechi Pennsylvania

    lyndasantiago โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States lyntechi Pennsylvania
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States nagatahmed
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States leslieg
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia libbna New Delhi, India

    Hi @nagatahmed are you working on this? Because I want to give it a try.

  • Assigned to nagatahmed
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia libbna New Delhi, India

    I am unassigning @nagatahmed from this issue due to no activity since March/April.

    I would like to take this forward, but before starting development, I need to clarify a few things.

    This issue seems to involve changing the layout of the filters. However, I am a bit unclear about the types of filters being referenced. Specifically:

    1. Text filter โ€“ Could you please clarify what this refers to?
    2. Multiple choice filter โ€“ Are these the checkbox filters?
    3. Boolean filters โ€“ Are these referring to the "Sort by" filters?

    Once these points are clarified, Iโ€™ll be able to proceed accordingly.

    Thank you!

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia libbna New Delhi, India
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia libbna New Delhi, India

    Hey, Before creating an MR, I wanted to discuss the approach Iโ€™ve taken to update the layout of the filters.

    Iโ€™ve made the necessary code changes and attached a screenshot of the updated UI below for reference.

    In the Search.svelte

    <div class="boolean-filters-wrapper">
              {#each Object.entries(filterDefinitions) as [name, filter]}
                {#if filter._type === 'boolean'}
                  <BooleanFilter
                    definition={filter}
                    {name}
                    changeHandler={onFilterChange}
                  />
                {/if}
              {/each}
    </div> 

    Could you please review and let me know if this approach seems correct, or if youโ€™d suggest any changes or improvements?

    Thanks!

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

    That looks pretty good to me, and is in line with what I was imagining.

Production build 0.71.5 2024