Commit Graph
4 Commits
Author SHA1 Message Date
GandClaude Fable 5 45966a8e86 Design-token discipline with CI teeth + clinic-timezone dates + skeleton loading (#19)
* fix(ui): mobile patient table fits a 390px card

Walkthrough at 390px showed the triage table still ~50px wider than its
card: desktop cell padding, and the email ellipsis targeting a <p> that
is actually a <div> — plus max-width on the td, which auto table layout
ignores; the cap now sits on the inner divs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(design): token discipline with CI teeth, clinic-timezone dates, skeleton loading

Design discipline (SSOT enforced, not aspirational):
- Normalize every raw border-radius, transition duration, rgba() and hex
  in *.module.css to the globals.css token scale (26 files); add
  --radius-2xs (2px bars) and --radius-pill (2rem pills)
- lib/design-discipline.test.ts: 8 CI rules — no raw colors in css modules,
  radius/transition must use tokens, every var() must resolve in
  globals.css, no hex in TSX, style={{}} only in a data-driven allowlist
  (with staleness check)

UX intuition:
- formatDateISO now uses Europe/Zurich (CLINIC_TIMEZONE SSOT in
  lib/config/company.ts) instead of UTC: a 00:30 check-in no longer lands
  on yesterday's date, overwriting it and killing the streak; client and
  server now agree on 'today' even when the patient travels
- Shared <LoadingState/> shimmer skeleton (reduced-motion aware) replaces
  nine bare 'Loading…' strings across portal and admin

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 16:51:53 +00:00
g-butandClaude Sonnet 4.6 47791754f1 refactor(css): centralise all design tokens — eliminate color/shadow/font SSOT violations
• Expanded globals.css :root with full opacity scales:
  - White (--white-3 through --white-97) for dark-background sections
  - Primary/teal (--teal-6 through --teal-70) via color-mix so --teal cascades
  - Gold (--gold-6 through --gold-70), danger, warn, muted opacity scales
  - Shadow scale (--shadow-sm/md/lg)
  - Border radius (--radius-xs through --radius-full)
  - Transition timing (--transition-fast/normal/slow)
  - Z-index scale (--z-nav, --z-overlay, --z-overlay-pb, --z-overlay-close)
• Replaced every #fff → var(--white) across 28 CSS module files
• Replaced every rgba(255,255,255,X) → var(--white-X) across all dark-context files
• Replaced every rgba(42,122,138,X) teal → var(--teal-X) across all section/portal files
• Replaced every inline color-mix() in admin/portal/section files → named tokens
• Fixed hardcoded "DM Sans" font in not-found.module.css → var(--font-dm-sans)
• Replaced box-shadow rgba(0,0,0) values with --shadow-* tokens in Nav, UserDropdown, LanguageSwitcher
• global-error.module.css left intentionally self-sufficient (renders outside root layout)

Changing --teal to any colour now cascades to all opacity variants site-wide.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 11:52:32 +02:00
g-butandClaude Sonnet 4.6 da5b239a9e fix(assessment): state reset bug, a11y, keyboard nav + seo + code quality
Batch 1 — Bug fixes:
- Assessment conditionally mounted (eliminates stale state on reopen)
- Next button uses `disabled` attribute instead of removing onClick

Batch 2 — Accessibility:
- role="dialog", aria-modal, aria-labelledby on overlay
- aria-label="Close assessment" on close button
- aria-live/aria-atomic on progress region
- aria-label + aria-pressed on answer buttons
- Arrow key + Enter keyboard navigation for answers
- :focus-visible on all interactive elements (teal outline)
- :disabled style on back button
- .ovDims grid: repeat(3,1fr) → repeat(auto-fit, minmax(80px,1fr))

Batch 3 — SEO:
- OG + Twitter Card metadata in layout.tsx
- JSON-LD MedicalBusiness schema (uses lib/config/company.ts SSOT)
- canonical URL, robots meta
- app/sitemap.ts (Next.js route)
- public/robots.txt

Batch 4 — Code quality:
- Removed unused deps: clsx, lucide-react, tailwind-merge
- All inline style={{}} props moved to CSS modules or global utilities
- semantic h1 (Hero title) + h2 (all section titles) replacing divs
- type="button" on all non-submit buttons
- Footer mobile responsive CSS

Batch 5 — Design tokens:
- --white and --footer-bg tokens added to globals.css
- All #fff → var(--white) in CSS module files
- .sec-title-light, .eyebrow-gold, .section-header, .sec-title-center,
  .sec-sub-mt utility classes added to globals.css

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 15:04:40 +02:00
g-butandClaude Sonnet 4.6 97d838e69e refactor: migrate all component styles to CSS modules
globals.css reduced from 1625 → 101 lines — now contains only design
tokens, base resets, and shared utilities (section-inner, eyebrow,
sec-title, hr-rule, tags). All component-specific CSS extracted to
co-located .module.css files. Assessment.tsx split into Assessment/
directory (index.tsx, ResultsScreen.tsx, Assessment.module.css).
New Logo component added.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 13:46:47 +02:00