Commit Graph
13 Commits
Author SHA1 Message Date
GandClaude Opus 5 3e059f0818 chore: add a formatter (#83)
* chore: add a formatter, matching the style this repo already writes

singleQuote=false was chosen by counting this repo's own
imports, not by fleet decree. The fleet is genuinely split and the two repos
that already had a .prettierrc disagreed with each other, so there was no
standard to restore. Quote style does not cross repo boundaries; having a
gate does.

Markdown is ignored for now — prettier rewraps prose, which would bury the
real diff.

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

* style: format with prettier (304 files)

Mechanical. No behaviour change. This SHA is listed in
.git-blame-ignore-revs so `git blame` skips it.

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

* chore: teach git blame to skip the reformat

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

* style: format the two files the reformat pass missed

prettier --check flagged app/shared.module.css and lib/domain/clinicians.test.ts
on a branch whose whole point was that everything had been formatted. Re-running
the same command with the same version fixes both, so the rollout's write step
did not finish what it reported.

The rollout now runs --check straight after --write and refuses to open a PR
unless it comes back clean, so a partial reformat fails at the source instead of
in CI.

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-29 10:48:01 +00:00
GandClaude Sonnet 5 6fc4ac7086 feat(shell): notifications, grouped admin nav, admin mobile tabs, a working mega menu, and a real footer (#64)
Phase 1 of a full clinician/patient UI redesign George asked for after we
shipped the actor-aware cancellation copy fix (#63) — he judged the wider
nav/notification/mobile experience underneath it as poorly designed. This is
the shared foundation (nav, header, notifications, mobile, mega menu, footer)
that every individual page redesign in later phases will sit on top of.

In-app notifications (lib/domain/notifications.ts, app/api/notifications/*,
components/shared/NotificationBell.tsx): a companion to the existing email
sends, not a replacement — wired alongside sendEmail at 5 trigger sites
(new message, every booking lifecycle event, critical-signal + goal-achieved
in cron/signals, clinician application decisions, document uploads). One
shared bell component in both admin and portal headers, 30s polling reusing
the existing MESSAGE_POLL_INTERVAL_MS constant. Kept as an in-repo module,
not a published package — no second adopter yet to justify that (same
rule-of-three standard that produced threadkit, which vitareba already
imports for message read/write/unread — verified before starting, so no
messaging-domain work was needed here).

Admin nav (lib/config/routes.ts ADMIN_NAV_GROUPS, components/admin/AdminNav.tsx):
flat 8-item list replaced with grouped sections mirroring the portal's own
Care group, so the same clinician relationship reads the same shape from
either side. Fixed the "always-on badge" problem: urgentPatients and
pendingApplications were live state counts with no seen-at gate, so a
clinician who'd already reviewed everything still saw a nonzero badge
forever. Added profiles.patientsSeenAt/applicationsSeenAt (mirroring the
existing bookingsSeenAt/goalsSeenAt pattern) and profiles.lastKnownSignalAt
(there was no "when did this become urgent" timestamp at all) via one
generic mark-seen route instead of a 4th near-identical file.

Admin mobile (AdminBottomNav): replaced the fragile horizontal-scrolling
pill strip (flagged in its own code comment as tracking <th> order by hand)
with a bottom tab bar + "More" sheet, matching the portal's own BottomNav —
a clinician who is also a patient (the existing role-switch) shouldn't
relearn navigation switching sides.

Marketing mega menu (components/sections/Nav.tsx): was CSS :hover-only, no
keyboard access, no aria-expanded, unusable on a tablet or hybrid laptop.
Now click/focus-driven with proper button semantics, Escape + click-outside
(via the new shared useClickOutside hook — also used by the notification
bell and UserDropdown, its 3rd use). Extracted NavAuthActions to fix the
"future auth-state change needs editing two places" risk the desktop/mobile
duplication already had.

Marketing footer: was a logo and one copyright line, no links at all — now a
real sitemap footer (explore/account columns, address, emergency contacts).
EMERGENCY_CONTACTS existed in config but was wired into no authed screen
either; added to UserDropdown too.

New/changed columns: notifications (new table), profiles.patientsSeenAt,
profiles.applicationsSeenAt, profiles.lastKnownSignalAt — all additive,
drizzle/0015_loving_umar.sql.

pnpm verify (1299 tests, 0 lint errors) and pnpm build both green.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-17 20:19:48 +00:00
GandClaude 265d9a7013 feat(ux): mobile nav menu + above-the-fold hero CTA (#20)
On phones the marketing nav hid every action — no menu, no sign-in, no
CTA — and the hero filled the first screen with text alone. Now:

- Hamburger menu (<768px) with section links, the Inflection Edge CTA
  and Sign in / Dashboard; Escape closes it and body scroll locks while
  open.
- Hero dark panel gains mobile-only CTA pair (Take the Inflection Edge /
  Book Consultation) so the primary action sits in the first viewport.
- Hero subtitle tightened to one sentence in all four locales to cut
  reading load before the CTA.

Verified in-browser at 390x844: menu open/close, sign-in from menu,
login, forgot/reset password round-trip (old password rejected, new
accepted), and the guest assessment through to results + lead capture.


Claude-Session: https://claude.ai/code/session_01B2j2tdVLir2PaEEALjQXK3

Co-authored-by: Claude <noreply@anthropic.com>
2026-08-12 12:40:52 +02:00
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 d914779af8 feat(portal): fix megamenu hover + add engagement copy throughout
Megamenu fix: move gap inside panel as padding-top so hover zone is
continuous — mouse no longer exits .megaItem when crossing to the panel.
Wrap panel contents in .megaPanelInner for visual styling separation.

Portal engagement improvements:
- Check-in: streak computation + motivating post-save success panel
- Dashboard: "today done" state, richer empty-state copy, better goal
  progress labels, improved consultation CTA framing
- Assessments: richer saved banner with next-step framing, retake hint
- Profile bar: context-sensitive copy based on completion %
- Bookings: better empty state, confirmation message, contextual form
- Messages: better empty state and form framing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 11:29:31 +02:00
g-butandClaude Sonnet 4.6 5da535f02a feat(nav): megamenu with hover panels for Programmes, Approach, Diagnostics
Replace flat anchor links with CSS-hover driven megamenu:
- PROGRAMMES: card panel with 3 programmes (label + description)
- APPROACH: list dropdown with 4 methodology items
- DIAGNOSTICS: list dropdown with 3 diagnostic options
- LONGEVITY / PRICING / TEAM: simple anchor links unchanged
- Smooth opacity+translate animation, decorative arrow, keyboard accessible

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 20:27:34 +02:00
g-butandClaude Sonnet 4.6 785b923e25 feat(ui): portal nav overhaul, clinical goals UI, check-in, accessibility + readability fixes
Navigation & layout:
- PortalNav: icon sidebar with 4 groups, active state with teal left border
- BottomNav: fixed mobile bottom tab bar (5 items, safe-area-inset-bottom)
- NavBreadcrumb: route-aware header breadcrumb
- UserDropdown: escape key close, aria-expanded ring, quick check-in link

Portal features:
- Check-in page: 1-10 scale for mood/energy/sleep/stress
- PatientGoalsCard: admin goal CRUD with progress bars
- Dashboard: active clinical goals section
- ProfileCompletenessBar uses profileCompletenessColor()
- Admin patient detail decomposed into card components

Accessibility & readability:
- html font-size 112% - raises all rem values ~12% site-wide
- --muted darkened to #71727c (WCAG AA 4.5:1 on white)
- Hero eyebrow 0.6rem to 0.72rem, pill 0.58 to 0.68rem, sub contrast fixed
- Nav links 0.68 to 0.75rem
- LanguageSwitcher: pill container, mobile visible (was hidden), 0.62 to 0.72rem
- scaleBtn min-height 2.75rem (44px touch target)

Hero fix: .heroR justify-content flex-end (was center) aligns both columns

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 11:00:05 +02:00
g-butandClaude Sonnet 4.6 e55651b4b2 feat(i18n): full Swiss multilingual support (de/fr/it/en)
Infrastructure
- next-intl v4: routing config, request config, createNextIntlPlugin
- proxy.ts: merged next-intl middleware with existing auth guard — portal/admin
  paths bypass locale routing; marketing+auth go through intlMiddleware
- lib/i18n/navigation.ts: locale-aware Link, useRouter, usePathname

Routing
- app/[locale]/(auth)/: login, register, forgot-password, reset-password
  fully translated, locale-prefixed (e.g. /de/login, /fr/login)
- app/[locale]/page.tsx: marketing landing under each locale
- app/layout.tsx: lang attribute from NEXT_LOCALE cookie
- app/page.tsx: safety-net redirect to /de

Translation files
- messages/{de,fr,it,en}.json: 254 keys across 15 sections — nav, hero,
  impactStats, pillars, approach, pathway, diagnostics, sylClock,
  psychedelicReadiness, addiction, programs, team, cta, footer, auth
- de: formal Sie, Swiss Hochdeutsch (no ß → ss)
- fr: formal vous, Swiss French register
- it: formal Lei, standard Italian for Ticino audience
- Protected from translation: brand names, prices, citations, medical acronyms

Components
- All 14 section components → async server components using getTranslations()
- Config arrays reduced to structural/non-translatable data (icons, prices,
  featured flags, step numbers, initials)
- Text content via t.raw() for arrays, t() for scalars
- Nav: useTranslations + LanguageSwitcher + locale-aware Link
- Auth pages: useTranslations replacing all hardcoded strings
- LanguageSwitcher: DE/FR/IT/EN pill buttons, hides on mobile

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 16:31:40 +02:00
g-butandClaude Sonnet 4.6 2a89ecfadb feat(ux): auth-aware nav, user dropdown, unified header pattern
- Nav: shows "Sign in" + CTA when logged out, "Dashboard →" when logged in
  (useSession, collapses both on mobile)
- UserDropdown: initials avatar in portal/admin header; opens on click with
  name, email, Profile link, Admin Panel link (admin only), Sign out
- Portal & admin layouts: sidebar holds only nav; header bar (56px, sticky)
  holds UserDropdown — same pattern in both route groups
- Auth layout: replaced split-panel with centered card (max-width 420px),
  cleaner logo-first flow

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 15:57:37 +02:00
g-butandClaude Sonnet 4.6 cf80f2b756 feat: OG image, logo link, scroll lock, final polish
- app/opengraph-image.tsx: dynamic branded OG image (edge ImageResponse)
  dark ink bg, teal accent, logo, tagline, specialty pills
- metadata: metadataBase set to SITE_URL (resolves OG image URL warning)
- Nav: logo wrapped in Next.js Link (home link + aria-label)
- Assessment: body scroll lock on mount/unmount (overflow hidden)
- Diagnostics: sec-title div → h2 (last remaining semantic heading fix)
- globals.css: #fff → var(--white) in sec-title-light utility class
- CLAUDE.md: architecture section updated (CSS modules, Assessment/
  directory, accurate SSOT table)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 16:02:01 +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