From 7bd1bb09722daba1caa6b3bd05a1846040be7299 Mon Sep 17 00:00:00 2001 From: BigSimmo <87357024+BigSimmo@users.noreply.github.com> Date: Thu, 2 Jul 2026 12:59:14 +0800 Subject: [PATCH 1/7] test: make upload drawer smoke assertions env-agnostic The upload drawer checklist test previously assumed the env-less demo config; with .env.local (LOCAL_NO_AUTH) present uploads are enabled and the disabled expectation failed. Branch the enablement assertions on the real server's setup-status demoMode flag so the test passes in both configurations, asserting Locked+disabled in demo mode and Ready+enabled in local-auth mode. The dedicated demo-mode test is unchanged. Verified: npx playwright test tests/ui-smoke.spec.ts --project=chromium 29/29 green both env-less and with .env.local present. Co-Authored-By: Claude Fable 5 --- tests/ui-smoke.spec.ts | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/tests/ui-smoke.spec.ts b/tests/ui-smoke.spec.ts index 709c4807c6..759ec8218b 100644 --- a/tests/ui-smoke.spec.ts +++ b/tests/ui-smoke.spec.ts @@ -1443,9 +1443,17 @@ test.describe("Clinical KB UI smoke coverage", () => { expect(JSON.stringify(payload)).not.toMatch(/sk-|service_role|eyJ/i); }); - test("upload drawer exposes setup checklist and explicit upload labels", async ({ page }) => { + test("upload drawer exposes setup checklist and explicit upload labels", async ({ page, request }) => { await page.setViewportSize({ width: 414, height: 820 }); await mockPrivateUnauthenticatedApi(page); + // Upload availability depends on the checkout's env config: env-less servers run in + // read-only demo mode while .env.local local-auth servers accept uploads. The browser + // mocks above do not decide enablement, so read the real server flag and branch the + // enablement assertions on it to keep this test green in both configurations. + const setupStatusResponse = await request.get("/api/setup-status"); + expect(setupStatusResponse.ok()).toBe(true); + const serverDemoMode = (await setupStatusResponse.json()).demoMode === true; + await gotoApp(page, "/"); await expect(visibleQuestionInput(page)).toBeVisible(); @@ -1459,9 +1467,17 @@ test.describe("Clinical KB UI smoke coverage", () => { await expect(uploadDrawer.getByText("Search RPC and vector indexes")).toBeVisible(); await expect(uploadDrawer.getByText("OpenAI API key available")).toBeVisible(); await expect(uploadDrawer.getByText("npm run worker running")).toBeVisible(); - await uploadDrawer.getByRole("tab", { name: /Upload/ }).click(); + const uploadTab = uploadDrawer.getByRole("tab", { name: /Upload/ }); + await uploadTab.click(); await expect(uploadDrawer.getByText("Clinical upload")).toBeVisible(); await expect(uploadDrawer.getByText("Guideline PDF files")).toBeVisible(); + if (serverDemoMode) { + await expect(uploadTab).toContainText("Locked"); + await expect(uploadDrawer.getByRole("button", { name: "Guideline PDF files" })).toBeDisabled(); + } else { + await expect(uploadTab).toContainText("Ready"); + await expect(uploadDrawer.getByRole("button", { name: "Guideline PDF files" })).toBeEnabled(); + } await expect(uploadDrawer.getByRole("button", { name: "Upload guidelines" })).toBeVisible(); await expectNoPageHorizontalOverflow(page); }); From c7950c4dd83b0560ce3e6a984b69441a4cfbcce4 Mon Sep 17 00:00:00 2001 From: BigSimmo <87357024+BigSimmo@users.noreply.github.com> Date: Thu, 2 Jul 2026 13:24:26 +0800 Subject: [PATCH 2/7] refactor(theme): remove clinical-chat-teal alias, use clinical-accent tokens Rename all remaining var(--clinical-chat-teal)/var(--clinical-chat-teal-soft) consumers to the canonical var(--clinical-accent)/var(--clinical-accent-soft) role tokens and delete the compat alias definitions from both theme blocks in globals.css. Also map the dangling, never-defined --clinical-chat-teal-border references in document-search-results.tsx to the real --clinical-accent-border token, fixing silently dead hover borders. Verified: typecheck, eslint + prettier on changed files, ui-smoke chromium 29/29, visual check of /applications launcher (desktop + mobile). Co-Authored-By: Claude Fable 5 --- mockups/medication-prescribing/page.tsx | 18 +++--- src/app/globals.css | 10 +-- src/components/ClinicalDashboard.tsx | 24 +++---- src/components/DocumentViewer.tsx | 18 +++--- src/components/applications-launcher-page.tsx | 64 +++++++++---------- .../document-search-results.tsx | 26 ++++---- .../clinical-dashboard/document-ui.tsx | 6 +- .../clinical-dashboard/favourites-hub.tsx | 24 +++---- .../global-mockup-search-shell.tsx | 2 +- .../medication-prescribing-workspace.tsx | 28 ++++---- .../clinical-dashboard/mode-action-popup.tsx | 10 +-- 11 files changed, 113 insertions(+), 117 deletions(-) diff --git a/mockups/medication-prescribing/page.tsx b/mockups/medication-prescribing/page.tsx index fe80db51ed..c2c1b9b059 100644 --- a/mockups/medication-prescribing/page.tsx +++ b/mockups/medication-prescribing/page.tsx @@ -189,7 +189,7 @@ function IconFrame({ ? "border-red-300 bg-red-50 text-red-600" : tone === "slate" ? "border-[color:var(--border)] bg-[color:var(--surface-subtle)] text-[color:var(--text-muted)]" - : "border-[color:var(--clinical-chat-teal)]/25 bg-[color:var(--clinical-chat-teal-soft)] text-[color:var(--clinical-chat-teal)]", + : "border-[color:var(--clinical-accent)]/25 bg-[color:var(--clinical-accent-soft)] text-[color:var(--clinical-accent)]", className, ].join(" ")} > @@ -222,7 +222,7 @@ function TopNav({ compact = false }: { compact?: boolean }) { className={[ "relative pb-4 text-sm font-medium", item === "Medication" - ? "font-semibold text-[color:var(--clinical-chat-teal)] after:absolute after:inset-x-0 after:bottom-[-1px] after:h-0.5 after:rounded-full after:bg-[color:var(--clinical-chat-teal)]" + ? "font-semibold text-[color:var(--clinical-accent)] after:absolute after:inset-x-0 after:bottom-[-1px] after:h-0.5 after:rounded-full after:bg-[color:var(--clinical-accent)]" : "text-[color:var(--text-muted)]", ].join(" ")} > @@ -410,7 +410,7 @@ function MonitoringPanel({ compact = false }: { compact?: boolean }) { return (
-
{quoteText ? ( -
+
“{quoteText}”
) : null} @@ -931,7 +931,7 @@ function NaturalLanguageAnswer({ >