SCIX-893 feat(search): add title quickfield and all-terms modal - #908
SCIX-893 feat(search): add title quickfield and all-terms modal#908thostetler wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #908 +/- ##
========================================
+ Coverage 67.9% 67.9% +0.1%
========================================
Files 356 355 -1
Lines 41871 41749 -122
Branches 2193 2199 +6
========================================
- Hits 28404 28344 -60
+ Misses 13418 13358 -60
+ Partials 49 47 -2
🚀 New features to boost your workflow:
|
7531c0a to
d286395
Compare
d286395 to
fa107dc
Compare
There was a problem hiding this comment.
Pull request overview
Risk summary
Moderate risk. The UI refactor is contained to the SearchBar quickfields/all-terms picker, but it introduces (1) a likely failing unit test due to responsive display behavior in jsdom, and (2) an accessibility regression vs the previous Downshift combobox unless ARIA listbox/option semantics are added.
Changes:
- Add
titleas a quickfield and derive quickfields fromallSearchTermsby id (single source of truth). - Replace the all-terms combobox dropdown with a modal-based command-palette (filter, keyboard nav, detail pane with sanitized HTML).
- Add breakpoint-based quickfield reveal (trailing fields hidden first on small screens) and update tests accordingly.
Findings (priority order)
blocker
- Unit test clicks a quickfield that is intentionally hidden at the base breakpoint (likely non-interactable in jsdom), causing
user.clickto fail.- Location:
src/components/SearchBar/__tests__/SearchBar.test.tsx(new “title quickfield…” test)
- Location:
high
- Accessibility regression: the modal list and rows need listbox/option semantics (and active-descendant wiring) to support assistive tech comparable to the previous Downshift implementation.
- Location:
src/components/SearchBar/AllSearchTermsModal.tsx
- Location:
medium
- Potential O(n²) render cost from
items.indexOf(option)insideoptions.mapover a largeallSearchTermslist.- Location:
src/components/SearchBar/AllSearchTermsModal.tsx
- Location:
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/SearchBar/QuickFields.tsx | Adds title quickfield, derives items per mode, and applies breakpoint-based display to trailing quickfields. |
| src/components/SearchBar/models.ts | Derives quickfields from allSearchTerms by id to keep metadata in one place; adds title to quickfield lists. |
| src/components/SearchBar/index.ts | Re-exports the new modal component instead of the removed dropdown. |
| src/components/SearchBar/AllSearchTermsModal.tsx | New modal-based all-terms picker with filtering, keyboard navigation, and a sanitized detail pane. |
| src/components/SearchBar/AllSearchTermsDropdown.tsx | Removes the old combobox dropdown implementation. |
| src/components/SearchBar/tests/SearchBar.test.tsx | Updates tests for the modal and adds coverage for title presence/insertion behavior. |
Comments suppressed due to low confidence (2)
src/components/SearchBar/AllSearchTermsModal.tsx:121
- The menu container is missing list semantics, which makes the modal harder to use with assistive tech compared to the previous Downshift combobox. Adding
role="listbox"(and a stableidforaria-controls) improves screen reader support and aligns with the keyboard navigation behavior implemented in the input.
<Box maxH="360px" overflowY="auto" data-testid="allSearchTermsMenu">
src/components/SearchBar/AllSearchTermsModal.tsx:145
- Each clickable row is rendered as a plain with mouse handlers but without option semantics. Adding
role="option"/aria-selected(and a stableid) improves accessibility and allowsaria-activedescendanton the input to reference the active row.
<Flex
key={option.id}
ref={isActive ? activeRowRef : undefined}
px={4}
py={2}
shinyichen
left a comment
There was a problem hiding this comment.
Looks good. I just want to point out that descriptions contain links, and with a mouse it is very hard to get to the link. If I move my mouse down towards the description area, the description would have moved to another term. I could move my mouse outside the modal, than down than towards the description, but we shouldn't expect users to do that. I wonder if the description can be moved to the right side to resolve that problem.
Screen.Recording.2026-08-03.at.2.24.25.PM.mov
|
@shinyichen good point, let me think about how to handle links here |
The quickfields row lacked a title field, and its all-terms combobox used a cramped 200px input with a popper tooltip that was itself hidden below md. - Add title as the trailing quickfield in default and BIO_PHYSICAL_SCIENCE - Derive quickfields from allSearchTerms by id to drop the duplicated copies - Replace the combobox with an icon-button trigger opening a command-palette modal (matchSorter filter, grouped browse list, keyboard nav, detail pane with sanitized description plus full syntax and examples) - Reveal quickfields by breakpoint so trailing fields drop first on small screens; the trigger label collapses to icon-only there too - Keep the data-tour quick-fields and all-search-terms hooks intact - Fix latent quickfields type to require only default and allow per-mode overrides
Address PR review feedback on the all-search-terms modal. - Move detail pane beside the list (stacks on mobile) so description links are reachable without hover-selection swapping the term - Fix rel/target on description links (ref typo) and force safe new-tab anchors via a scoped DOMPurify hook - Add listbox/option roles, stable ids, and aria-activedescendant - Precompute id->index map to drop O(n^2) row indexing - Widen modal and pin columns so long syntax tokens do not shrink the list
47c8f2b to
c62e2b0
Compare
|
Kooha-2026-08-05-08-36-07.webm |
|
@shinyichen if you wouldn't mind, please check this out one more time. Thanks! |
The quickfields row lacked a title field, and its all-terms combobox used a cramped 200px input with a popper tooltip that was itself hidden below md.
Ticket: SCIX-893 and SCIX-894.
demo: Kooha-2026-07-30-16-29-43.webm