* 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>
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>
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>
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>
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>
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>
* 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>
• 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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
- 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>
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>
- 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>