[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
Draft
[do not merge] Search UX v2 #2: shared utilities & Downshift dependency#662hoyla wants to merge 2 commits intoljh-searchux-v2-pr1-chip-infrastructurefrom
hoyla wants to merge 2 commits intoljh-searchux-v2-pr1-chip-infrastructurefrom
Conversation
8bc39c8 to
feb167c
Compare
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.
6b54f1a to
a0e965e
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 #635.
Important
This is the second of five PRs in the Search UX Improvements epic.
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
triStateCycle.ts) — pure functions for cycling filter values through off → include → exclude → off, withgetTriStateandtriStateCyclehelpers.chipDisplayUtils.ts) —truncateChipDisplay()builds character-budget-aware display strings for multi-value chips (ellipsis truncation + "+N more" suffix), plusgetDisplayLabel()for option lookups.TriStateCheckbox.tsx) — reusable checkbox rendering three visual states (blank, checked, indeterminate/negative) with colour-coded styling..checkbox--negativestyle using$excludeColour, plus hover state for negative checkboxes.package.jsonfor accessible multi-select dropdowns in PR3.Automated tests
triStateCycle.spec.ts— 7 tests coveringgetTriState(4 cases) andtriStateCycle(full cycle, immutability, preservation of other keys, empty arrays).Manual tests
No visible changes to test.