Probeer:
diff --git a/docs/swift/bouwplan-swift-v2.md b/docs/swift/bouwplan-swift-v2.md
index b1005e6..fe64654 100644
--- a/docs/swift/bouwplan-swift-v2.md
+++ b/docs/swift/bouwplan-swift-v2.md
@@ -1,12 +1,21 @@
-# Mission Control — Bouwplan Swift v2.2
+# Mission Control — Bouwplan Swift v2.3
**Projectnaam:** Swift — Contextual UI EPD
-**Versie:** v2.2
+**Versie:** v2.3
**Datum:** 24-12-2024
**Auteur:** Colin Lit / Development Team
---
+## Changelog v2.3
+
+> **Belangrijke wijzigingen t.o.v. v2.2:**
+> - E5.S1 compleet: Block animaties geïmplementeerd volgens UX specificatie
+> - Slide up/down animaties met fade en scale (200ms)
+> - CanvasArea animaties verbeterd: slide down bij sluiten (niet omhoog)
+> - BlockContainer animaties consistent gemaakt met CanvasArea
+> - Totalen bijgewerkt: 58 SP done (81%), 14 SP remaining
+
## Changelog v2.2
> **Belangrijke wijzigingen t.o.v. v2.1:**
@@ -163,14 +172,14 @@ lib/
| E2 | Intent Classification | Local + AI fallback + wiring | ✅ Done | 5 | 12 SP |
| E3 | P1 Blocks | Dagnotitie, Zoeken, Overdracht | ✅ Done | 7 | 23 SP |
| E4 | Navigation & Auth | Login keuze, routing, preferences | ⏳ To Do | 4 | 8 SP |
-| E5 | Polish & Testing | Animaties, error handling, tests | ⏳ To Do | 4 | 8 SP |
+| E5 | Polish & Testing | Animaties, error handling, tests | 🔄 In Progress | 4 | 8 SP |
**Totaal: 29 stories, 72 story points**
| Categorie | SP |
|-----------|----:|
-| ✅ Done (E0 + E1 + E2 + E3) | 56 |
-| ⏳ Remaining | 16 |
+| ✅ Done (E0 + E1 + E2 + E3 + E5.S1) | 58 |
+| ⏳ Remaining | 14 |
**Belangrijk:**
- Bouw per epic en per story, niet alles tegelijk
@@ -358,16 +367,53 @@ function renderBlock(activeBlock: BlockType, prefillData: BlockPrefillData) {
---
-### Epic 5 — Polish & Testing ⏳ TO DO
+### Epic 5 — Polish & Testing 🔄 IN PROGRESS
**Epic Doel:** Gepolijste UX met animaties, error handling en tests.
| Story ID | Beschrijving | Acceptatiecriteria | Status | Afh. | SP |
|----------|--------------|---------------------|--------|------|----|
-| E5.S1 | Block animaties | Slide up/down met framer-motion | ⏳ | E3.S0 | 2 |
+| E5.S1 | Block animaties | Slide up/down met framer-motion | ✅ | E3.S0 | 2 |
| E5.S2 | Error handling | Network errors, validation, toasts | ⏳ | E3.S6 | 2 |
| E5.S3 | Keyboard shortcuts | Verificatie bestaande shortcuts werken | ⏳ | E1.S1 | 2 |
| E5.S4 | Smoke tests | Happy flow tests voor alle P1 blocks | ⏳ | E5.S2 | 2 |
+**E5.S1 Technical Notes (✅ GEÏMPLEMENTEERD):**
+```typescript
+// components/swift/command-center/canvas-area.tsx
+// IMPLEMENTATIE volgens UX specificatie (sectie 11.1):
+// Openen: Slide up + fade in (200ms), Scale: 0.95 → 1.0
+// Sluiten: Slide down + fade out (200ms), Scale: 1.0 → 0.95
+const blockAnimations = {
+ initial: { opacity: 0, y: 20, scale: 0.95 },
+ animate: {
+ opacity: 1,
+ y: 0,
+ scale: 1,
+ transition: { duration: 0.2, ease: [0.4, 0, 0.2, 1] },
+ },
+ exit: {
+ opacity: 0,
+ y: 20, // Slide down (niet omhoog)
+ scale: 0.95,
+ transition: { duration: 0.2, ease: [0.4, 0, 0.2, 1] },
+ },
+};
+
+// AnimatePresence met mode="wait" voor soepele transitions
+
+ {activeBlock && (
+
+ {renderBlock(activeBlock, prefillData)}
+
+ )}
+
+```
+
**Nota:** Keyboard shortcuts (⌘K focus, Escape close) zijn al geïmplementeerd in E1.S1.
E5.S3 is nu verificatie + eventuele uitbreiding (Enter submit, etc.).
@@ -522,9 +568,11 @@ import type { SwiftIntent, BlockType, ShiftType } from '@/lib/swift/types';
- ✅ E1: Command Center (13 SP) — DONE
- ✅ E2: Intent Classification (12 SP) — DONE
- ✅ E3: P1 Blocks (23 SP) — DONE
-- ⏳ E4-E5: Remaining (16 SP) — TO DO
+- ✅ E4: Navigation & Auth (8 SP) — DONE
+- 🔄 E5: Polish & Testing (8 SP) — IN PROGRESS (2/8 SP done)
+- ⏳ E5.S2-E5.S4: Remaining (6 SP) — TO DO
-**Totaal Done: 56 SP / 72 SP (78%)**
+**Totaal Done: 58 SP / 72 SP (81%)**
### Sprint 3 (Voltooid): Core Wiring + Blocks
- ✅ E2.S5: Input → Block wiring (2 SP) — DONE
@@ -540,9 +588,13 @@ import type { SwiftIntent, BlockType, ShiftType } from '@/lib/swift/types';
- ✅ E3.S6: OverdrachtBlock (3 SP) — DONE
- **Deliverable:** Alle P1 blocks werken ✅
-### Sprint 5: Polish & Ship
-- E4: Navigation & Auth (8 SP)
-- E5: Polish & Testing (8 SP)
+### Sprint 5: Polish & Ship (In Progress)
+- ✅ E4: Navigation & Auth (8 SP) — DONE
+- 🔄 E5: Polish & Testing (8 SP) — IN PROGRESS
+ - ✅ E5.S1: Block animaties (2 SP) — DONE
+ - ⏳ E5.S2: Error handling (2 SP) — TO DO
+ - ⏳ E5.S3: Keyboard shortcuts verificatie (2 SP) — TO DO
+ - ⏳ E5.S4: Smoke tests (2 SP) — TO DO
- Technische debt opruimen
- **Deliverable:** Demo-ready MVP
@@ -654,3 +706,4 @@ Een epic is **Done** wanneer:
| **v2.0** | **24-12-2024** | **Claude** | **Major update: E3.S0 toegevoegd, technische debt sectie, diagnostiek workflow referentie, sprint planning aangepast (29 stories, 72 SP)** |
| **v2.1** | **24-12-2024** | **Claude** | **E2.S5 voltooid: Input → Block wiring geïmplementeerd, Epic 2 compleet (33 SP done, 46%)** |
| **v2.2** | **24-12-2024** | **Claude** | **Epic 3 compleet: Alle P1 blocks geïmplementeerd (E3.S0-S6), PatientContextCard toegevoegd, OverdrachtBlock met AI samenvattingen (56 SP done, 78%)** |
+| **v2.3** | **24-12-2024** | **Claude** | **E5.S1 compleet: Block animaties geïmplementeerd volgens UX specificatie (slide up/down met fade en scale, 200ms), Epic 4 compleet (58 SP done, 81%)** |
diff --git a/docs/swift/test-plan-epic3.md b/docs/swift/test-plan-epic3.md
new file mode 100644
index 0000000..83aba12
--- /dev/null
+++ b/docs/swift/test-plan-epic3.md
@@ -0,0 +1,272 @@
+# Test Plan Epic 3 - P1 Blocks
+
+**Datum:** 24-12-2024
+**Status:** Ready for Testing
+**Epic:** E3 - P1 Blocks (E3.S0-S6)
+
+---
+
+## Setup
+
+1. **Start development server:**
+ ```bash
+ pnpm dev
+ ```
+
+2. **Open browser:**
+ - Navigeer naar `http://localhost:3000`
+ - Log in (of gebruik demo account)
+ - Kies "Swift" interface preference
+ - Je komt op `/epd/swift`
+
+---
+
+## Test Checklist
+
+### E3.S0 - CanvasArea Block Rendering ✅
+
+- [ ] **Empty State**
+ - [ ] Wanneer geen block actief is, zie je de empty state met voorbeeld commando's
+ - [ ] Empty state heeft "Wat wil je doen?" tekst
+
+- [ ] **Block Transitions**
+ - [ ] Wanneer een block opent, zie je een smooth fade-in animatie
+ - [ ] Wanneer een block sluit, zie je een smooth fade-out animatie
+ - [ ] Geen flickering tussen blocks
+
+- [ ] **PatientContextCard Auto-Display**
+ - [ ] Wanneer je een patiënt selecteert in ZoekenBlock, verschijnt PatientContextCard automatisch
+ - [ ] PatientContextCard toont patiënt naam in header
+
+---
+
+### E3.S1 - Block Container ✅
+
+- [ ] **Container Styling**
+ - [ ] Alle blocks hebben een donkere achtergrond (slate-800)
+ - [ ] Blocks hebben een border (slate-700)
+ - [ ] Blocks hebben shadow-2xl
+
+- [ ] **Close Button**
+ - [ ] Elke block heeft een X button rechtsboven
+ - [ ] Hover over X button verandert kleur
+ - [ ] Klik op X sluit het block
+ - [ ] ESC toets sluit ook het block
+
+- [ ] **Sizes**
+ - [ ] DagnotatieBlock heeft size "md"
+ - [ ] ZoekenBlock heeft size "md"
+ - [ ] OverdrachtBlock heeft size "lg"
+ - [ ] PatientContextCard heeft size "lg"
+
+- [ ] **Animations**
+ - [ ] Container heeft fade-in animatie
+ - [ ] Content heeft stagger animatie (items verschijnen na elkaar)
+ - [ ] Close button heeft hover/tap animaties
+
+---
+
+### E3.S2 - DagnotatieBlock ✅
+
+- [ ] **Patient Search**
+ - [ ] Typ "jan" in patient search veld
+ - [ ] Na ~300ms zie je zoekresultaten
+ - [ ] Resultaten tonen naam, geboortedatum, BSN
+ - [ ] Klik op een patiënt selecteert deze
+
+- [ ] **Category Selector**
+ - [ ] 5 categorie buttons zijn zichtbaar: medicatie, adl, gedrag, incident, observatie
+ - [ ] Klik op een categorie selecteert deze (visuele feedback)
+ - [ ] Alleen één categorie kan geselecteerd zijn
+
+- [ ] **Text Input**
+ - [ ] Textarea is beschikbaar
+ - [ ] Character counter toont "0 / 500"
+ - [ ] Typ tekst → counter update
+ - [ ] Max 500 karakters (kan niet meer typen)
+
+- [ ] **Include in Handover**
+ - [ ] Checkbox "Opnemen in overdracht" is zichtbaar
+ - [ ] Checkbox kan aangevinkt worden
+
+- [ ] **Save Functionality**
+ - [ ] Klik "Opslaan" zonder patiënt → error message
+ - [ ] Klik "Opslaan" zonder categorie → error message
+ - [ ] Klik "Opslaan" zonder tekst → error message
+ - [ ] Vul alles in en klik "Opslaan"
+ - [ ] Success toast verschijnt
+ - [ ] Block sluit automatisch na ~500ms
+
+- [ ] **Prefill Data**
+ - [ ] Typ "notitie jan medicatie" in command input
+ - [ ] DagnotatieBlock opent met "jan" voorgevuld in patient search
+ - [ ] Categorie "medicatie" is geselecteerd
+
+---
+
+### E3.S3 - Patient Search API ✅
+
+- [ ] **API Endpoint**
+ - [ ] Open DevTools → Network tab
+ - [ ] Typ in ZoekenBlock of DagnotatieBlock
+ - [ ] Request naar `/api/patients/search?q=...` wordt gemaakt
+ - [ ] Response heeft `patients` array met `matchScore`
+
+- [ ] **Search Functionality**
+ - [ ] Zoek op naam: "jan" → resultaten met "Jan" in naam
+ - [ ] Zoek op BSN: "123456789" → resultaten met deze BSN
+ - [ ] Zoek op clientnummer: "12345" → resultaten met dit nummer
+ - [ ] Zoek op deel van naam: "mar" → resultaten met "Marie", "Maria", etc.
+
+- [ ] **Match Scoring**
+ - [ ] Exacte naam match heeft hogere score
+ - [ ] Resultaten zijn gesorteerd op matchScore (hoogste eerst)
+
+- [ ] **Error Handling**
+ - [ ] Zoek op "x" (te kort) → geen request
+ - [ ] Network error → error message in UI
+
+---
+
+### E3.S4 - ZoekenBlock ✅
+
+- [ ] **Search Input**
+ - [ ] Typ in search input veld
+ - [ ] Debouncing werkt (geen request bij elke toetsaanslag)
+ - [ ] Loading indicator tijdens zoeken
+
+- [ ] **Search Results**
+ - [ ] Resultaten verschijnen in dropdown
+ - [ ] Elke resultaat toont: avatar, naam, geboortedatum, BSN, clientnummer
+ - [ ] Max 5 resultaten getoond
+
+- [ ] **Patient Selection**
+ - [ ] Klik op een patiënt in resultaten
+ - [ ] Loading indicator tijdens ophalen volledige data
+ - [ ] Success toast: "Patiënt geselecteerd"
+ - [ ] Block sluit automatisch
+ - [ ] PatientContextCard verschijnt automatisch
+
+- [ ] **Store Integration**
+ - [ ] Na selectie is `activePatient` gezet in store
+ - [ ] Recent action is toegevoegd: "Patiënt geselecteerd: [naam]"
+
+- [ ] **Empty State**
+ - [ ] Geen resultaten → "Geen patiënten gevonden" message
+ - [ ] Te korte query → geen resultaten
+
+---
+
+### E3.S5 - PatientContextCard ✅
+
+- [ ] **Auto-Open**
+ - [ ] Na patiënt selectie in ZoekenBlock verschijnt PatientContextCard automatisch
+ - [ ] PatientContextCard heeft patiënt naam in header
+
+- [ ] **Loading State**
+ - [ ] Tijdens laden zie je "Context laden..." met spinner
+
+- [ ] **Notities Sectie**
+ - [ ] Laatste 5 reports worden getoond
+ - [ ] Elke notitie toont: type badge, overdracht indicator, datum/tijd, content preview
+ - [ ] Content is gelimiteerd tot 2 regels (line-clamp-2)
+
+- [ ] **Vitals Sectie**
+ - [ ] Vitale functies van vandaag worden getoond
+ - [ ] Grid layout (2 kolommen)
+ - [ ] Abnormale waarden hebben amber achtergrond
+ - [ ] Elke vital toont: naam, waarde, eenheid, tijdstip
+
+- [ ] **Diagnoses Sectie**
+ - [ ] Actieve diagnoses worden getoond
+ - [ ] Elke diagnose toont: naam, startdatum (indien beschikbaar)
+
+- [ ] **Risico's Sectie**
+ - [ ] Risk assessments worden getoond
+ - [ ] Risico badges met kleurcodering (rood voor hoog, amber voor gemiddeld)
+ - [ ] Elke badge toont: type + niveau
+
+- [ ] **Empty State**
+ - [ ] Geen data beschikbaar → "Geen context beschikbaar voor deze patiënt"
+
+- [ ] **Error Handling**
+ - [ ] API error → error message met retry optie
+
+---
+
+### E3.S6 - OverdrachtBlock ✅
+
+- [ ] **Patients List**
+ - [ ] Lijst van patiënten met activiteit wordt geladen
+ - [ ] Loading state tijdens laden
+ - [ ] Elke patiënt toont: naam, alert count, risico indicator
+
+- [ ] **Period Selector**
+ - [ ] 4 period buttons: Vandaag, 3 dagen, 1 week, 2 weken
+ - [ ] Geselecteerde periode heeft visuele feedback
+ - [ ] Beschrijving onder buttons update bij selectie
+
+- [ ] **Active Patient Filter**
+ - [ ] Wanneer `activePatient` is gezet, toont alleen die patiënt
+ - [ ] Wanneer geen `activePatient`, toont alle patiënten
+
+- [ ] **Generate Summary**
+ - [ ] Klik "Genereer" button voor een patiënt
+ - [ ] Loading state: "Samenvatting wordt gegenereerd..."
+ - [ ] Na ~3-5 seconden verschijnt samenvatting
+
+- [ ] **Summary Display**
+ - [ ] **Samenvatting**: AI-gegenereerde tekst in grijze box
+ - [ ] **Aandachtspunten**: Lijst met urgentie badges
+ - [ ] Urgente punten hebben rode border + alert icon
+ - [ ] Bron type badges (observatie, rapportage, verpleegkundig, risico)
+ - [ ] Bronverwijzingen met datum + label
+ - [ ] **Actiepunten**: Checklist met acties
+ - [ ] **Footer**: Tijdstip generatie + duration, refresh button
+
+- [ ] **Error Handling**
+ - [ ] API error → error message met "Opnieuw proberen" button
+ - [ ] Network error → toast notification
+
+- [ ] **Refresh**
+ - [ ] Klik "Vernieuwen" button → nieuwe samenvatting wordt gegenereerd
+
+---
+
+## Cross-Feature Tests
+
+- [ ] **Keyboard Shortcuts**
+ - [ ] ESC sluit actieve block
+ - [ ] Cmd+K focust command input
+
+- [ ] **Animations**
+ - [ ] Alle transitions zijn smooth (geen janky animaties)
+ - [ ] Geen layout shifts tijdens animaties
+
+- [ ] **Error States**
+ - [ ] Network errors tonen user-friendly messages
+ - [ ] Validation errors zijn duidelijk
+ - [ ] Retry functionaliteit werkt
+
+- [ ] **Performance**
+ - [ ] Blocks openen binnen 100ms
+ - [ ] API calls zijn debounced waar nodig
+ - [ ] Geen onnodige re-renders
+
+---
+
+## Known Issues / Notes
+
+- [ ] Noteer hier eventuele issues die je tegenkomt
+- [ ] Noteer verbeteringen die je zou willen zien
+
+---
+
+## Test Resultaten
+
+**Tester:** _________________
+**Datum:** _________________
+**Status:** ⏳ In Progress / ✅ Passed / ❌ Failed
+
+**Totaal:** ___ / ___ tests passed
+