Session: you-are-a-senior-harmonic-dolphin-subagent-acc47e0d — 2026-04-27

workspace-doctolib · Claude · branch HEAD · claude-sonnet-4-6 · 2026-04-27 15:46 · 1 msgs · 29 tools · 15 min read · updated 9 days ago

Analyze test coverage quality for the PR on branch `fhir-2219_implement-multi-select-category-filter` in the...

tools: Bash
← workspace-doctolib Download .md .txt .json
Tool calls
Bash Bash: 29 calls (100.0%) 29
Token usage1.2M total
Input39
Cache creation100.3K
Cache read1.1M
Output4.9K
Cache hit ratio91%· healthy

Project: workspace-doctolib · Branch: HEAD · Mode: ` · **Model:**claude-sonnet-4-6`

Stats: 1 user messages, 29 tool calls, tools used: Bash.

Conversation

Turn 1 — User

Analyze test coverage quality for the PR on branch fhir-2219_implement-multi-select-category-filter in the treatment-plan repo at /Users/USER/workspace/doctolib/treatment-plan.

Run git diff origin/main...HEAD to see all changes.

Context

This PR implements a multi-select Document Category filter (FHIR-2219). New/changed test files: - MultiSelectDropdown.test.tsx — integration tests for the composite component - MultiSelectDropdownTrigger.test.tsx — unit tests for the trigger input - MultiSelectDropdownPopup.test.tsx — unit tests for the popup fieldset - MultiSelectDropdownLabel.test.tsx — unit tests for the label sub-component - MultiSelectDropdownOptions.test.tsx — unit tests for the checkboxes sub-component - hooks.test.tsx — tests for useDropdownClose - helpers.test.ts — tests for normalize - createNhrDocumentCategoryFilterConfig.test.tsx — factory tests - NhrDocumentCategoryFilter.test.tsx — wrapper component tests

Check: Are all acceptance criteria covered by tests? Are edge cases covered (empty options, disabled options, search filtering, click outside, Escape key, display label formats)? Are there gaps? Report findings with specific suggestions.

Turn 1 — Assistant

I'll analyze the test coverage for this PR by examining the changes and test files systematically.

Tools used:

  • Bash: cd /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2219_implement-multi-select-category-filter && git diff origin/main...HEAD --name-only 2>/dev/null || git diff origin/main...HEAD - …(truncated, 10 more chars)

Tools used:

  • Bash: ls /Users/USER/workspace/doctolib/worktrees/treatment-plan/ 2>/dev/null || echo "no worktrees dir"

Tool results:

→ result (ok): (eval):cd:1: no such file or directory: /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2219_implement-multi-select-category-filter packages/tpf-national-health-records-ui/package.json packages/tpf-national-health-records-ui/src/business/factories/filters/createNhrDocumentCategoryFilterConfig.test.tsx packages/tpf-national-health-records-ui/src/business/factories/filters/createNhrDocumentCategoryFilterConfig.tsx packages/tpf-national-health-records-ui/src/components/MultiSelectDropd …(truncated, 2033 more chars)

Tool results:

→ result (ok): fhir-2079 fhir-2081 fhir-2083 FHIR-2091-nhr-document-list-pagination fhir-2168_add-result-count-to-nhr-header fhir-2171 fhir-2214

Good, the branch is at /Users/USER/workspace/doctolib/treatment-plan. Let me read all the source and test files.

Tools used:

  • Bash: git diff origin/main...HEAD -- packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdown.tsx packages/tpf-national-health-records-ui/src/components/MultiSelectDrop …(truncated, 116 more chars)

Tool results:

→ result (ok): diff --git a/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdown.tsx b/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdown.tsx new file mode 100644 index 000000000..4a0656b65 --- /dev/null +++ b/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdown.tsx @@ -0,0 +1,88 @@ +import type { Option } from '@doctolib/design-system/Option' +import { useId, useMemo, useRef, useStat …(truncated, 4376 more chars)

Tools used:

  • Bash: git diff origin/main...HEAD -- packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdownTrigger.tsx packages/tpf-national-health-records-ui/src/components/MultiSel …(truncated, 255 more chars)

Tool results:

→ result (ok): diff --git a/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdownLabel.tsx b/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdownLabel.tsx new file mode 100644 index 000000000..aec0a3268 --- /dev/null +++ b/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdownLabel.tsx @@ -0,0 +1,10 @@ +type MultiSelectDropdownLabelProps = { + htmlFor: string + label: string +} + +export …(truncated, 4885 more chars)

Tools used:

  • Bash: git diff origin/main...HEAD -- packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdown.test.tsx packages/tpf-national-health-records-ui/src/components/MultiSelec …(truncated, 120 more chars)

Tool results:

→ result (ok): diff --git a/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdown.test.tsx b/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdown.test.tsx new file mode 100644 index 000000000..831c6da57 --- /dev/null +++ b/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdown.test.tsx @@ -0,0 +1,393 @@ +import { setup } from '@doctolib/test-helpers' +import { screen } from '@testing-libra …(truncated, 20468 more chars)

Tools used:

  • Bash: git diff origin/main...HEAD -- packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdownTrigger.test.tsx packages/tpf-national-health-records-ui/src/components/Mul …(truncated, 275 more chars)

Tool results:

→ result (ok): diff --git a/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdownLabel.test.tsx b/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdownLabel.test.tsx new file mode 100644 index 000000000..f678db5d5 --- /dev/null +++ b/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdownLabel.test.tsx @@ -0,0 +1,35 @@ +import { setup } from '@doctolib/test-helpers' +import { screen } from ' …(truncated, 14966 more chars)

Tools used:

  • Bash: git diff origin/main...HEAD -- packages/tpf-national-health-records-ui/src/business/factories/filters/createNhrDocumentCategoryFilterConfig.test.tsx packages/tpf-national-health-records-ui/src/busines …(truncated, 325 more chars)

Tool results:

→ result (ok): diff --git a/packages/tpf-national-health-records-ui/src/business/factories/filters/createNhrDocumentCategoryFilterConfig.test.tsx b/packages/tpf-national-health-records-ui/src/business/factories/filters/createNhrDocumentCategoryFilterConfig.test.tsx index cabf73685..9b85ff7ba 100644 --- a/packages/tpf-national-health-records-ui/src/business/factories/filters/createNhrDocumentCategoryFilterConfig.test.tsx +++ b/packages/tpf-national-health-records-ui/src/business/factories/filters/createNhrDocum …(truncated, 14849 more chars)

Now I have a thorough view of all the source and test files. Let me do a final check on one specific edge case in the source logic.

Tools used:

  • Bash: grep -n "displayLabel\|firstLabel\|values.length" /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdown.tsx …(truncated, 11 more chars)

Tool results:

→ result (ok): 40: const displayLabel = useMemo(() => { 41: const firstLabel = options.find((o) => values.includes(o.value))?.label ?? '' 42: if (values.length === 0 || firstLabel === '') return '' 43: return values.length === 1 ? firstLabel : ${firstLabel}, +${values.length - 1} 68: displayLabel={displayLabel} 71: hasValues={values.length > 0}

Tools used:

  • Bash: grep -n "normalize\|trim\|searchQuery" /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdown.tsx 2>/dev/null

Tool results:

→ result (ok): 7:import { normalize } from './helpers' 28: const [searchQuery, setSearchQuery] = useState('') 47: const q = normalize(searchQuery.trim()) 48: return q ? options.filter((o) => normalize(o.label).includes(q)) : options 49: }, [options, searchQuery]) 69: searchQuery={searchQuery}

Tools used:

  • Bash: grep -n "onClear\|handleClear\|handleInputClick\|setIsOpen\|close()" /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/Multi …(truncated, 30 more chars)

Tool results:

→ result (ok): 16: onClear: () => void 25: onClear, 27: const [isOpen, setIsOpen] = useState(false) 34: setIsOpen(false) 51: const handleClear = () => { 52: onClear() 53: close() 56: const handleInputClick = () => { 57: if (!isOpen) setIsOpen(true) 73: onInputClick={handleInputClick} 74: onClear={handleClear}

Tools used:

  • Bash: grep -rn "role.*dialog\|aria-label\|aria-controls\|aria-expanded\|aria-haspopup\|aria-autocomplete" /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/compo …(truncated, 71 more chars)

Tool results:

→ result (ok): /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdownPopup.tsx:16: role='dialog' /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdownPopup.tsx:17: aria-label={label} /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdownTrigger.tsx:3 …(truncated, 585 more chars)

Tools used:

  • Bash: grep -n "aria-controls\|popupId\|triggerId" /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdown.tsx 2>/dev …(truncated, 5 more chars)

Tool results:

→ result (ok): 30: const triggerId = useId() 31: const popupId = useId() 62: <MultiSelectDropdownLabel htmlFor={triggerId} label={label} /> 65: triggerId={triggerId} 66: popupId={popupId} 78: id={popupId}

Tools used:

  • Bash: grep -n "searchQuery\|whitespace\|trim" /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdown.test.tsx 2>/de …(truncated, 6 more chars)

Tool results:

→ result (ok): (Bash completed with no output)

Tools used:

  • Bash: grep -n "aria-controls\|aria-controls points\|triggerId.*popupId\|id={popupId}\|aria-controls={popupId}" /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/ …(truncated, 71 more chars)

Tool results:

→ result (ok): 315: it('should always set aria-controls', () => { 318: expect(screen.getByRole('combobox', { name: 'Category' })).toHaveAttribute('aria-controls')

Tools used:

  • Bash: grep -n "Tab\|keyboard\|focus\|tabIndex" /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdown.test.tsx 2>/d …(truncated, 7 more chars)

Tool results:

→ result (ok): 178: it('should close dropdown when Escape is pressed while trigger has focus', async () => { 184: await user.keyboard('{Escape}') 189: it('should close dropdown when Escape is pressed while a checkbox has focus', async () => { 193: screen.getByRole('checkbox', { name: 'Report A' }).focus() 196: await user.keyboard('{Escape}') 321: it('should close dropdown when Escape is pressed while focus is on an unrelated element', async () => { 325: document.body.focus() 327: await user.k …(truncated, 59 more chars)

Tools used:

  • Bash: grep -n "aria-controls" /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdown.test.tsx 2>/dev/null

Tool results:

→ result (ok): 315: it('should always set aria-controls', () => { 318: expect(screen.getByRole('combobox', { name: 'Category' })).toHaveAttribute('aria-controls')

Tools used:

  • Bash: grep -n "whitespace\|spaces\|' '\|trim\| " /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/helpers.test.ts 2>/dev/null

Tool results:

→ result (ok): 6: it('should return an empty string for empty input', () => { 7: expect(normalize('')).toBe('') 8: }) 10: it('should lowercase ASCII text', () => { 11: expect(normalize('HELLO')).toBe('hello') 12: }) 14: it('should strip French diacritics', () => { 15: expect(normalize('Médecin')).toBe('medecin') 16: }) 18: it('should strip German diacritics', () => { 19: expect(normalize('über')).toBe('uber') 20: }) 22: it('should strip diacritics and lowercase combined', () => { 23: ex …(truncated, 197 more chars)

Tools used:

  • Bash: grep -n "onClear\|handleClear" /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdown.test.tsx 2>/dev/null

Tool results:

→ result (ok): 27: onClear={vi.fn()} 149: it('should call onClear when clear button is clicked', async () => { 150: const onClear = vi.fn() 151: const { user } = renderComponent({ values: ['A'], onClear }) 155: expect(onClear).toHaveBeenCalled() 264: onClear={vi.fn()} 282: onClear={vi.fn()}

Tools used:

  • Bash: grep -n "it('should\|describe(" /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdown.test.tsx 2>/dev/null | …(truncated, 9 more chars)

Tool results:

→ result (ok): 14:describe('MultiSelectDropdown', () => { 32: it('should render the label and associate it with the trigger', () => { 38: it('should show placeholder when no values are selected', () => { 44: it('should show the matching option label when one value is selected', () => { 50: it('should show "firstLabel, +N" when multiple values are selected', () => { 56: it('should show empty trigger when selected values do not match any option', () => { 62: it('should show the first option in options orde …(truncated, 2872 more chars)

Tools used:

  • Bash: grep -n "aria-controls.*equal\|aria-controls.*popupId\|aria-controls.*same\|toHaveAttribute.*aria-controls.*:" /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-u …(truncated, 77 more chars)

Tool results:

→ result (ok): (Bash completed with no output)

Tools used:

  • Bash: grep -n "aria-controls.*equal\|aria-controls.*same\|aria-controls.*id\|id.*popup\|getElementById" /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/compone …(truncated, 71 more chars)

Tool results:

→ result (ok): (Bash completed with no output)

Tools used:

  • Bash: grep -n "aria-controls" /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdownTrigger.test.tsx 2>/dev/null

Tool results:

→ result (ok): 63: it('should set aria-controls to popupId', () => { 66: expect(screen.getByRole('combobox')).toHaveAttribute('aria-controls', 'my-popup')

Tools used:

  • Bash: grep -n "searchQuery.*spaces\|whitespace\|' '\|type.*' '" /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropd …(truncated, 24 more chars)

Tool results:

→ result (ok): (Bash completed with no output)

Tools used:

  • Bash: grep -n "displayLabel\|+N\|values.length === 1\|only one value\|one selected" /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/MultiSelectDropd …(truncated, 55 more chars)

Tool results:

→ result (ok): 50: it('should show "firstLabel, +N" when multiple values are selected', () => { 74: it('should include unknown values in the +N count when they appear after a known value', () => { 80: it('should include unknown values in the +N count when they appear before a known value', () => {

Tools used:

  • Bash: grep -n "values.*\['A', 'B'\]\|two values\|exactly two" /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdow …(truncated, 22 more chars)

Tool results:

→ result (ok): (Bash completed with no output)

Tools used:

  • Bash: grep -n "values.*\['A', 'B'\]" /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdown.test.tsx 2>/dev/null

Tool results:

→ result (ok): (Bash completed with no output)

Tools used:

  • Bash: grep -n "role.*combobox.*aria-controls\|trigger.*popup.*same\|aria-controls.*popup.*id" /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/MultiS …(truncated, 54 more chars)

Tool results:

→ result (ok): (Bash completed with no output)

Tools used:

  • Bash: grep -n "it('should show.*+1\|Report A, +1\|'A', 'B'" /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdown. …(truncated, 20 more chars)

Tool results:

→ result (ok): 51: renderComponent({ values: ['A', 'B', 'C'] }) 65: expect(screen.getByDisplayValue('Report A, +1')).toBeInTheDocument() 69: renderComponent({ values: ['UNKNOWN', 'A', 'B'] }) 77: expect(screen.getByDisplayValue('Report A, +1')).toBeInTheDocument() 83: expect(screen.getByDisplayValue('Report A, +1')).toBeInTheDocument()

Tools used:

  • Bash: grep -n "'B', 'A'\|'A', 'B'" /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/MultiSelectDropdown/MultiSelectDropdown.test.tsx 2>/dev/null

Tool results:

→ result (ok): 51: renderComponent({ values: ['A', 'B', 'C'] }) 63: renderComponent({ values: ['B', 'A'] }) 69: renderComponent({ values: ['UNKNOWN', 'A', 'B'] })

I now have a complete picture of the entire PR. Let me compile my analysis.


Test Coverage Analysis: fhir-2219_implement-multi-select-category-filter

Summary

The test suite is comprehensive and follows good behavioral testing practices throughout. Tests use @testing-library/react idioms consistently (querying by role, not by CSS), avoid testing implementation details, and cover the happy path and most important edge cases thoroughly. The suite is notably strong on ARIA attributes, keyboard interactions, event listener lifecycle, and the displayLabel computation logic. The small number of gaps identified below are genuine behavioral blind spots in the source code, not academic completeness issues.


Critical Gaps (8-10)

1. aria-controls does not point to the actual popup id at the integration level — currently untested Rating: 8

The trigger's aria-controls and the popup's id are both derived from useId() and passed through props. The only test that checks aria-controls is in MultiSelectDropdownTrigger.test.tsx, which passes a literal popupId='my-popup' string — it cannot detect the wiring bug where triggerId and popupId are swapped in the parent, or where the popup is rendered with the wrong id. No test in MultiSelectDropdown.test.tsx asserts that aria-controls on the combobox equals the id attribute on the open popup element.

This is a real regression risk: a refactor that accidentally swaps triggerId/popupId in MultiSelectDropdown.tsx would silently break the AT-navigable relationship between the combobox and the listbox, but all existing tests would still pass.

Suggested test (in MultiSelectDropdown.test.tsx):

it('should wire aria-controls on the trigger to the id of the open popup', async () => {
  const { user } = renderComponent()
  await user.click(screen.getByRole('combobox', { name: 'Category' }))

  const controlsId = screen.getByRole('combobox', { name: 'Category' }).getAttribute('aria-controls')
  expect(document.getElementById(controlsId!)).toBe(screen.getByRole('dialog'))
})

2. Whitespace-only search query shows no results instead of all options — untested Rating: 8

In MultiSelectDropdown.tsx, filtering uses normalize(searchQuery.trim()). If the user types only spaces (), trim() returns an empty string, q is falsy, and all options should be shown. This is correct behaviour but it is never tested. The risk is that a future change to the filter pipeline (e.g. moving trim() to a different place or removing it) causes whitespace-only input to filter out all options, producing a confusing empty state. This is a subtle UX regression that tests would catch.

Suggested test (in MultiSelectDropdown.test.tsx):

it('should show all options when the search query contains only whitespace', async () => {
  const { user } = renderComponent()
  await user.click(screen.getByRole('combobox', { name: 'Category' }))
  await user.type(screen.getByRole('combobox', { name: 'Category' }), '   ')

  expect(screen.getByRole('checkbox', { name: 'Report A' })).toBeInTheDocument()
  expect(screen.getByRole('checkbox', { name: 'Report B' })).toBeInTheDocument()
  expect(screen.getByRole('checkbox', { name: 'Report C' })).toBeInTheDocument()
})

Important Improvements (5-7)

3. displayLabel for exactly two selected values is not explicitly tested Rating: 6

The +N label is tested with 3 values (['A', 'B', 'C']"Report A, +2") and indirectly with 2 (['B', 'A']"Report A, +1"). However, the boundary values.length === 1 branch is what separates the firstLabel path from the firstLabel, +N path. The exact "firstLabel, +1" form for two selections (the smallest +N case) is only reached incidentally via the 'B', 'A' options-order test, not as an explicit two-value scenario.

This matters because the values.length === 1 ? firstLabel : \${firstLabel}, +${values.length - 1}`expression usesvalues.length - 1, so two selected values is the tightest boundary test for that arithmetic. A test that sets exactlyvalues: ['A', 'B']and expects'Report A, +1'` would pin this down explicitly.


4. NhrDocumentCategoryFilter wrapper's test does not verify it is a transparent pass-through — multi-select display label is only confirmed with a single value Rating: 5

NhrDocumentCategoryFilter.test.tsx has only one display-label test (values: ['A']Report A). Because NhrDocumentCategoryFilter is now a pure wrapper ((props) => <MultiSelectDropdown {...props} />), this file mainly confirms the contract hasn't regressed. A test covering multiple selected values in NhrDocumentCategoryFilter would ensure that if the wrapper ever gains prop transformation logic again (as it previously had), regressions in the +N path are caught at this layer.


5. createNhrDocumentCategoryFilterConfig does not test toggling the same option twice in sequence (add then remove) Rating: 5

The factory's onToggle logic deduplicates using selectedValues.includes(value). The test suite tests add and remove as separate cases but does not test the two-step round-trip: toggle A in (expect ['A']), then toggle A out (expect []). Since selectedValues inside render() is derived from filters.typeCodes on each render, this logic is stateless-safe, but a test that exercises both branches in sequence in the same render tree would more closely simulate actual usage and would catch any mutation bug in the [...selectedValues, value] spread.


6. hooks.test.tsx does not test pointer events that originate inside a child element nested deeply within the container Rating: 5

useDropdownClose calls containerRef.current.contains(e.target). The existing test clicks screen.getByTestId('container') itself (the root container div). A click on a deeply-nested child (e.g. a checkbox label inside the popup) should also not close the dropdown. This scenario is implicitly covered by the integration tests in MultiSelectDropdown.test.tsx (clicking a checkbox keeps the dropdown open), but the unit test for the hook itself never exercises contains() with a descendant target. Adding this to hooks.test.tsx would give the hook a standalone regression test for the contains-check logic.


Test Quality Issues

7. MultiSelectDropdown.test.tsx line 315 — aria-controls assertion is too weak

it('should always set aria-controls', () => {
  renderComponent()
  expect(screen.getByRole('combobox', { name: 'Category' })).toHaveAttribute('aria-controls')
})

This only asserts the attribute is non-null. It does not assert a non-empty string, and it will not catch the case where aria-controls is set to an empty string (""). Combining this with the wiring test described in gap #1 would make it much more useful. As a standalone test this provides minimal protection.


8. Duplicated coverage between MultiSelectDropdownPopup.test.tsx, MultiSelectDropdownOptions.test.tsx, and MultiSelectDropdown.test.tsx

The three files test identical scenarios (checked state, disabled options, onToggle) in overlapping ways. This is not a correctness problem, but the duplication means that if the Checkbox component's API changes, there are many places to update. The popup-level and options-level unit tests are valuable for isolating the sub-component contracts; the integration test repeating them adds maintenance burden with limited additional bug-catching benefit. This is a minor style concern, not a coverage gap.


Positive Observations

  • Event listener lifecycle is tested with exceptional care: attach on open, detach on close, detach on unmount, and the stale-closure problem (callback ref pattern) are all explicitly covered in hooks.test.tsx and mirrored in MultiSelectDropdown.test.tsx. This prevents a class of memory-leak and stale-callback bugs.

  • Diacritic normalization is tested a …(truncated, 1344 more chars)

Keyboard shortcuts

⌘K / Ctrl+KOpen command palette
/Focus search
g hGo to home
g pGo to projects
g sGo to sessions
j / kNext / prev row (tables)
?Show this help
EscClose dialogs

Structured queries

Mix key:value filters with free text in the palette:

type:sessionOnly session pages
project:llm-wikiFilter by project name (substring)
model:claudeFilter by model name (substring)
date:>2026-03-01Sessions after a date
date:<2026-04-01Sessions before a date
tags:rustPages mentioning a tag/topic
sort:dateSort results by date (newest first)

Example: type:session project:llm-wiki date:>2026-04 sort:date