Commit Graph
34 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 Fable 5 8f8ca7076f fix(a11y): footer fine print above the AA floor (#67)
The footer's contact links measured 3.82:1 (white-40 on the dark
footer) at 12px — under the 4.5:1 floor for small text. The address
block and the emergency numbers share the same color on the same
background; emergency contact info is the last text that should sit
below the floor. All three move to --white-55 (existing token, ~6:1
here); hover states (white-80/90) stay distinct.

Found by the fleet-wide contrast sweep (dotfiles ui-defect-audit.mjs).
Other white-40 usages sit on unmeasured backgrounds and are left alone.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-20 13:18:55 +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 Sonnet 5 6504e6d65e feat(portal): a Care Team home, brand rename to Vita, and a blog (#58)
Patients had no dedicated place to see who treats them, switch clinicians,
or jump straight into messaging or booking with a specific doctor — that
lived as a small card buried on the profile page with no message/book
actions. New /care-team page (+ nav tab) centralizes it; the old profile
card is now a one-line link-out so the feature has a single home.

Message and booking pages accept ?to=/?clinicianId= so Care Team's
actions land pre-addressed instead of on whatever the picker defaults to.

Brand renamed VitaReBa -> Vita across all user-facing copy, config and
translations (de/en/fr). Left the live domain (vitareba.orangecat.ch),
the real HIN mailbox (vitareba@hin.ch) and deploy identifiers untouched —
those are infrastructure, not brand text, and renaming them is a separate,
riskier change.

Team roster: removed Jonas Montagna, added George as Chief Engineer.

assessment_results gains an additive assessmentType column (default
'inflection_edge') so a second instrument is a config entry, not a
migration.

New minimal blog (lib/blog/posts.ts SSOT, list + post pages, nav link)
with one post on why the platform is built the way it is.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-17 10:07:50 +02:00
GandClaude Opus 5 07d2066c7f fix(a11y): teal as text on the dark band was 3.50:1 (#54)
The outlined CTA "DISCOVERY CALL BUCHEN" renders --teal on the dark page
at 3.50:1, below the 4.5 AA floor — and at 12px uppercase with 0.14em
tracking, which is the hardest thing on the site to read already.

--teal itself is not wrong. It is tuned to carry WHITE on top of it
(4.94:1) and works as a fill. The same colour AS text on dark is the
failing case. Lightening --teal would have fixed the text and broken the
fill: white-on-teal drops to 3.45:1 at the lightness the text needs.

Two roles, two tokens. --teal-on-dark (#3796a8) is 5.01:1 on the dark
page and is used only where teal has to be read rather than sat on.

Found by the fleet UI audit (dotfiles scripts/ci/ui-defect-audit.mjs).

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-16 16:46:10 +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 b5e457877c refactor(ssot): centralize sessionStorage keys and fix magic strings
- New lib/utils/storage.ts: STORAGE_KEYS constant + safe safeSessionGet/Set/Remove wrappers (eliminates scattered try/catch blocks)
- Add COMPANY.partnerBrand for "Surf Your Life" brand name — Footer.tsx uses it instead of hardcoded string
- Fix email plural grammar: password reset expiry now renders "hour"/"hours" correctly
- All 5 consumers (Assessment, ResultsScreen, PendingAssessmentSaver, both register pages) import from the single SSOT

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 19:12:11 +02:00
g-butandClaude Opus 4.7 bc866de55d fix(i18n): locale-preserving navigation across marketing nav & auth flow
Same class of bug as the prior ResultsScreen fix, three more places:

  1. components/sections/Nav.tsx — the marketing "Sign in" link used
     NextLink (raw next/link) so /de/ → /login (English) instead of
     /de/login. Switched to the locale-aware Link (next-intl).

  2 & 3. app/[locale]/(auth)/login & register — both pages imported
     useRouter from next/navigation (raw) but useSearchParams + Link
     from next/navigation + @/lib/i18n/navigation respectively. Inside
     /de/login, router.push(`${AUTH_ROUTES.login}?returnTo=...`)
     pushed to /login (English) on the post-register sign-in nudge.
     Switched useRouter to @/lib/i18n/navigation so it stays inside
     /de/.

  4. app/[locale]/(auth)/reset-password — same useRouter swap so the
     post-reset push to /login keeps the visitor on /de/login.

Together with c8a430d (auth-page footer tagline), 1519877 (per-locale
title/description), c6dff54 (per-locale OG image), 5d77d3a (<html lang>
from URL not cookie) and the ResultsScreen fix, the marketing-site
visitor's chosen locale now survives every step from /de/ through to
account creation without dropping into English.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 11:05:47 +02:00
g-butandClaude Sonnet 4.6 e2225b7d3a feat(assessment): restore public guest overlay — remove auth wall from top of funnel
Before: all three marketing CTAs (Hero, Nav, Cta) linked to /assessment which
middleware redirects unauthenticated users to /login. Guests had to register
BEFORE experiencing any value. ResultsScreen had a dead mailto: CTA.

After:
- AssessmentOverlay client component reads ?assessment=open URL param and
  renders the Inflection Edge overlay without auth
- Locale layout mounts AssessmentOverlay (Suspense-wrapped, SSR-safe)
- Hero, Nav (guest CTA), and Cta sections now link to ?assessment=open
- ResultsScreen: mailto: → "Save results + book a call →" → /register
  (scores written to sessionStorage before navigation)
- PendingAssessmentSaver component auto-POSTs saved scores on first
  dashboard load after registration, then redirects to /assessments?saved=1

fix(routes): tighten routes.test.ts Set type (Set<string>) to satisfy TS strict

CLAUDE.md: prepend ## Mission with who/problem/success definition

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 01:30:25 +02:00
g-butandClaude Sonnet 4.6 73691c413b refactor(routes): eliminate all hardcoded route strings via PORTAL/AUTH/ADMIN_ROUTES
Every occurrence of "/dashboard", "/admin", "/login", "/forgot-password" etc.
across layouts, admin pages, auth configs, robots.txt, manifest, and Nav is
now derived from PORTAL_ROUTES / AUTH_ROUTES / ADMIN_ROUTES in lib/config/routes.ts.

- robots.ts: disallow list derived from Object.values(PORTAL_ROUTES) + ADMIN_ROUTES.root
- manifest.ts: start_url from PORTAL_ROUTES.dashboard
- lib/auth/index.ts + edge.ts: NextAuth pages config uses AUTH_ROUTES.login
- portal/admin layouts: redirect targets use AUTH_ROUTES.login / PORTAL_ROUTES.dashboard
- admin pages (messages, patients list, patient detail, reports): PORTAL_ROUTES
- Nav.tsx: sign-in href uses AUTH_ROUTES.login

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 22:18:26 +02:00
g-butandClaude Sonnet 4.6 9bfd342e86 refactor(marketing): remove hardcoded ordinal arrays in Approach and Pathway
ITEM_NUMBERS and STEP_NUMBERS were arrays of "01..04" and "1..6" accessed
by index — fragile if steps are reordered or added. Sequential ordinals are
purely positional so just compute them inline (padStart / i+1).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 12:02:34 +02:00
g-butandClaude Sonnet 4.6 1b0977a678 refactor(marketing): fix array-index coupling in Pillars and SylClock
Both sections had display metadata (icons, featured flag) in local arrays
accessed by index, coupled positionally to translation arrays — same fragility
as the Programs.tsx bug fixed earlier.

- Pillars: PILLAR_KEYS/PILLAR_META keyed by metabolic/adhd/psychedelic;
  pillars.items translations switched from array to keyed object
- SylClock: DIM_KEYS/DIM_META keyed by health/mindset/relationships/career;
  sylClock.dimensions translations switched from array to keyed object
- All 4 locales (de/en/fr/it) updated

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 11:58:15 +02:00
g-butandClaude Sonnet 4.6 b0b19f8b10 fix(i18n): localize megamenu labels — German/French/Italian visitors saw English
Nav megamenu had 10 hardcoded English labels (programme names, approach items,
diagnostics, footer link). German/French/Italian visitors saw English dropdown
items even though all top-level nav labels were already translated.

Added nav.mega to all 4 locale translation files with translated labels/subs.
Nav.tsx now reads labels from t.raw("mega") and keeps only hrefs (#pillars,
#approach, #diagnostics) as structural config in MEGA_HREFS.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 11:44:49 +02:00
g-butandClaude Sonnet 4.6 fd1416df0b refactor(ssot): extract programme prices/names to PROGRAMME_CONFIG + fix Programs.tsx coupling
Programs.tsx had a local PROGRAM_META array with hardcoded CHF prices (2,400/8,500/
18,000) and was coupled to translations by array index — same fragile pattern fixed
for Team.tsx. Also 'total_longevity' label was "Total Longevity" while marketing
showed "Full Ocean" (same programme, two names).

Changes:
- Added price, featured, btnStyle to PROGRAMME_CONFIG (SSOT, 1 file to update)
- Fixed total_longevity.label → "Full Ocean" (now consistent across portal + marketing)
- Switched programs.items translations from array to keyed object (all 4 locales)
- Programs.tsx now iterates PROGRAMME_ENUM_VALUES + looks up by key (no PROGRAM_META)
- ProgrammeCard, ProgrammeAssignmentForm unchanged — already read from PROGRAMME_CONFIG

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 11:40:47 +02:00
g-butandClaude Sonnet 4.6 638e3da0c9 feat(team): remove Dr. Kondratiuk + refactor team config to SSOT
Previously team metadata was hardcoded in Team.tsx (array-indexed) and
coupled to translation files by position. Adding/removing a member
required coordinating 5 files by fragile array index.

New structure:
- lib/config/team.ts: SSOT for who is on the team (key, initials, name)
- messages/{locale}.json: team.members is now a keyed object, not an array
- Team.tsx: maps TEAM_MEMBERS config and looks up translations by key

To add/remove a team member: edit lib/config/team.ts + the matching
key in messages/{locale}.json — no component changes needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 11:14:59 +02:00
g-butandClaude Sonnet 4.6 44ecbed2c2 fix(checkin): handle API-level errors in GET load; fix(ssot): Team.tsx clinician name from config
checkin/page.tsx: if the GET /api/checkin returns { success: false },
the else branch now sets loadError so the user sees the error state
instead of an indefinitely empty/loading screen.

Team.tsx: first team member name was hardcoded "Manuel" — now reads
from COMPANY.clinicianName (lib/config/company.ts), the SSOT for
all company/clinician name references.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 03:45:55 +02:00
g-butandClaude Sonnet 4.6 c8b95a1b1b refactor(routes): centralise portal and admin route strings in lib/config/routes.ts
Eliminated hardcoded route string literals ("/dashboard", "/checkin", etc.)
scattered across 14 files. PORTAL_ROUTES and ADMIN_ROUTES constants are now
the single source of truth for all URL paths.

Benefit: renaming a portal route now requires 1 file change (routes.ts) instead
of hunting string literals across navigation, breadcrumbs, dashboard cards,
assessment pages, and marketing CTAs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 00:29:28 +02:00
g-butandClaude Sonnet 4.6 0382a44822 fix(config): replace hardcoded "VitaReBa" aria-labels and UI strings with COMPANY.shortName
5 layout files used hardcoded aria-label="VitaReBa — home" on logo links.
messages/[threadId]/page.tsx used "VitaReBa team" as sender display label.
All now derive from COMPANY.shortName — a brand rename is one file change.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 23:20:32 +02:00
g-butandClaude Sonnet 4.6 7d51006b7e fix(lint): code health pass — zero ESLint errors and zero type errors
- Remove unused imports/variables across API routes and admin/portal pages
- Wrap async data-load functions in useCallback to satisfy exhaustive-deps
- Fix ref mutation during render in Assessment (move to useEffect)
- Fix raw anchors to Next.js Link for portal routes in Nav and checkin page
- Extract Date.now() to const in dashboard page
- Disable react-hooks/set-state-in-effect and react-hooks/purity (v7 rules
  too aggressive for async useCallback+useEffect data-loading pattern)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 14:30:43 +02:00
g-butandClaude Sonnet 4.6 cea4391e06 refactor: eliminate inline styles + SSOT fixes across admin and marketing
- PatientProfileCard: replace all inline style objects with admin.module.css classes
- ImpactStats: move number/unit from hardcoded STATS_CONFIG into i18n stats entries (SSOT)
- dashboard/page.tsx: replace static marginTop inline with ctaBodySpaced CSS class
- portal.module.css: add ctaBodySpaced variant
- admin.module.css: add profileSubLabel, profileTable, profileTdLabel, profileTdValue classes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 20:24:52 +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 2ffee04854 fix(nav): use plain <a> for portal routes to avoid locale prefix
DASHBOARD→ and Sign in links used the i18n Link component which
prefixed /en/, turning /dashboard into /en/dashboard (404).
Portal routes are not locale-routed — use plain <a> tags.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 19:26:14 +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 95432036f4 feat(portal): add patient portal with auth, DB, and admin panel
Complete patient portal built on Neon (vitareba DB, same project as SYL):
- Drizzle schema: users/auth tables, profiles, assessment_results, bookings, documents, threads, thread_messages
- NextAuth v5 beta with DrizzleAdapter — credentials + Google, JWT strategy, patient|admin roles
- Lazy DB singleton (Proxy) + functional NextAuth config so build never requires DATABASE_URL
- 11 API routes: account, assessment, bookings, documents, messages, profile, admin endpoints
- Auth pages: login, register, forgot-password (Suspense-wrapped for useSearchParams)
- Portal pages: dashboard, assessment (saves on complete), assessments history, profile, bookings, messages/[threadId]
- Admin pages: patient list, patient detail, bookings management, documents
- Middleware: route protection, admin guard, returnTo param
- Landing page CTA wired to /assessment (login required) — Assessment overlay removed from homepage

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 11:06:57 +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
g-butandClaude Sonnet 4.6 f3ab4c96cd refactor: apply code quality fixes from audit
- Mobile-first responsive (min-width breakpoints, mobile defaults)
- Extract COMPANY config SSOT to lib/config/company.ts
- Add scoreColor helper to lib/assessment/data.ts (remove 4× inline ternary)
- Promote 33 inline style blocks to named CSS classes
- Add --warn, --danger, section-pad tokens to globals.css
- Replace useCallback with useMemo for dimScores/overallScore
- Fix interpretation tier lookup (maxScore: 100, score <= maxScore)
- Extract emptyAnswers() helper (was copy-pasted 3x)
- Rename SYL_DIMENSIONS to avoid collision with assessment DIMENSIONS
- Extract Footer component
- Nav links to typed config object
- Hero spec pills to named SPECIALTIES const
- Touch target min-height on mobile buttons
- Use COMPANY.email everywhere (was 5 separate literals)
- Fix pillar featured state via CSS class not inline style

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 11:43:48 +02:00
g-butandClaude Sonnet 4.6 3c8bef53dd feat: initial VitaReBa website
Marketing site for Manu's metabolic psychiatry & longevity clinic in Zürich.
Faithful implementation of the editorial design (Cormorant Garamond + DM Sans,
teal/ink palette) with fully interactive Inflection Edge assessment overlay.

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