[do not merge] Search UX v2 #5: sidebar tri-state filters#665
Draft
hoyla wants to merge 1 commit into
Draft
Conversation
hoyla
force-pushed
the
ljh-searchux-v2-pr4-search-page-modal
branch
from
April 9, 2026 09:52
f599bc6 to
175c82a
Compare
hoyla
force-pushed
the
ljh-searchux-v2-pr5-sidebar-tristate
branch
from
April 11, 2026 07:05
efdc14c to
3ed50dc
Compare
hoyla
force-pushed
the
ljh-searchux-v2-pr4-search-page-modal
branch
from
May 17, 2026 16:32
175c82a to
11de024
Compare
hoyla
force-pushed
the
ljh-searchux-v2-pr5-sidebar-tristate
branch
from
May 17, 2026 16:34
3ed50dc to
1cf2927
Compare
Merged
9 tasks
hoyla
force-pushed
the
ljh-searchux-v2-pr4-search-page-modal
branch
from
June 3, 2026 20:37
11de024 to
aa11b2e
Compare
Convert SearchSidebar.js to SearchSidebar.tsx with TypeScript types and chip-driven filters. The sidebar now reads the q (search query) from Redux and routes three filter keys to new components: - mimeType → FileTypeSidebarFilter: maps ES aggregation MIME buckets to FILE_TYPE_CATEGORIES using mimeToCategory(), shows category-level tri-state checkboxes (off→include→exclude→off), with expandable sub-items showing individual MIME counts. - workspace → TriStateSidebarSection: generic tri-state section that reads/writes workspace chips via setWorkspacesInQ. - ingestion → TriStateSidebarSection: reads/writes dataset chips via setDatasetsInQ. All other filter keys continue to use the existing SearchFilter component unchanged. The updateSelectedFilters callback now strips workspace/ingestion from legacy filter updates since those are now chip-driven. Both new components use the shared triStateCycle utility from PR2 for the off→positive→negative→off cycling logic, and the TriStateCheckbox component for rendering. Fix TriStateCheckbox import path for triStateCycle (was resolving to wrong directory). Add sidebar__mime-info SCSS class for indented MIME sub-items. Add FileTypeSidebarFilter.spec.tsx with 14 tests covering buildCategoryCounts, toggleCategory, getCategoryState, and toggleCategoryExpanded.
hoyla
force-pushed
the
ljh-searchux-v2-pr5-sidebar-tristate
branch
from
June 3, 2026 20:38
1cf2927 to
a2f101d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
THIS IS A PLACEHOLDER PR SO I CAN REMEMBER WHAT WAS DONE IN THIS BRANCH.
It'll probably get rewritten entirely should we actually get here.
Context
Part of the Search UX Improvements epic. Closes #637.
Important
This is the fifth and final PR in the Search UX Improvements epic.
Changes to the user experience
Tri-state sidebar checkboxes
Sidebar filter checkboxes now cycle through three states: unchecked (no filter) → checked/blue (include) → indeterminate/red (exclude). This applies to Workspace, Dataset, and File Type filters.
File type category grouping
File type sidebar filters are grouped by human-readable category (Documents, Spreadsheets, Images, Audio, etc.) with result counts from Elasticsearch aggregations. Categories can be expanded to show individual MIME types.
Sidebar ↔ chip synchronisation
Sidebar selections now read from and write to the chip-based
qparameter viachipParsinghelpers (setWorkspacesInQ,setDatasetsInQ,setFileTypeCategoriesInQ). This means sidebar changes are reflected in the active filter chips and URL, and vice versa.Bug fix
"Search this workspace" and "Search in folder" now embed workspace/folder as chips in
q(same fix as PR4, applied here since these files are also modified in this branch).What's included
SearchSidebar.js; integrates tri-state filter handling for workspaces, datasets, and file types. Reads positive/negative filter arrays from chips inq.FileTypeSidebarFilter.tsx) — new component grouping MIME types into categories usingfileTypeCategories, with tri-state checkboxes, aggregation counts, and expandable sub-categories.TriStateSidebarSection.tsx) — generic tri-state sidebar section (used for workspace and dataset filters) with expandable options, aggregation bucket counts, and off → include → exclude cycling._sidebar.scss) — styling updates for tri-state sidebar elements.TypeScript
SearchSidebar.jsconverted to TypeScript with full type annotations.Automated tests
FileTypeSidebarFilter.spec.tsx— unit tests with helpers for building mock ES aggregation buckets and constructing component instances with default props.Manual tests
Tested locally. Tested on playground.