Epic 2 - Cliëntenbeheer: Complete implementation of patient list with
search/filter functionality and comprehensive new patient form with
John Doe crisis admission support.
E2.S1 - Cliëntenlijst:
- Add client-side search bar with form submission
- Implement status filter dropdown (all/screening/active/finished/cancelled)
- Create StatusBadge component with color-coded status indicators
- Update table columns: Status, Name, BSN, Last Updated
- Add status filtering support to FHIR Patient API route
- Update FHIR patient transform to include episode-status extension
- Sort patients by updated_at descending (newest first)
E2.S2 - Nieuwe Cliënt Flow:
- Complete rewrite of patient form with all FO-required fields
- Implement John Doe checkbox with conditional BSN requirement
- Add BSN validation with Dutch Modulo-11 check algorithm
- Add comprehensive form fields:
* Name fields: prefix, given name, family name
* BSN with 9-digit pattern validation
* Birth date with max date validation
* Gender selection
* Address: street, postal code, city
* Contact: phone, email
* Insurance: company, policy number
- Add warning messages for John Doe crisis admissions
- Set default episode status to 'planned' for all new patients
- Redirect to patient detail page after successful creation
- Update FHIR transform bidirectional insurance extension support:
* dbPatientToFHIR: serialize insurance to JSON extension
* fhirPatientToDB: parse insurance from JSON extension
- Pre-populate form fields when editing existing patients
Technical changes:
- app/api/fhir/Patient/route.ts: Add status query param and sorting
- app/epd/patients/actions.ts: Add status filter parameter
- app/epd/patients/page.tsx: Pass status searchParam
- app/epd/patients/components/patient-list.tsx: Complete UI rewrite
- app/epd/patients/components/patient-form.tsx: Complete form rewrite
- lib/fhir/transforms/patient.ts: Add insurance extension handling
- docs/specs/screening-intake/bouwplan-screening-intake-v1.0.md: Update status
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implements complete database schema for screening and intake workflow:
Database additions:
- 7 new tables: screenings, screening_activities, screening_documents,
intakes, anamneses, examinations, risk_assessments
- Extended patients table with status (episode_status) and is_john_doe
- Extended encounters table with intake_id for linking
- Extended care_plans with intake reference columns
Architecture:
- Separate tables for reusable content (anamneses, examinations, risk_assessments)
- JSONB fields for context-bound data (kindcheck_data, treatment_advice)
- RLS policies, indexes, and updated_at triggers on all new tables
- Helper view: active_intakes_overview
Generated TypeScript types from schema for type-safe database access.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Adjusted hero image height on mobile from min-h-[300px] to h-[40vh]
to ensure content below the fold is visible and scrollable. Desktop
behavior remains unchanged with full viewport height.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Update EPD header to fetch and display real client data from database
- Add loading state while fetching client information
- Improve client name and birth date formatting
- Rename ClientDetailPage component to ClientRedirect for clarity
- Fix import path for ReleaseSidebar in documentation layout
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Rename releases.ts to documentatie.ts for better naming
- Add 'use client' directives to UI components for client-side rendering
- Add new documentation pages for features:
- Client Management (CRUD operations)
- Intake System (AI-powered intake analysis)
- Treatment Planning (SMART goals and progress tracking)
- Verpleegkundige Overdracht (nursing handover with ROM measurements)
- Voice-Controlled Reporting (AI-driven speech recording)
- Interface Design System (complete UI/UX specifications)
- Build Errors Fix (troubleshooting guide)
- Add client dashboard page with route structure
- Update documentation index with new categories and planned features
- Refactor BentoCard to use native anchor tags instead of Button component
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Added new "Bugs" group to release notes system for documenting
bug fixes and troubleshooting guides.
Changes:
- Added "Bugs & Fixes" group to _index.json (order: 4)
- Added "webpack-module-resolution" category under bugs group
- Created comprehensive MDX documentation for webpack fix
- Updated TypeScript types to include 'bugs' as valid group
- Updated sort order in getAllReleases() function
- Updated getReleasesGrouped() to include bugs filter
- Updated sidebar to expand bugs group by default
Content:
- Detailed webpack module resolution bug documentation
- Root cause analysis with technical explanation
- Solution implementation with code examples
- Prevention best practices
- Quick reference troubleshooting table
- Related issues and future improvements
Structure:
Group: Bugs & Fixes (order: 4)
└── Webpack Module Resolution (order: 10)
- Error: Cannot read properties of undefined (reading 'call')
- Fix: Wrapper component pattern
- Status: Completed
- Version: 0.2.1
This creates a dedicated space for documenting production issues,
their solutions, and lessons learned for future reference.
Root cause analysis:
- Next.js 16 Server/Client Component boundary issue
- Webpack module chunking fails with named exports from Client Components
- Error: "Cannot read properties of undefined (reading 'call')"
Solution:
- Created release-sidebar-wrapper.tsx to isolate import boundary
- Server Component (layout.tsx) now imports via wrapper
- Wrapper uses default export, which webpack handles better
Technical details:
- Server Component -> direct import -> Client Component = module undefined
- Wrapper component breaks the problematic import chain
- Default exports handle webpack chunking more reliably than named exports
Documentation:
- Added comprehensive troubleshooting guide
- Documents 4 solution approaches
- Lists best practices to prevent future occurrences
- Identifies other potential problem areas in codebase
Files changed:
- app/(marketing)/releases/layout.tsx (import via wrapper)
- app/(marketing)/releases/components/release-sidebar-wrapper.tsx (new)
- docs/troubleshooting/webpack-module-resolution-error.md (new)
Related: This is a known Next.js 15-16 issue with Server/Client boundaries
Added /releases to publicRoutes in middleware to allow
unauthenticated access to feature documentation.
The documentation pages are part of the build-in-public
approach and should be accessible to everyone.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Changed terminology from release notes to feature documentation
to better reflect the continuous build-in-public approach.
Changes:
- Navigation: "Releases" → "Documentatie"
- Page titles: "Release Notes" → "Feature Documentatie"
- Metadata descriptions updated
- Timeline link text updated
- Sidebar heading updated
- Template and example docs updated
The /releases route remains the same for stability,
but all user-facing text now says "Documentatie".
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Added comprehensive release note documenting the MDX-based release
notes system itself. Meta-documentation of the documentation system.
Covers:
- MDX content system architecture
- Thematic sidebar navigation
- Overview and detail pages
- Mobile responsive design
- Custom MDX components
- Workflow for adding new releases
- Integration with timeline and navigation
- Performance metrics
This demonstrates the system in action and serves as example
for future release notes.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
**Problem:**
Password reset emails redirected users to homepage with ?code= parameter,
leaving users stuck without ability to set new password.
**Root Cause:**
Auth callback route didn't detect password recovery flow. When Supabase
sent users back with type=recovery parameter, the callback defaulted to
/epd/clients redirect instead of /update-password.
**Solution:**
- Detect `type=recovery` parameter in auth callback route
- Always redirect password recovery flows to /update-password
- Preserves existing flows (signup, magic link) unchanged
**Flow now:**
1. User clicks reset link in email
2. Supabase verifies token → redirect to homepage with ?code=&type=recovery
3. Middleware redirects to /auth/callback?code=&type=recovery
4. Callback detects type=recovery → redirect to /update-password ✅
5. User can set new password
This fix ensures password reset works regardless of Supabase redirect_to
configuration, making the flow more resilient.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
**Auth Callback Improvements:**
- Fix default redirect from /clients to /epd/clients (correct route)
- Add smart detection for password vs magic link users
- Password signup users now go directly to /epd/clients after email confirmation
- Magic link users still get optional /set-password page
**Documentation:**
- Add comprehensive AUTH_FLOW_EXPLAINED.md with step-by-step flow diagrams
- Update RELEASE_AUTH_IMPROVEMENTS.md with magic link migration instructions
- Update emails/README.md with aispeedrun.nl redirect URL configuration
- Document Site URL vs Redirect URLs difference
- Add troubleshooting for common issues (localhost in emails, invalid redirect)
**Key Changes:**
- Email confirmation now correctly redirects password users to EPD
- Clear instructions for Supabase configuration (Site URL + Redirect URLs)
- Both development and production URLs documented for dual environment support
All documentation includes practical examples and FAQ section.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Added comprehensive improvements to the login and authentication flow:
**UI Improvements:**
- Add password visibility toggle (Eye/EyeOff icons) for password fields
- Improve error message consistency with Dutch translations
- Fix syntax error in login page try-catch block
**Error Handling:**
- Add user-friendly error messages for invalid credentials
- Add specific error codes: invalid_credentials, email_not_confirmed
- Improve error message for non-existent accounts during login
- Handle duplicate email detection during signup with auto-switch to login mode
**Middleware:**
- Add /reset-password and /update-password to public routes
- Fix redirect issue preventing access to password reset flow
**Password Reset Flow:**
- Verify password reset works for magic link users (can set initial password)
- Ensure existing password users can reset their password
- Both flows use the same update mechanism via Supabase
**Documentation:**
- Add comprehensive release notes in docs/RELEASE_AUTH_IMPROVEMENTS.md
All changes maintain backward compatibility with existing magic link users.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add before-user-created hook function for server-side duplicate email detection
- Implement fallback detection using identities array check (Supabase limitation)
- Update signUpWithPassword to detect duplicate emails via hook errors or empty identities
- Add error handling in login page to show duplicate email errors and auto-switch to login mode
- Add auth hook setup documentation and test scripts
- Add password reset and update password flows
- Add email templates for signup confirmation and password reset
Implements comprehensive client detail view with three tabs:
Profile, Intake, and Treatment Plan. Improves UX by redirecting
to client detail after create/edit instead of list view.
## New Files
### Client Detail Page (app/epd/clients/[id]/page.tsx)
- Server component with async params/searchParams
- Breadcrumb navigation back to clients list
- Client header with name, age, BSN, status badge
- Tab navigation for Profile, Intake, Plan
- Edit button linking to edit page
### Tab Components (app/epd/clients/[id]/components/)
- client-tabs.tsx: Tab navigation wrapper with search params
- profile-tab.tsx: Client demographic info, contact details
- intake-tab.tsx: Coming Soon - Week 3 feature preview
- plan-tab.tsx: Coming Soon - Week 3 feature preview
### Edit Page (app/epd/clients/[id]/edit/page.tsx)
- Reuses ClientForm component
- Breadcrumb navigation back to client detail
## Modified Files
### Client Form (app/epd/clients/components/client-form.tsx)
- IMPROVED UX: Redirect to /epd/clients/{id} after save
- Previously redirected to list view (/epd/clients)
- Better flow: Create → Detail view, Edit → Back to detail
- Captures new client ID from createClient() for redirect
## Features
- Tabbed interface with query params (?tab=profile|intake|plan)
- Professional header with status badges
- Breadcrumb navigation throughout
- Coming Soon placeholders for Week 3 features
- Consistent slate-based color scheme (no teal overload)
Part of Epic 1, Story 6 (E1.S6) - Client Detail View
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Voegt een 404 not-found pagina toe met speedrun/gaming thema:
- Humoristische boodschap: "Je bent iets te snel voor onze speedrun"
- Status display in terminal-style met NOT_FOUND, IN_PROGRESS, SOON™
- Teal accent kleur consistent met design system
- CTA's naar homepage en /login
- Easter egg hint naar timeline routes
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
✅ E2.S1: Tailwind config update
- Teal-700 (#0F766E) als PRIMARY brand color (5.47:1 contrast)
- Amber-600→700 gradient voor AI features
- Updated ring color naar teal-700 voor WCAG AA
✅ E2.S2: Global CSS variables
- --color-brand → teal-700 (was blue-600)
- --color-info → teal-700 (was blue-500)
- --color-input-focus → teal-700 (was blue-500)
- --color-ai toegevoegd → amber-600
✅ E2.S3: Component color updates
- components/ui/sign-in.tsx: Alle blue → teal
- components/ui/timeline.tsx: Gradient blue → teal
- components/ui/reading-progress.tsx: Progress bar blue → teal
- components/ui/modern-side-bar.tsx: Logo, active states blue → teal
✅ E2.S4: AIButton component
- Nieuw component: components/ui/ai-button.tsx
- Amber-600→700 gradient voor WCAG compliance
- 3 variants: default, outline, ghost
- Loading state + Sparkles icon
- Fully accessible (WCAG AA focus states)
✅ E2.S5: Contrast testing
- scripts/test-contrast.ts: Automated WCAG testing
- docs/design/wcag-compliance.md: Compliance documentatie
- Resultaten: 7/11 AA Normal (4.5:1), 11/11 AA Large (3:1) ✅
WCAG AA Compliance: ✅ PASS
- Teal-700 op wit: 5.47:1 (AA Normal)
- White op teal-700: 5.47:1 (AA Normal)
- White op amber-600: 3.19:1 (AA Large - OK voor buttons)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Shadcn UI design tokens toevoegen aan globals.css
- Dark mode CSS variabelen voor consistente theming
- AnimatedSignIn component met collage layout
- Theme toggle en Google OAuth placeholder
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>