Polish medication page design + fold patient-details tool by default#659
Conversation
Refresh the medication detail page and prescribing search list with a disciplined dash of colour, and collapse the patient-details input tool by default so it no longer dominates the page. Detail page (medication-record-page.tsx): - Per-medication (drug-class) identity accent, previously unused: exposed as a --med-accent CSS var (color-mix softened) and applied as a header left-rail, header icon tile, subclass dot, and a section-content left-rail. Decorative chrome only — never text or semantic surfaces — so contrast holds in light and dark and red/amber-family class hues never read as safety signals. - Detail tiles now carry per-tile icons + categorical --type-* tinted chips so the four read as distinct; the "Avoid" tile uses the full danger recipe, fixing the near-invisible /60-on-soft-token border. - Boxed tab pills replaced with the accessible underline tab pattern (role=tablist/tab/tabpanel, aria-selected, arrow-key nav). - Section rows get per-section toned icon tiles (red=contra, amber=risk, green=safe/verified, categorical for the rest). - Sidebar: quick-reference values promoted to heading colour for hierarchy, and the whole sidebar now reflows below content on mobile instead of disappearing. - Loading uses the skeleton LoadingPanel; empty tab uses EmptyState. - Fixed a mobile horizontal overflow from the reflowed sidebar by constraining the grid to grid-cols-1 (minmax(0,1fr)). Prescribing search list (medication-prescribing-workspace.tsx): leading result icon tiles tinted with the per-medication class accent (soft wash). Fold: PatientProfilePanel gains a defaultOpen prop; the detail page mounts it collapsed (defaultOpen=false). Considerations still render below. Behaviour and data unchanged; presentational only. Verified with lint, typecheck, full vitest suite, prettier, type/icon-scale + brand checks, and Chromium before/after screenshots (light, dark, mobile, search). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JBemWnYhqdGXBzwJUTQAqe
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughMedication result rows now carry per-medication accents into tinted icons. The medication record page adds accent-aware styling, redesigned detail tiles, accessible section tabs, reusable sidebar cards, empty/loading states, and updated layout visuals. Patient profile panels support configurable initial expansion. ChangesMedication dashboard UI
Patient profile panel behavior
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Comment |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Summary
Presentational upgrade of the medication detail page and prescribing search list — a disciplined "dash of colour" on the crisp‑white/teal frame — plus collapsing the patient‑details input tool by default so it no longer dominates the page. No data or logic changes.
Key lever: every
MedicationRecordalready carries anaccenthex keyed to drug class (14 distinct colours across 328 meds) that was defined but never rendered. It's now surfaced as a decorative per‑medication identity accent.Detail page (
medication-record-page.tsx)--med-accentCSS var (color‑mix softened): header left‑rail, header icon tile, subclass dot, and a section‑content left‑rail. Chrome only — never text/semantic surfaces — so contrast holds in light + dark and red/amber‑family class hues never read as safety signals (colour contract:docs/redesign/permanent-colour-direction.md).--type-*tinted chips so the four read as distinct; the "Avoid" tile now uses the full danger recipe, fixing the near‑invisible/60‑on‑soft‑token border.role=tablist/tab/tabpanel,aria-selected, arrow‑key nav).LoadingPanel;EmptyStatefor an empty tab.grid-cols-1/minmax(0,1fr); verifiedscrollWidth === innerWidthat 390px).Prescribing search (
medication-prescribing-workspace.tsx)Fold (
patient-profile-panel.tsx)defaultOpenprop; the detail page mounts the panel collapsed (defaultOpen={false}). Considerations still render below.Verification
npm run lint— clean (--max-warnings 0)npm run typecheck— clean for changed filesnpm run test— 2301 passed (the only errors are the pre‑existing localjsdom/@testing-librarygap in*.dom.test.tsx, resolved by CI'snpm ci)prettier --check,check:type-scale,check:icon-scale,brand:check— all passnpm run verify:ui— the repo's Chromium UI gate (recommended in CI for this styling change)Clinical Governance Preflight
Not applicable — pure presentational change (no ingestion, answer generation, search/ranking, source rendering, document access, privacy, production env, or clinical‑output behaviour). Colour discipline preserved: semantic tones (green/amber/red) unchanged in meaning; the per‑class accent is decorative chrome only.
🤖 Generated with Claude Code
https://claude.ai/code/session_01JBemWnYhqdGXBzwJUTQAqe
Generated by Claude Code
Summary by CodeRabbit
New Features
UI Improvements