diff --git a/docs/branch-review-ledger.md b/docs/branch-review-ledger.md index 23846686..0b4ce304 100644 --- a/docs/branch-review-ledger.md +++ b/docs/branch-review-ledger.md @@ -20,6 +20,7 @@ Use this ledger to prevent repeated branch and PR reviews when the reviewed HEAD | Date | Branch or ref | Reviewed HEAD | Scope | Outcome | Checks | | ---------- | -------------------------------------------------------- | ---------------------------------------- | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 2026-07-18 | PR batch screenshot queue → #853 / cursor/pr-queue-land-3084 | 11ec0122f (tip of cursor/pr-queue-land-3084) | open-PR review + merge babysit | Reviewed screenshot PRs #833/#837/#845–#852 + Communication #19. #852/#848 already merged. Closed superseded/unsafe: #833/#837 (empty vs main), #845 (clinical-search over-expand; fixed in #853), #846/#847/#849 (Production UI red design-audit dupes), #850 (CONFLICTING), #851 (schema-test regressions), #726 (CONFLICTING CodeRabbit UTG). Unique safe fix landed in #853: agitation chart expansion without bare table/management over-trigger. Communication #19 inaccessible (repo not resolvable). | Focused Vitest clinical-search 42/42. Local verify:cheap unit suite hit pre-existing pdf-extraction-budget failures also on main (2 tests). Hosted CI babysit on #853; no OpenAI/live Supabase writes. | | 2026-07-18 | PR batch screenshot queue → #808/#812/#814 | 44555ab9e414f615981eb444f46a62333c28ec18 | open-PR review + merge babysit | Screenshot PRs #784–#789 closed as superseded. Unique residual work landed via #808 and #812. Design-audit/Playwright stack landed via #814 after Production UI fixes (Clinical Guide H1, service mocks, reduced-motion dock asserts), presentations empty-query fallback, and CodeRabbit thread resolution (RightRail remount, IS DISTINCT FROM, no-op dropped trigram migration). #783 already merged. Communication #17 inaccessible from this token. | Hosted #808/#812/#814 required checks green including Production UI; migration replay green on #814. No OpenAI/live Supabase writes. | | 2026-07-18 | PR batch screenshot queue → #808 / cursor/pr-queue-land-bfe7 | 3b54a785c7c6073024b6bae0182b6a9321154595 | open-PR review + merge babysit | Consolidated unique remaining work from screenshot PRs onto current main via #808 (Also matches placement, factsheets, audit metadata minimize with numeric storageRemoved, answer-progress UI gate, global-error role=alert). Superseded already-landed #800/#799/#801/#802 (via #798/#804). Closed conflicted/failing design-audit duplicates #789/#790/#803/#806/#807/#788 and older duplicates #748/#749/#751 without replaying Production UI regressions. | Hosted #808: required checks green (Static/Unit/Build/Production UI/Migration replay/PR required). Supabase Preview failed (non-blocking concurrent preview limit). Local focused Vitest audit+factsheets; sitemap:check; ci-change-scope self-test. verify:cheap PDF budget failures pre-existing on main. No OpenAI/live Supabase writes. | | 2026-07-17 | PR #732 / claude/edge-to-edge-content-lv9x7k | 354f9bf31b56d811d8611a9b248f7aebc7cde082 | open-PR review + merge babysit | No high-confidence P0-P2. Phone shell/sheet/settings replace dvh clamps with h-full inside fixed inset-0 parents (iOS Safari toolbar collapse). Merged to main via auto-merge. | Hosted required checks + Production UI green; pairwise merge-tree with sibling UI PRs clean. | diff --git a/src/lib/clinical-search.ts b/src/lib/clinical-search.ts index 270739d5..cd9112d2 100644 --- a/src/lib/clinical-search.ts +++ b/src/lib/clinical-search.ts @@ -1272,11 +1272,18 @@ export function buildClinicalTextSearchQuery(query: string) { (hasAgitationArousalTypo && /\bagitation\b/i.test(correctedQueryText) && /\barousal\b/i.test(correctedQueryText)) || /\bagitation\b/i.test(correctedQueryText); const agitationMedicationIntent = medicationDoseEvidenceQueryIntent(query); + // Chart/dose/route/options expand into medication-chart terms. Bare "table" or + // "management" alone must not — those appear in topic lookups like + // "which table covers … pharmacological management" and broad management questions. + const agitationChartSurfaceMatch = /\b(?:dose|dosing|route|oral|intramuscular|im|po|chart|options?|listed)\b/i.test( + correctedQueryText, + ); const wantsAgitationMedicationChart = hasAgitationArousalContext && (agitationMedicationIntent.asksAmount || agitationMedicationIntent.asksRoute || - agitationMedicationIntent.asksFrequency); + agitationMedicationIntent.asksFrequency || + agitationChartSurfaceMatch); const wantsAgitationArousal = hasAgitationArousalContext && (wantsAgitationMedicationChart || @@ -1294,7 +1301,11 @@ export function buildClinicalTextSearchQuery(query: string) { normalizedTokens.splice(0, normalizedTokens.length, "clozapine", "monitoring"); } else if (wantsAgitationMedicationChart) { const requestedDoseRouteTerms = medicationDoseEvidenceSearchTerms(query); - normalizedTokens.splice(0, normalizedTokens.length, "agitation", "arousal", ...requestedDoseRouteTerms); + const medicationChartTokens = + requestedDoseRouteTerms.length > 0 + ? ["agitation", "arousal", ...requestedDoseRouteTerms] + : ["agitation", "arousal", "pharmacological", "management", "medication", "chart", "dose", "route", "im", "po"]; + normalizedTokens.splice(0, normalizedTokens.length, ...medicationChartTokens); } else if (wantsAgitationArousal) { normalizedTokens.splice(0, normalizedTokens.length, "agitation", "arousal", "pharmacological", "management"); } else if (/\badmission\b/i.test(query) && /\bcommunity patients?\b/i.test(query)) {