Skip to content

[do not merge] Search UX v2 #2: shared utilities & Downshift dependency#662

Draft
hoyla wants to merge 2 commits intoljh-searchux-v2-pr1-chip-infrastructurefrom
ljh-searchux-v2-pr2-shared-utilities
Draft

[do not merge] Search UX v2 #2: shared utilities & Downshift dependency#662
hoyla wants to merge 2 commits intoljh-searchux-v2-pr1-chip-infrastructurefrom
ljh-searchux-v2-pr2-shared-utilities

Conversation

@hoyla
Copy link
Copy Markdown
Contributor

@hoyla hoyla commented Apr 3, 2026

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 #635.

Important

This is the second of five PRs in the Search UX Improvements epic.

PR1 Chip parsing infrastructure
 └─ PR2 Shared utilities & Downshift dependency  ← you are here
     └─ PR3 Active filter chips & multi-select
         └─ PR4 Search page & AddFilterModal
             └─ PR5 Sidebar tri-state filters

Changes to the user experience

This PR is purely infrastructure — no visible changes yet. It adds building blocks consumed by PR3–PR5.

What's included

  • Tri-state cycling logic (triStateCycle.ts) — pure functions for cycling filter values through off → include → exclude → off, with getTriState and triStateCycle helpers.
  • Chip display utilities (chipDisplayUtils.ts) — truncateChipDisplay() builds character-budget-aware display strings for multi-value chips (ellipsis truncation + "+N more" suffix), plus getDisplayLabel() for option lookups.
  • TriStateCheckbox component (TriStateCheckbox.tsx) — reusable checkbox rendering three visual states (blank, checked, indeterminate/negative) with colour-coded styling.
  • SCSS — new .checkbox--negative style using $excludeColour, plus hover state for negative checkboxes.
  • Downshift dependency — added to package.json for accessible multi-select dropdowns in PR3.

Automated tests

  • triStateCycle.spec.ts — 7 tests covering getTriState (4 cases) and triStateCycle (full cycle, immutability, preservation of other keys, empty arrays).

Manual tests

No visible changes to test.

@hoyla hoyla added feature Departmental tracking: work on a new feature ⚠️ do not merge labels Apr 3, 2026
@hoyla hoyla changed the title Search UX v2 #2: shared utilities & Downshift dependency [do not merge] Search UX v2 #2: shared utilities & Downshift dependency Apr 4, 2026
@hoyla hoyla force-pushed the ljh-searchux-v2-pr1-chip-infrastructure branch from 8bc39c8 to feb167c Compare April 9, 2026 09:46
hoyla added 2 commits April 9, 2026 10:48
Add Downshift dependency (headless accessible select/combobox hooks)
for use by multi-select dropdowns in later PRs.

Extract triStateCycle utility — pure function implementing the
off → positive → negative → off cycling shared by all tri-state
filter components. Includes comprehensive tests.

Add chipDisplayUtils — truncateChipDisplay and getDisplayLabel for
character-budget-aware chip value rendering.

Add TriStateCheckbox component — small functional component rendering
the three visual states (blank, checked, negated) using react-icons.

Update checkbox SCSS with tri-state colour rules using the shared
$excludeColour and $filterInactiveColour variables from PR1.
The module lives in ../Search/triStateCycle, not ./triStateCycle.
TriStateCheckbox is in UtilComponents/ so the relative path needs
to go up one level.
@hoyla hoyla force-pushed the ljh-searchux-v2-pr2-shared-utilities branch from 6b54f1a to a0e965e Compare April 9, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚠️ do not merge feature Departmental tracking: work on a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant