Commit Graph

45 Commits

Author SHA1 Message Date
colinislit
855744c927 feat(swift): implementeer ArtifactContainer met tabs (E4.S1)
Epic 4 Story 1 compleet: Basis structuur voor meerdere artifacts met tabs.

E4.S1 - ArtifactContainer Component (5 SP)
- Artifact interface gedefineerd in store
- ArtifactTab component met active state en close button
- ArtifactContainer met conditional tab rendering
- Helper functies voor artifact rendering en titels

Nieuwe Components:
- components/swift/artifacts/artifact-tab.tsx (60 regels)
  - Tab UI met title, active state, close button
  - Hover effects en opacity animations
  - Min/max width, title truncation met tooltip
  - Stop propagation op close click

- components/swift/artifacts/artifact-container.tsx (127 regels)
  - Props: artifacts[], activeArtifactId, onSelect, onClose
  - Tabs alleen bij >1 artifact
  - renderArtifactBlock(): switch op artifact type
  - getArtifactTitle(): user-friendly titles met patient naam
  - Placeholder state wanneer geen artifacts

Artifact Interface:
```typescript
interface Artifact {
  id: string;
  type: BlockType;
  prefill: BlockPrefillData;
  title: string;
  createdAt: Date;
}
```

Features:
- Tab rendering: alleen bij meerdere artifacts
- Active tab styling: amber-500 border bottom
- Close button: opacity 0 → 100 on hover/active
- Title generation: "Dagnotitie - Jan" voor context
- Block rendering: dagnotitie, zoeken, overdracht, fallback
- Placeholder: "Artifacts verschijnen hier" met voorbeelden
- Responsive: min-w-[140px] max-w-[200px] per tab

Tab Styling:
- Active: bg-white + border-b-2 border-b-amber-500
- Hover: bg-slate-50
- Close button: group-hover:opacity-100
- Text: text-sm font-medium truncate

Build Status:
-  pnpm build succesvol (geen type errors)
- Alleen bekende warnings (Supabase realtime, useCallback)

Note: E4.S1 definieert structuur. E4.S2 voegt store management toe
(openArtifacts[], activeArtifactId, openArtifact(), closeArtifact()).

Voortgang: 53 SP / 85 SP (62%) - 17/31 stories compleet, 2 geskipt

Next: E4.S2 (Artifact lifecycle management) - Store state & actions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 16:29:01 +01:00
colinislit
3814189934 feat(swift): implementeer artifact opening from chat (E3.S6) 🎉
Epic 3 Story 6 compleet: Artifacts openen automatisch vanuit chat!
🎉 EPIC 3 COMPLEET - Medical Scribe Chat werkt end-to-end!

E3.S6 - Artifact Opening from Chat (2 SP)
- PendingAction state triggers artifact opening
- useEffect in CommandCenter luistert naar pendingAction
- Automatische block opening met prefill data
- Visual flow: Chat → AI → Action → Artifact verschijnt rechts

Components Updated:
- components/swift/artifacts/artifact-area.tsx (86 regels)
  - Renders DagnotatieBlock, ZoekenBlock, OverdrachtBlock
  - Placeholder state wanneer geen block actief
  - Conditional rendering based on activeBlock state

- components/swift/command-center/command-center.tsx
  - useEffect voor pendingAction handling
  - openBlock(type, prefill) aanroep
  - setPendingAction(null) cleanup
  - Console logging voor debugging

Artifact Opening Flow:
1. User: "Notitie voor Jan: medicatie gegeven"
2. AI response met JSON action (confidence 0.95)
3. ChatPanel: parseActionFromResponse()
4. ChatPanel: setPendingAction(action) if confidence ≥ 0.7
5. CommandCenter: useEffect triggers op pendingAction
6. CommandCenter: openBlock('dagnotitie', { patientName: 'Jan', ... })
7. ArtifactArea: Renders DagnotatieBlock met prefill
8. setPendingAction(null) cleanup

Features:
- Automatische artifact opening bij high confidence (≥0.7)
- Prefill data van AI naar block (patientName, category, content, etc.)
- Console logging voor debugging:
  - "[CommandCenter] Processing pending action: {...}"
  - "[CommandCenter] Opening artifact: dagnotitie with prefill: {...}"
- Placeholder state met voorbeelden wanneer geen artifact actief
- Overflow-y-auto voor scrollable artifacts

Blocks Supported:
- dagnotitie → DagnotatieBlock
- zoeken → ZoekenBlock
- overdracht → OverdrachtBlock
- fallback → FallbackPicker

Build Status:
-  pnpm build succesvol (geen type errors)
- Alleen bekende warnings (Supabase realtime, useCallback)

Epic 3 Summary (Chat API & Medical Scribe):
-  E3.S1 — Chat API endpoint skeleton (3 SP)
-  E3.S2 — Streaming response logic (5 SP)
-  E3.S3 — Medical scribe system prompt (3 SP)
-  E3.S4 — Intent detection in response (5 SP)
-  E3.S5 — Frontend streaming (GESKIPT - 3 SP)
-  E3.S6 — Artifact opening from chat (2 SP)

Epic 3 Stats: 5/6 stories (18 SP), 1 geskipt (3 SP)

Voortgang: 48 SP / 85 SP (56%) - 16/31 stories compleet, 2 geskipt

Next Epic: E4 (Artifact Area & Tabs) - Meerdere artifacts, tabs, animaties

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 16:23:00 +01:00
colinislit
9b85448a43 feat(swift): implementeer intent detection & action parsing (E3.S4)
Epic 3 Story 4 compleet: AI action objects worden geparsed en gevalideerd.

E3.S4 - Intent Detection in Response (5 SP)
- Action parser met JSON extraction uit markdown code blocks
- Zod validatie voor action schema (intent, entities, confidence, artifact)
- Confidence-based artifact opening (≥0.7 threshold)
- Visual feedback met action badges in chat messages
- Console logging voor debugging

Nieuwe Components:
- lib/swift/action-parser.ts (149 regels)
  - parseActionFromResponse(): Extract & validate JSON actions
  - extractJsonBlock(): Regex matching voor ```json blocks
  - removeJsonBlocks(): Clean text zonder JSON
  - shouldOpenArtifact(): Confidence check (≥0.7)
  - getConfidenceLabel(): "Zeer zeker", "Redelijk zeker", etc.
  - validateArtifactType(): Intent/artifact type matching

Components Updated:
- components/swift/chat/chat-panel.tsx
  - Action parsing in onDone callback
  - setPendingAction voor artifact opening (E3.S6)
  - Console logging: "[ChatPanel] Action detected"

- components/swift/chat/chat-message.tsx
  - Action badge met Sparkles icon
  - Intent label (Dagnotitie, Patiënt zoeken, Overdracht)
  - CheckCircle icon voor high confidence (≥0.7)
  - Confidence label display

- stores/swift-store.ts
  - updateLastMessage(): Optional action parameter
  - Type-safe action assignment (null/undefined handling)

Features:
- JSON extraction via regex: /```json\s*\n([\s\S]*?)\n```/
- Zod schema: type, intent, entities, confidence, artifact
- Confidence thresholds: >0.9, 0.7-0.9, 0.5-0.7, <0.5
- Visual feedback: Sparkles + CheckCircle icons
- Cleaned text content (JSON removed from display)
- Action stored in message.action en pendingAction state

Action Schema:
```typescript
{
  type: "action",
  intent: "dagnotitie" | "zoeken" | "overdracht" | "unknown",
  entities: {
    patientName?: string,
    patientId?: string,
    category?: "medicatie" | "adl" | "gedrag" | "incident" | "observatie",
    content?: string,
    query?: string
  },
  confidence: number, // 0-1
  artifact?: {
    type: BlockType,
    prefill: Record<string, any>
  }
}
```

Build Status:
-  pnpm build succesvol (geen type errors)
- Alleen bekende warnings (Supabase realtime, useCallback)

Voortgang: 46 SP / 85 SP (54%) - E3.S4 compleet

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 16:11:43 +01:00
colinislit
a51acf6214 feat(swift): voeg chat API met Claude streaming toe (E3.S1-S2)
E3.S1 - Chat API endpoint skeleton (3 SP)
- /api/swift/chat route met SSE setup
- Zod validation (message, messages, context)
- Authentication check (session required)
- Rate limiting (20 requests per minute)
- Request body schema voor chat messages en context

E3.S2 - Streaming response logic (5 SP)
- Claude API integration (Anthropic Sonnet 4)
- Real-time streaming via Server-Sent Events
- Event parsing (content_block_delta, message_stop, error)
- Simple system prompt met context injection
- Error handling voor API failures

API Route Features:
- Model: claude-sonnet-4-20250514
- Max tokens: 2048, Temperature: 0.7
- Conversation history: max 20 messages
- Rate limiting per user (20 req/min)
- Request cancellation support
- Context: activePatient + shift

SSE Event Format:
- content_block_delta → {"type":"content","text":"..."}
- message_stop → {"type":"done"}
- error → {"type":"error","error":"..."}

Client Helper (lib/swift/chat-api.ts):
- sendChatMessage() function voor frontend
- SSE stream parsing met TextDecoder
- Callbacks: onChunk, onDone, onError
- Error handling en retry logic

ChatPanel Integration:
- Real-time streaming met updateLastMessage()
- isStreaming state voor UI feedback
- Context injection (patient, shift)
- Error messages in chat

System Prompt (Simple):
- Nederlandse medische assistent voor Swift GGZ EPD
- Context-aware (patiënt + dienst)
- Vriendelijk en professioneel
- Medical scribe functionaliteit komt in E3.S3

Files Created:
- app/api/swift/chat/route.ts (279 regels)
- lib/swift/chat-api.ts (113 regels)

Files Updated:
- components/swift/chat/chat-panel.tsx (+52 regels) - Streaming integration

Epic 3 Progress: 2/6 stories compleet (8 SP / 21 SP = 38%)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 14:26:16 +01:00
colinislit
d2931a36f8 feat(swift): voeg keyboard shortcuts toe aan chat (E2.S5)
E2.S5 - Keyboard shortcuts (1 SP)
- ⌘K / Ctrl+K om chat input te focussen (global)
- Escape om input te clearen (local)
- Enter om bericht te versturen (al in E2.S4)
- Shift+Enter voor nieuwe regel (al in E2.S4)

ChatInput Updates:
- forwardRef toegevoegd voor ref support
- useImperativeHandle voor focus() en clear() methods
- ChatInputHandle interface geëxporteerd
- Escape key handler (clears input + resets height)
- Helper text updated: "⌘K focus • Esc clear • Enter versturen"

ChatPanel Updates:
- chatInputRef toegevoegd (ChatInputHandle type)
- Global keyboard event listener voor ⌘K/Ctrl+K
- Cross-platform support (metaKey voor macOS, ctrlKey voor Windows/Linux)
- preventDefault() om browser conflicts te voorkomen
- Cleanup listener bij unmount

Keyboard Shortcuts:
- ⌘K / Ctrl+K: Focus chat input (global window listener)
- Escape: Clear input (local textarea handler)
- Enter: Submit message (E2.S4)
- Shift+Enter: New line (E2.S4)

Cross-platform:
- macOS: ⌘K (e.metaKey)
- Windows/Linux: Ctrl+K (e.ctrlKey)
- Both: Escape, Enter, Shift+Enter

Components Updated:
- components/swift/chat/chat-input.tsx (+17 regels)
- components/swift/chat/chat-panel.tsx (+15 regels)

🎉 Epic 2 Compleet! 5/5 stories (13 SP / 13 SP = 100%)

Epic 2 Deliverables:
- E2.S1: Chat state in store (chatMessages, isStreaming, actions)
- E2.S2: ChatMessage component (4 message types met styling)
- E2.S3: Scrolling (auto-scroll, scroll-lock, scroll-to-bottom button)
- E2.S4: ChatInput (textarea, Enter submit, auto-resize)
- E2.S5: Keyboard shortcuts (⌘K focus, Escape clear)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 14:10:38 +01:00
colinislit
8f6f24f757 feat(swift): voeg chat input met keyboard shortcuts toe (E2.S4)
E2.S4 - ChatInput component (2 SP)
- Textarea met multi-line support en auto-resize
- Enter to submit functionaliteit
- Shift+Enter voor nieuwe regel
- Integration met store (addChatMessage)
- Send en Mic buttons (Lucide icons)
- Helper text met keyboard shortcuts

Input Features:
- Auto-resize textarea (max 8 lines / 128px)
- Focus management (auto-focus na submit)
- Disabled state support
- Brand colors voor focus/hover states
- Placeholder: "Typ of spreek wat je wilt doen..."

Keyboard Shortcuts:
- Enter: verstuur bericht (preventDefault als niet Shift)
- Shift+Enter: nieuwe regel (default textarea behavior)
- Auto-clear input na submit

UI Components:
- Send button (rechts, alleen enabled met content)
- Mic button placeholder (voor E5.S3 voice input)
- Helper text met <kbd> tags voor shortcuts
- Smooth transitions en hover effects

ChatPanel Integration:
- ChatInput component vervangen placeholder
- Demo messages verwijderd (nu echte chatMessages uit store)
- Auto-scroll werkt met nieuwe user messages

Components Created:
- components/swift/chat/chat-input.tsx (153 regels)

Components Updated:
- components/swift/chat/chat-panel.tsx (-108 demo messages, +ChatInput)

Epic 2 Progress: 4/5 stories compleet (12 SP / 13 SP = 92%)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 14:06:38 +01:00
colinislit
b5e245e0fb feat(swift): voeg scrolling functionaliteit toe aan chat (E2.S3)
E2.S3 - ChatPanel scrolling (5 SP)
- Scrollable message list met refs (scrollContainerRef, messagesEndRef)
- Auto-scroll naar laatste message bij nieuwe berichten
- Scroll-lock detection (100px threshold)
- "Scroll naar beneden" button tijdens scroll-lock
- Initial scroll to bottom bij mount

Scrolling Logic:
- useRef voor scroll container en messages end tracking
- useState voor isScrolledUp en showScrollButton state
- handleScroll() detecteert wanneer user omhoog scrollt
- scrollToBottom() met smooth/auto behavior support
- Auto-scroll alleen wanneer NIET scrolled up (scroll-lock)

Scroll Button:
- ArrowDown icon (Lucide)
- Positioned absolute bottom-4 right-4
- Shadow + hover effects, smooth transitions
- Verschijnt alleen bij scroll-lock en messages present
- Aria-label voor accessibility

Testing:
- 12 demo messages voor scrolling behavior test
- Conversatie flow: notitie, zoeken, overdracht
- Scroll threshold: 100px vanaf bottom

Components Updated:
- components/swift/chat/chat-panel.tsx (+68 regels)

Epic 2 Progress: 3/5 stories compleet (10 SP / 13 SP = 77%)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 14:00:47 +01:00
colinislit
e3ff72cd9c feat(swift): voeg chat messages en styling toe (E2.S1-S2)
E2.S1 - Store uitbreiding (2 SP)
- ChatMessage, ChatAction, ChatMessageType types toegevoegd
- chatMessages[], isStreaming, pendingAction state
- addChatMessage, updateLastMessage, clearChat, setStreaming actions

E2.S2 - ChatMessage component (3 SP)
- Herbruikbare ChatMessage component met 4 message types
- MESSAGE_STYLES config (user/assistant/system/error)
- User: amber bubble rechts, rounded-tr-sm
- Assistant: slate bubble links, rounded-tl-sm
- System: centered, transparent, italic
- Error: red bubble links
- Optional timestamp support (NL locale)
- Demo messages in ChatPanel voor testing

Components Created:
- components/swift/chat/chat-message.tsx (77 regels)
- components/swift/chat/chat-panel.tsx (102 regels)

Store Updated:
- stores/swift-store.ts (+87 regels) - Chat state en actions

Epic 2 Progress: 2/5 stories compleet (5 SP / 13 SP = 38%)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 13:55:35 +01:00
colinislit
c77f1eb554 redesigdn docs 2025-12-27 13:17:00 +01:00
colinislit
33c6698870 feat(swift): Epic 5 Progress - Error Handling & Keyboard Shortcuts (E5.S2-S3)
Epic 5 deels compleet: Error handling en keyboard shortcuts geïmplementeerd.
Voortgang: 62 SP / 72 SP (86%) - Nog 1 story voor MVP compleet!

E5.S2 - Error Handling (2 SP)
- Gecentraliseerde error handler utility (lib/swift/error-handler.ts)
- isOffline(), isNetworkError(), getErrorInfo() functies
- safeFetch() wrapper met 30s timeout en retry logic
- retryFetch() met exponential backoff (max 3 retries)
- User-friendly Nederlandse error messages voor alle HTTP status codes
- OfflineBanner component met online/offline detection
- Alle blocks en CommandInput gebruiken nieuwe error handler
- Context bar margin adjustment voor offline banner
- parseErrorResponse() voor HTML error detection

E5.S3 - Keyboard Shortcuts (2 SP)
- ⌘Enter / Ctrl+Enter quick submit in CommandInput
- ⌘Enter / Ctrl+Enter quick save in DagnotatieBlock
- Visual hints (⌘↵) op submit button in DagnotatieBlock
- Geverifieerd: ⌘K focus, Escape close, 1-3 FallbackPicker
- Cross-platform support (macOS + Windows/Linux)
- preventDefault() voor browser conflict preventie

Components Updated:
- DagnotatieBlock: safeFetch, getErrorInfo, retryFetch, ⌘Enter save
- OverdrachtBlock: safeFetch, retryFetch voor AI generation
- ZoekenBlock: safeFetch, getErrorInfo voor patient search
- CommandInput: safeFetch, getErrorInfo, ⌘Enter submit
- CommandCenter: OfflineBanner integration
- ContextBar: useOffline hook voor margin adjustment

Nieuwe Files:
- lib/swift/error-handler.ts (301 regels) - Error handling utilities
- components/swift/command-center/offline-banner.tsx (72 regels)
- docs/swift/keyboard-shortcuts-reference.md (200+ regels)
- docs/swift/test-plan-e5-s2-error-handling.md (350+ regels)
- docs/swift/test-plan-e5-s3-keyboard-shortcuts.md (350+ regels)
- docs/swift/PROJECT-STATUS-2024-12-27.md (500+ regels) - Status report

Documentatie:
- Bouwplan bijgewerkt naar v2.5
- Epic completion details toegevoegd met progress bars
- Manual test checklist bijgewerkt (17/20 scenarios)
- Risico's sectie bijgewerkt (alle major risks gemitigeerd)
- Sprint planning status: E5 75% compleet (6/8 SP)

Technische verbeteringen:
- Offline detection met visual feedback
- Network error retry met exponential backoff
- HTTP 401/404/500/503 error messages in Nederlands
- Timeout protection (30s) op alle API calls
- Keyboard shortcuts met visual hints
- Cross-platform shortcut support

Testing:
- Error handling test plan met 8 categorieën
- Keyboard shortcuts test plan met 6 categorieën
- 40+ test scenarios gedocumenteerd
- Quick smoke test checklists

Voortgang: 62 SP / 72 SP (86%) - E5.S2 en E5.S3 compleet

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 09:27:32 +01:00
ikbenlit
5174b48f48 refactor(swift): Update UI styles and animations for improved consistency
- Changed background colors and text colors across various components to enhance readability and visual appeal.
- Updated animation properties for smoother transitions in CanvasArea and BlockContainer.
- Adjusted styles in FallbackPicker, OverdrachtBlock, and other components to align with the new design system.
- Improved accessibility by ensuring color contrasts meet standards.

This update aims to create a more cohesive user experience throughout the application.
2025-12-26 13:10:04 +01:00
colinislit
d67405df5f feat(swift): Epic 4 - Navigation & Auth compleet
E4.S1 - Login form uitbreiden:
- Interface selector (Swift/Klassiek) toegevoegd
- Visuele keuze met icons (Layout/Zap)
- Redirect naar gekozen interface na login

E4.S2 - Preference opslag:
- updateInterfacePreference() in lib/auth/client.ts
- getInterfacePreference() voor ophalen
- Opslag in user_metadata.preferred_interface

E4.S3 - Redirect middleware:
- /epd → redirect naar preferred interface
- /login → redirect naar preferred interface (als ingelogd)
- Default: klassiek (/epd/clients)

E4.S4 - Fallback Picker:
- FallbackPicker component voor lage confidence
- Grid met 3 opties (Notitie, Zoeken, Overdracht)
- Keyboard shortcuts [1], [2], [3]
- Toont originele input voor context

Voortgang: Epic 4 compleet (8 SP)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 09:28:10 +01:00
ikbenlit
2a67a0a2d9 git commit -m "feat(swift): implement Epic 3 - P1 Blocks (E3.S0-S6)" -m "Epic 3 compleet: Alle P1 blocks geïmplementeerd met volledige functionaliteit." -m "E3.S0 - CanvasArea block rendering" -m "- Switch/case voor block types met prefill data" -m "- AnimatePresence voor smooth transitions" -m "- PatientContextCard auto-display wanneer activePatient is gezet" -m "" -m "E3.S1 - Block Container animaties" -m "- Framer Motion animaties voor container, content en close button" -m "- Stagger effecten voor content children" -m "- Hover/tap animaties voor close button" -m "" -m "E3.S2 - DagnotatieBlock" -m "- Patient search met debounced FHIR API integratie" -m "- Category selector (medicatie, adl, gedrag, incident, observatie)" -m "- Textarea met character counter (max 500)" -m "- Opslaan naar /api/reports met validatie en error handling" -m "" -m "E3.S3 - Patient search API" -m "- GET /api/patients/search?q= met fuzzy search" -m "- Match score berekening voor resultaten" -m "- Auth check en error handling" -m "" -m "E3.S4 - ZoekenBlock" -m "- Debounced patient search met dropdown" -m "- Patient selectie → setActivePatient in store" -m "- Auto-close na selectie + recent action" -m "" -m "E3.S5 - PatientContextCard" -m "- Auto-open na patient selectie" -m "- Notities, vitals, diagnoses en risico's secties" -m "- API integratie met /api/overdracht/[patientId]" -m "" -m "E3.S6 - OverdrachtBlock" -m "- Lijst van patiënten met activiteit" -m "- Period selector (1d, 3d, 7d, 14d)" -m "- AI samenvatting generatie per patiënt" -m "- Aandachtspunten en actiepunten weergave" -m "" -m "Technische verbeteringen:" -m "- Technische debt opgelost: BlockContainer animaties, CanvasArea rendering" -m "- PatientContextCard toegevoegd aan blocks" -m "- Alle blocks gebruiken BlockContainer voor consistente styling" -m "" -m "Voortgang: 56 SP / 72 SP (78%) - Epic 3 compleet" 2025-12-24 09:06:39 +01:00
colinislit
3e94271827 feat: complete E2.S5 Input → Block wiring
- Implementeer handleSubmit met API call naar /api/intent/classify
- Voeg error handling en fallback naar dagnotitie toe
- Integreer openBlock en addRecentAction
- Update bouwplan: Epic 2 compleet (33 SP done, 46%)
2025-12-24 08:44:40 +01:00
colinislit
7f91e048f3 feat(swift): E1 Command Center voltooid
E1.S1 Command Center layout:
- 4-zone layout (context, canvas, recent, input)
- Keyboard shortcuts (⌘K focus, Escape close)
- CanvasArea met empty state + voorbeelden

E1.S2 Context Bar:
- Shift indicator met icons per dienst
- Patient chip met avatar + clear button
- Terug naar EPD link

E1.S3 Command Input:
- Dynamic placeholder op basis van context
- Send button (verschijnt bij input)
- Focus state met ring

E1.S4 Voice Input:
- useSwiftVoice hook (wraps Deepgram)
- Real-time waveform visualisatie
- Streaming transcript naar input

E1.S5 Recent Strip:
- Intent-based chips met icons + kleuren
- Relative time (zojuist, 5m, 2u)
- Click-to-repeat functionaliteit
- Quick hints bij lege state

Bouwplan bijgewerkt: E0+E1 done (21/68 SP, 31%)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-23 22:44:39 +01:00
colinislit
855b1e99ae feat(swift): E0 Setup & Foundation + documentatie
Swift - Contextual UI EPD: "Van 12 klikken naar 1 zin"

Documentatie:
- PRD, FO, TO, UX specificaties
- Bouwplan met 6 epics, 27 stories (68 SP)
- Analyse en onderzoeksdocumenten

E0 Setup & Foundation:
- E0.S1: Zustand v5.0.9 geïnstalleerd
- E0.S2: Swift store met context, blocks, input state
- E0.S3: /epd/swift route met eigen layout (dark theme)
- E0.S4: Folder structuur components/swift/, lib/swift/

Components:
- CommandCenter (container)
- ContextBar (shift, patient)
- CommandInput (text + voice button)
- RecentStrip (laatste 5 acties)
- BlockContainer (wrapper voor blocks)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-23 22:28:41 +01:00
colinislit
265d3a971f feat(diagnose+agenda): Diagnose module met ICD-10 en agenda uitbreidingen
Diagnose Module:
- Diagnose overzicht pagina met alle patiënt diagnoses
- Diagnosis manager met ICD-10 combobox zoekfunctie
- Diagnose kaarten met hoofddiagnose markering
- Modal voor nieuwe/bewerkte diagnoses
- ICD-10 GGZ codes dataset (lib/data/)
- Zod schemas voor diagnose validatie
- TypeScript types voor ICD-10 (lib/types/icd10.ts)
- Complete documentatie (PRD, FO, TO, Bouwplan)

Agenda Uitbreidingen:
- Patient context card in afspraak modal
- Rapportage composer direct in afspraak modal
- Rapportage bewerken vanuit gekoppelde rapportages
- Verbeterde focus styling voor inputs

Behandelplan:
- Flat componenten structuur (behandeldoel-card, form, planning)
- Context header component
- Uitgebreide types (lib/types/behandelplan.ts)
- Actions voor behandelplan beheer

UI Componenten:
- Command component (shadcn/ui) voor combobox
- Popover component (shadcn/ui)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 13:29:59 +01:00
colinislit
9e4e16035b feat(behandelplan): E3 UI componenten en documentatie updates
Behandelplan UI (E3):
- page-client.tsx: Client-side behandelplan pagina
- actions.ts: Server actions voor CRUD operaties
- behandelplan-view.tsx: Volledige behandelplan weergave
- behandelplan-list.tsx: Lijst van behandelplannen
- editable-section.tsx: Herbruikbare edit sectie component
- sections/: Goal, intervention en behandelstructuur forms

UI Componenten:
- components/ui/checkbox.tsx (shadcn)
- components/ui/input.tsx (shadcn)
- components/ui/select.tsx (shadcn)

Documentatie:
- agenda-systeem.mdx toegevoegd
- _index.json en metadata.json bijgewerkt

Dependencies:
- @radix-ui/react-checkbox toegevoegd

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-06 00:35:00 +01:00
colinislit
621e1c90f9 | Epic | Status | Wat is gedaan |
|---------------------|---------------|---------------------|
  | E0: Foundation      |  Afgerond    | Types + DB migratie |
  | E1: Leefgebieden    |  Afgerond    | 3 componenten       |
  | E2: AI Generatie    |  Nog te doen | -                   |
  | E3: Behandelplan UI |  Nog te doen | -                   |

  Gemaakte bestanden:
  - lib/types/leefgebieden.ts - 7 domeinen met kleuren/emoji's
  - lib/types/behandelplan.ts - SMART doelen, interventies, Zod schemas
  - components/behandelplan/leefgebieden-form.tsx - Intake formulier
  - components/behandelplan/leefgebieden-scores.tsx - Score weergave
  - components/behandelplan/leefgebieden-badge.tsx - Domain badges
  - components/behandelplan/index.ts - Exports
2025-12-04 09:09:23 +01:00
colinislit
8e8a8e6f49 Samenvatting van de fixes:
1. min-w-0 en box-border toegevoegd aan inputClassName en selectClassName - dit voorkomt dat inputs buiten hun
  grid-cellen groeien
  2. overflow-hidden toegevoegd aan de DialogContent - voorkomt dat content buiten de modal zichtbaar is
  3. overflow-hidden toegevoegd aan het form element
  4. Grid layout verbeterd voor datum/tijd: grid-cols-[1fr_auto_auto] met vaste breedte (w-24) voor de tijd inputs,
  zodat de datum meer ruimte krijgt
  5. min-w-0 toegevoegd aan alle grid children voor Type/Locatie

  Deze wijzigingen zorgen ervoor dat:
  - Invoervelden nooit buiten hun containers groeien
  - De modal content netjes binnen de grenzen blijft
  - De datum input meer ruimte krijgt dan de tijd inputs
  - Select dropdowns niet overflow veroorzaken
2025-12-03 17:02:27 +01:00
colinislit
aacada2197 chat suggestions, SEo integration, and more 2025-12-02 13:37:45 +01:00
colinislit
9dc2b4f216 feat: add rate limiting with countdown timer for docs chat
- Add in-memory rate limiter (10 requests/minute per user)
- Show informative message when limit reached explaining demo context
- Display countdown timer showing when chat becomes available again
- Auto-reset rate limit when timer expires
- Update documentation with rate limit FAQ and category selection flow

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 18:00:51 +01:00
colinislit
150548bc62 chat suggestions 2025-12-01 17:50:31 +01:00
colinislit
54f2c36eba finalize ai assistenat 2025-12-01 16:14:30 +01:00
colinislit
4775497dc7 feat: add docs chat widget UI components (E3)
- Add useDocsChat hook with message state, streaming, error handling
- Add ChatMessages component with auto-scroll and streaming cursor
- Add ChatInput component with Enter/Shift+Enter support
- Add DocsChatWidget floating container with amber styling
- Add AI integration specs (PRD, FO, bouwplan)

Implements Epic 3 of AI Documentatie Assistent feature.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 15:45:44 +01:00
colinislit
56b66ae6ff feat: improve streaming mic and deepgram token handling 2025-11-25 22:53:04 +01:00
colinislit
779ab85e5d feat: improve rapportage composer UX with TipTap editor
UI improvements based on UX review:
- Replace textarea with TipTap rich text editor
- Add mic button in editor toolbar (collapsible recorder)
- Remove duplicate type selection (keep only quick action buttons)
- Remove redundant "Nieuwe rapportage:" label
- Add streaming highlight on editor border during recording
- Extend RichTextEditor with toolbarExtra, isStreaming props

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 14:46:03 +01:00
colinislit
dce3943963 feat: rapportage UI refactor, speech streaming, docs & seed data
Rapportage:
- Refactor workspace into modular components (quick-actions, timeline-card, timeline-sidebar)
- Add updateReport action for inline editing
- Improve report timeline with better UX

Speech:
- Add Deepgram token API endpoint
- Add use-deepgram-streaming hook
- Add confidence-text component

Docs:
- Add architecture documentation
- Add performance optimization plan
- Add speech specs and seed data docs

Scripts & Data:
- Add seed-reports script and migration
- Update AGENTS.md guidelines

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 14:07:08 +01:00
colinislit
7033329e0f feat: add speech telemetry and bundle guard 2025-11-25 13:37:00 +01:00
colinislit
a789bebe96 feat: rapportage API, speech recorder refactor, docs reorganisatie
Multiple features and improvements:

Reports/Rapportage API:
- Created REST API endpoints: /api/reports (GET/POST), /api/reports/[id] (GET/PATCH/DELETE)
- Added /api/reports/classify endpoint for AI classification
- Supabase migrations: reports table + RLS policies
- Server utilities: api-client.ts for DRY fetch logic
- Type definitions: lib/types/report.ts with Zod schemas
- Removed old rapportage-modal component (replaced by split-view)

Speech Recorder Refactor:
- Moved speech-recorder from intake-specific to shared components/
- Updated treatment-advice-form to use new location
- Updated intake actions for speech functionality

UI Components (shadcn):
- Added dialog, dropdown-menu, toast, toaster components
- Added use-toast hook for toast notifications

Documentation:
- Reorganized docs/release/ → docs/reports/ for better structure
- Archived old specs to docs/specs/archive/
- Added screening-system.mdx documentation
- Added rapportage-split-view-design.md
- Added UI screenshots for troubleshooting

Dependencies:
- Updated package.json and pnpm-lock.yaml
- Regenerated database.types.ts from Supabase

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 14:14:06 +01:00
colinislit
ab2bec1260 fix: resolve TypeScript type errors across application
Fixed multiple TypeScript compilation errors that blocked production build:

Component Type Fixes:
- client-sidebar.tsx: Changed icon type from React.ElementType to
  React.ComponentType<{ className?: string }> for proper prop typing
- patient-form.tsx: Added type casting for FHIR extension property access
- page.tsx: Added explicit Intake[] type annotation
- document-card.tsx: Added null check for file_size property
- rich-text-editor.tsx: Removed invalid false parameter from setContent()

Data Model Fixes:
- actions.ts (intakes): Changed encounter status 'finished' to 'completed'
  (FHIR-compliant value)
- actions.ts (intakes): Set diagnosis clinical_status to always use 'active'
- actions.ts (intakes): Cast treatment_advice to Record<string, any>

Schema Extensions:
- lib/fhir/types/index.ts: Added extension property to FHIRPatient interface
  to support custom FHIR extensions (john-doe, insurance, GP, episode-status)

Validation Fixes:
- lib/types/intake.ts: Fixed Zod enum errorMap syntax (changed to message)

All changes ensure type safety while maintaining runtime functionality.
Build now completes successfully with zero TypeScript errors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 12:20:14 +01:00
colinislit
00ca026382 fix: stabilize build and archive configs 2025-11-23 11:42:40 +01:00
colinislit
c12063d58d fix: escape lint strings and add intake table types 2025-11-23 11:03:17 +01:00
colinislit
6fcb9a0e7b feat: migrate clients module to patients + add docs 2025-11-23 10:13:00 +01:00
colinislit
5f7ef0801d bento-grid login page, mobile friendly docs page 2025-11-20 20:14:29 +01:00
colinislit
540bffa9ab fix: optimize hero section height for mobile devices
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>
2025-11-20 12:15:32 +01:00
colinislit
e9f4ffc297 feat: add comprehensive documentation and client dashboard
- 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>
2025-11-19 22:48:41 +01:00
colinislit
6de5166373 logout - sidebar 2025-11-19 15:43:02 +01:00
colinislit
2505b27437 feat: add duplicate email detection via auth hook with fallback
- 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
2025-11-19 11:03:46 +01:00
colinislit
d4079b66c5 hero-section, start login 2025-11-18 13:55:16 +01:00
colinislit
b7d19a8e1a feat: Epic 1 completion - Marketing refactor met timeline en Bento Grid login
Epic 1 Stories (E1.S1 t/m E1.S6):

 E1.S1 - Verwijder EPD demo pagina
- Removed /epd route en credentials-box component
- Updated navigation: EPD Prototype → Login link
- Removed demo_users references from middleware en auth libs
- Cleaned up TypeScript errors in hero-section-2

 E1.S2 - Homepage vereenvoudigen
- Replaced lange manifesto (8000+ woorden) met statement section
- Added problem-solution-proof format (3 paragrafen)
- Removed comparison table, experiment CTA, manifesto content
- Timeline placeholder toegevoegd (completed in E1.S3)

 E1.S3 - Timeline component integreren
- Created BuildTimeline component (Aceternity UI pattern)
- Added timeline.json met 4 weken data (Week 1 completed)
- Features per week met icons, metrics, achievements
- Scroll-based animation met Framer Motion
- Responsive design (sticky titles, mobile/desktop layouts)

 E1.S4 - Timeline content structuur
- Structured JSON data in content/nl/timeline.json
- 15 Lucide icons voor feature types
- Week status badges (completed/in_progress/planned)
- Time savings display (< 5 sec vs 30 min)

 E1.S5 - Login pagina refactor
- Split-screen layout (60% features, 40% login)
- Teal gradient showcase met 4 feature cards
- Time savings badges per feature
- Responsive stack layout voor mobile
- Footer met AI Speedrun branding

 E1.S6 - Bento Grid showcase
- Replaced feature grid met Bento Grid layout
- Variable card sizes voor visual hierarchy (col-span-2, col-span-1)
- Dark slate background (from-slate-900)
- Gradient backgrounds per card (teal, amber, purple)
- Stats footer met 3 key metrics (90%+, < 5 sec, 4 weken)
- Hover animations en glassmorphism effects

🎨 Design System:
- Teal-first brand colors (#0D9488)
- Amber accents voor AI features (#F59E0B)
- Slate scale voor neutral colors
- WCAG AA compliant contrast

📦 Components:
- BuildTimeline (app/(marketing)/components)
- BentoGrid & BentoCard (components/ui)
- Button variants (components/ui)

📄 Content:
- timeline.json met volledige 4-weken data
- Features array per week
- Metrics en achievements tracking

🔧 Technical:
- Removed demo user scripts en migrations
- Updated middleware routes (removed /epd)
- TypeScript type fixes (hero-section-2, auth)
- Build succesvol: 13 routes generated

🚀 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 19:22:49 +01:00
colinislit
273c00f9e8 Epic 2: Design System Migration - Teal-first implementatie
 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>
2025-11-17 17:38:22 +01:00
colinislit
1591e3271a new ux start 2025-11-17 17:24:35 +01:00
colinislit
1592fdfac6 Styling updates en sign-in component
- 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>
2025-11-17 15:26:50 +01:00
colinislit
690e7b7c43 Content loader utility, Content directory structuur 2025-11-15 22:06:48 +01:00