feat(therapy-compass): converge filter sheet onto the shared contract - #1885
Conversation
Retires the bespoke TherapyFilterTrigger/TherapyFilterSheet in favour of ResultFilterTrigger/ResultFilterSheet/ResultFilterFacetChips, the shared components every other converged mode already uses. Two facet groups (Topics, Availability) now feed both the desktop rail and the phone sheet from one source, closing the last item in /issues #170. Two decisions this PR resolves rather than silently changes, both stated here per docs/filter-contract.md's own rollout convention: - onClearAll vs the query: the old sheet's Clear all wiped the search query too (phone-only, deliberate). That contradicted filter-contract.md section 6 ("onClearAll never touches the query"). The phone-only justification no longer holds — the shared composer already renders its own always-visible clear-query control at every viewport (master-search-header.tsx) — so onClearAll now wires to clearSearchFilters (filters only), matching the invariant. No contract change needed. - AND-within-group tags: therapy's Topics predicate (select.ts's wantTags.every) narrows rather than widens, unlike the contract's OR-within-group default for facets. This is mode-owned filtering logic the shared component's kind type doesn't dictate, so it stays unchanged; only the UI layer converges. Hint counts are computed by re-running the real predicate with each candidate added, which stays honest either way. Also updates the Playwright and vitest coverage that pinned the retired component's exact shape, and regenerates the design-system adoption manifest. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TtjsdU7PRAKYHV98XJRMF6
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in:24 minutes Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
Comment |
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TtjsdU7PRAKYHV98XJRMF6
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:83d6f9bd41
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Uh oh!
There was an error while loading. Please reload this page.
BigSimmo
commented
Aug 12, 2026
@codex resolve actionable Codex review findings for this pull request and current head using the repository instructions. This is the pull request's single automatic repair pass: do not perform a fresh review, create new standalone findings, or request another review. Work only the existing unresolved Codex threads on the current head. The only repository destination is BigSimmo/Database, and the only branch destination is the pull request head branch claude/prompt-e-completion-review-rk38cm at starting commit 23f5909; never publish fixes to a detached or synthetic work branch and never create a stacked pull request. Use the authenticated GitHub connector to commit each approved fix to BigSimmo/Database:claude/prompt-e-completion-review-rk38cm, then verify that the pull request head contains the published commit before reporting success. Always fix P0 and P1 findings. For P2 and lower findings, fix only clear, scoped, low-risk issues; otherwise disposition them with a concise reason. For a fixed thread, reply with as the first line and as the second line. For a no-code disposition, use followed by . These result markers authorize the workflow to close that exact thread only after it verifies a fixed commit is the pull request head; a local-only commit is not a fix. If publication or verification fails, do not use either result marker, do not claim success, and leave the thread open with the blocker. If human input or new authorization is required, do the same. Finish only after every actionable thread is fixed or dispositioned and closed, or explicitly left open for a human decision. Do not update the branch from main, address unrelated reviews, broaden scope, or create more than one scoped fix commit. Do not use external APIs, paid services, credentials, dependency changes, or broad refactors unless explicitly authorized. Add targeted tests where behavior changes and run the narrowest relevant validation. |
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
BigSimmo
commented
Aug 12, 2026
Disposition: the reported query-clear defect is already fixed on the current head |
BigSimmo
commented
Aug 12, 2026
@claude This PR is currently |
Hi @BigSimmo — thanks for the @claude mention. Open this in Claude Code on the web to continue here: https://claude.ai/code Context: Automated backlink from the Claude backlink workflow. Claude Code can pick up the mention and push a scoped fix to the branch. |
Claude encountered an error after 2s —— View job I'll analyze this and get back to you. |
CI triageCI failed on this PR. Automated classification of the 3 failed job(s):
Compared with main CI run #10317 (success). Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger. |
BigSimmo
commented
Aug 12, 2026
Fixed the required CI issues on the current head: the Therapy clear-search button now uses the shared |
BigSimmo
commented
Aug 13, 2026
@claude Please main-sync this PR from exact head This is a competing Therapy filter-convergence variant. Preserve its verified query-reset behavior and existing focused test, but also retain all newer Run the focused Therapy filter-sheet/mode-wiring/clear-search tests, the relevant accessibility selector, design-system/adoption checks if those files remain changed, typecheck and format. Report the new head and exact outcomes. |
Hi @BigSimmo — thanks for the @claude mention. Open this in Claude Code on the web to continue here: https://claude.ai/code Context: Automated backlink from the Claude backlink workflow. Claude Code can pick up the mention and push a scoped fix to the branch. |
Claude encountered an error after 2s —— View job I'll analyze this and get back to you. |
BigSimmo
commented
Aug 13, 2026
@copilot Merge This is a competing Therapy filter-convergence variant. Preserve its tested filters-only Clear all/query-reset behavior, but retain all current-main Therapy catalogue aliases, filter semantics, navigation and accessibility fixes. For shared Run focused Therapy filter-sheet/mode-wiring/clear-search tests, relevant accessibility and design-system/adoption checks, ledger/issues integrity/write-discipline, typecheck and format. Report the pushed 40-character SHA and exact outcomes. |
Preserve the competing Therapy filter implementation and focused tests while retaining current-main shared ledgers and generated design-system snapshots for regeneration on the combined tree.
Uh oh!
There was an error while loading. Please reload this page.
Final post-merge audit complete for PR #1885.
Findings and dispositions
Exact-head CI
Advisory checks
Ledger and residual riskNo ledger-only or canonical outstanding-issues mutation was added. The final branch had no delta, and current GitHub auto-merged the PR on 13 August 2026 at 12:03 pm AWST ( |
Summary
TherapyFilterTrigger/TherapyFilterSheet(src/components/therapy-compass/filter-sheet.tsx, now deleted) in favour of the sharedResultFilterTrigger/ResultFilterSheet/ResultFilterFacetChips(src/components/clinical-dashboard/result-filter-control.tsx) that every other converged mode already uses — the last unclosed item in/issues #170.resultFilterFacetGroup()groups (Topics — 6 tags, Availability — reviewed/brief) now feed both the desktop rail and the phone sheet from one source, following the patternformulation-home-page.tsxestablished, so the two breakpoints cannot drift.docs/design-system/adoption-manifest.json/COMPONENTS.md(the deleted file was a tracked consumer) and updates the Playwright/vitest coverage that pinned the retired component's exact shape.Two decisions this PR resolves (not silently changes)
Per
docs/filter-contract.md's own rollout convention, each mode PR states any conflict between the contract and a local decision, rather than resolving it quietly:onClearAllvs the query. The old sheet's Clear all wiped the search query too, on phone only, deliberately — the code carried a comment explaining it was the phone's only route to clear the query. That contradicteddocs/filter-contract.md§6: "onClearAllnever touches the query." I verified the phone-only justification no longer holds: the shared global composer (GlobalSearchShell→MasterSearchHeader) already renders its own always-visible "×" clear-query button at every viewport (master-search-header.tsx:1911-1920, wired viaonClearQuery→global-search-shell.tsx:851-854), and this same file already treats "clear search" as distinct from "clear filters" elsewhere (SearchResultsEmptyState'sonClearSearchprop). Resolution:onClearAllnow wires toclearSearchFilters(filters only), matching the invariant. No contract change needed — the sheet's double-duty clear was redundant, not load-bearing.AND-within-group tags. Therapy's Topics predicate (
select.ts'swantTags.every(...)) narrows as more tags are selected (a therapy must carry every selected tag), not the contract's default OR-within-group (§3: adding an option widens). This is mode-owned filtering logic the shared component'skind: "facet"type doesn't dictate — it only governs selection cardinality and rendering, not AND/OR combination. Resolution: leftselect.tsunchanged; only the UI layer converges. Hint counts are computed by re-running the real predicate with each candidate added (same techniqueformulation-home-page.tsxuses), which stays honest whether the underlying combination is AND or OR.Verification
npm run verify:pr-local— full run (executable/UI scope):check:runtime,check:installed-lock-parity,format:changed,sitemap:check,docs:check-index,docs:check-inventory,docs:check-scripts,docs:check-links,check:branch-review-ledger,check:outstanding-issues,lint,typecheck,test,build,check:rag:fixtures— all completed, none failed.npm run test(full suite, read the summary line, not exit code):Test Files 563 passed (563)/Tests 6144 passed | 4 skipped (6148).npm run check:bundle-budgetafter a freshrm -rf .next && npm run build: production1304.1 KiB gzip(baseline1279.1 KiB, within tolerance), mockups294.5 KiB gzip(baseline267.5 KiB, within tolerance).npm run format— no changes (already clean viaformat:changedinside the gate).npm run verify:ui: known-blocked in this environment (/issues #255— Playwright wants chromium-1234, only chromium-1194 installed). Covered instead by the full offlinenpm run testrun (tests/ui-accessibility.spec.ts's therapy-compass block updated for the new component and passing under vitest's jsdom harness, plus 17 other therapy-compass wiring/behavior tests) and manual review of the shared component's existing production usage in formulation/differentials/medication/applications/specifiers, which already prove the breakpoint behavior this PR reuses unchanged.classifyPullRequestFileson this diff returnsclinicalRisk: false,operationalRisk: false,ragRanking: false— no Clinical Governance Preflight or RAG impact statement required.Risk and rollout
filter-sheet.tsxis recoverable from git history if needed.Notes
/issues #170updated to reflect therapy-compass's convergence; remaining items are services, factsheets, and documents (last).npm run ledger:appendfor this review.Generated by Claude Code