Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/branch-review-ledger.md
Original file line number Diff line number Diff line change
Expand Up @@ -572,3 +572,4 @@ Records before 2026-07-28 were written by hand and had drifted: 146 lines carrie
| 2026-07-31 | PR #1542 | c028450b31441e272a04471292cd162f9c8c826b | documents filter sheet (C1) | Handoff. Moved the documents filter panel into ui/sheet.tsx: bottom sheet below sm, centred dialog above, header/footer split into the sheet slots, trigger upgraded to a dialog opener with aria-controls via Sheet's new id prop. Branch restarted from origin/main after PR #1536 merged and its branch was deleted; C1 cherry-picked on top rather than stacked on merged history. | verify:cheap exit 0 (457 files / 4780 tests); document-filter-panel.dom.test.tsx 9 passed incl. new dialog+Escape cases; ui-smoke documents journey 1 passed chromium; verify:phone-chrome stages green except the pre-existing PDF-canvas failure, focused-browser stage run directly 7 passed |
| 2026-07-31 | claude/sentry-agent-monitoring-eri94v | 38378ac78c0b288b6e93b638019653001f375042 | Sentry AI agent monitoring (OpenAI wrap, gen_ai scrubber allowlist, conversation id) | pass — metadata-only instrumentation; privacy boundary preserved | verify:pr-local,verify:cheap,typecheck,vitest 458 files green |
| 2026-07-31 | claude/top-search-design-mockups-w53znc | c09eb64918ae2956968d35f3253c405ed9b915d5 | therapy-compass filter sheet + documents review fixes (C2) | Therapy Compass's phone Topics/availability selects were faking multi-select (value pinned to "", literal check-prefix in option text, a Clear-filters action among the options); replaced with one sheet of aria-pressed toggles matching the wide viewport, in the tc- idiom. Also lands two CodeRabbit findings from merged PR #1542: sheet footer primary action to sm:min-h-12, and the dialog test now pins aria-expanded/aria-controls. Third finding (unmount skips focus restore) dispositioned no-change with a test pinning the scroll lock is not leaked. | verify:cheap exit 0 (458 files / 4785 tests); ui-accessibility.spec.ts 15 passed chromium incl. the rewritten Therapy Compass case; ui-smoke documents journey 1 passed chromium |
| 2026-08-01 | claude/top-search-design-mockups-w53znc | 4f4440fd6776742f5de203ee15295f372205321d | search results bar: scope-system deletion, filter shelf, bar anatomy | Handoff for PR #1555. Deleted the inert command-scope system (voided props, six modes' scope config, three matchers, four no-op call sites, the original shelf) — behaviour-preserving because every matcher early-returned true on a permanently-empty array. Rebuilt the applied-filter shelf prop-driven on live facet data, scoped to documents and therapy-compass. Landed the bar anatomy: tile spinner and funnel states, Filter to the right edge, Sort inboard. Study step 6 (remove the library button) deliberately declined — the nav route clears the query via onSearchModeChange. Ledger #182 closed. | verify:pr-local exit 0 (460 files / 4796 tests, production build, client-bundle secret scan, RAG fixtures 36 cases / 23 suites); ui-tools 87 passed; ui-smoke + ui-accessibility 108 passed 1 failed (pre-existing PDF-canvas test, fails identically stashed, Chromium 1194 vs pinned 1228); mutation-tested the shelf's survives-loading guard |
110 changes: 110 additions & 0 deletions docs/handoff-search-bar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Handoff — search results bar, `Results bar — perfected`

Branch `claude/top-search-design-mockups-w53znc`. Four commits on top of
`origin/main` (`40814b44`).

## Status

All four commits are verified. The `wip(search)` commit message calls itself
UNVERIFIED and points here — that caveat is **superseded**; it was written before
the gates ran, and history was not rewritten to correct it because the branch was
already pushed.

| Gate | Result |
| ----------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| `npm run verify:pr-local` | exit 0 — 460 files / 4796 tests, production build, client-bundle secret scan, RAG fixtures 36 cases / 23 suites |
| `tests/ui-tools.spec.ts` | 87 passed |
| `tests/ui-smoke.spec.ts` + `tests/ui-accessibility.spec.ts` | 108 passed, 1 failed |

The single failure is `document viewer puts the PDF preview first with pinned
evidence after it on mobile`, at `pdfScroller.locator("canvas")`. It fails
identically with these changes stashed — this box runs Chromium 1194 against the
project's pinned 1228. Do not chase it.

`ui-tools` was the one at genuine risk: it carried two assertions on the
Sort/Filter pair that this work deliberately separates, and it runs
`expectNoPageHorizontalOverflow` at 390 px straight after them. Both clear.

## Where the work came from

Artifact **`Results bar — perfected`** (`007a83f4-9922-4c96-ab13-47852605bdbe`),
its own seven-step build list. Current state of each:

| # | Step | State |
| --- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| 1 | Merge scope chips + source-type into the facet panel | Done — source-type merged in #1536; scope chips were inert, so `df8c3fb7` deletes rather than merges them |
| 2 | Counts against the same set, disable dead-end facets | Done (#1523 era) |
| 3 | Drop "of 12", use the mode's own noun | Done (#1523) |
| 4 | State tile, Filter right edge, Sort inboard | `6917e732` |
| 5 | The shelf — `Filtered by`, trailing Clear, survives zero result | Done (`cea1d1ca`) |
| 6 | Remove Sources from the results bar | **Deliberately not done** — see below |
| 7 | Decide OR-within-group | Done |

### Step 6 is declined, not pending

The study says corpus browsing belongs in nav and the bar button should go. It
explicitly declines to check where nav puts it. In this app the documents action
menu routes through `onSearchModeChange`, which calls `setQuery("")` and
`setModeSearchSubmitted(false)` (`ClinicalDashboard.tsx`), so reaching the
library that way **discards the search being read**. The bar button is the only
in-context route. It was renamed `Library` / `Open source library` instead. Do
not remove it without first giving nav a route that preserves the query.

### Step 4, what is actually left

The state tile already existed and already had its alert and search states.
`6917e732` adds the spinner and the funnel. What the study specifies and this
branch does **not** do:

- **Sort moves into the sheet on phone**, with the sheet retitled
`Filter and sort`. Not done, and it is per-page work: only documents and
therapy-compass have sheets. The other six modes would lose Sort on phone
entirely, which is the exact defect the study itself records fixing in an
earlier round. Do not do this in the shared band.

## Scope decisions worth not relitigating

The shelf is on **documents** and **therapy-compass** only. Both have
multi-valued filters hidden behind a panel. The other six modes
(differentials, prescribing, specifiers, formulation, services, factsheets)
have a single-select dimension whose control is already visible in the bar, so
a shelf would restate what is on screen.

Two related traps, both hit and corrected during this work:

- **Count what a control does, not how many there are.** Formulation's
"Pattern" and factsheets' "Category" look like filters and are navigation
(`router.push`). Services' "quick filter" rewrites the query. None of them
belong behind a filter surface.
- **A shared component must not read filter state from context.** The old shelf
pulled `commandScopes` from a context no page populated, so it passed a DOM
test that constructed the context by hand and rendered for nobody in
production. The new one is prop-driven: the page supplies `appliedFilters`
(`id`, `label`, `onRemove`). Keep it that way.

## Ledger

`#182` (inert command-scope system) is closed by `df8c3fb7`, with the outcome
recorded. `docs/outstanding-issues.md` conflicted on the rebase — `main` had
added `#183`–`#185` while this branch archived `#182`; resolved keeping both
sides. `npm run check:outstanding-issues` passes: 183 rows, 62 open, 121
archived, next-id 186.

**Not yet captured** and worth an `/issues` row: `ci.yml`'s "Sync PR policy
body" job reads `PR_POLICY_BODY.md` from the PR head and overwrites the PR
description with it. #1546 committed that scratch file to `main`, so every open
PR had its body replaced with #1546's content — and `pr-policy.mjs` parses the
body as merge-gating input, so governance checklists and verification claims
were showing on PRs they did not belong to. #1548 deleted the file, which fixes
it, but nothing records the underlying habit.

## Before opening the PR

- `classifyPullRequestFiles` against the **full** `origin/main...HEAD` diff, not
the tip commit. Getting this wrong on #1536 produced a governance section that
was checked for the wrong change.
- Assemble every commit before the first push. `cancel-in-progress: true` means
a second push cancels the in-flight run and `PR required` scores the
cancellation as a failure — that pattern cost this branch four CI runs.
- If auto-merge is armed, disable it before pushing anything further, then
re-enable.
Loading
Loading