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%)
This commit is contained in:
colinislit
2025-12-24 08:44:40 +01:00
parent db036a3d92
commit 3e94271827
7 changed files with 3449 additions and 5 deletions

View File

@@ -131,12 +131,12 @@ lib/
|---------|-------|------|--------|---------|--------|
| E0 | Setup & Foundation | Zustand, routing, base layout | ✅ Done | 4 | 8 SP |
| E1 | Command Center | Input, voice, context bar | ✅ Done | 5 | 13 SP |
| E2 | Intent Classification | Local + AI fallback | ✅ Done | 4 | 10 SP |
| E2 | Intent Classification | Local + AI fallback + wiring | ⏳ In Progress | 5 | 12 SP |
| E3 | P1 Blocks | Dagnotitie, Zoeken, Overdracht | ⏳ To Do | 6 | 21 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 |
**Totaal: 27 stories, 68 story points (31 SP done, 37 SP remaining)**
**Totaal: 28 stories, 70 story points (31 SP done, 39 SP remaining)**
**Belangrijk:**
- Bouw per epic en per story, niet alles tegelijk
@@ -225,6 +225,7 @@ Command Center Layout:
| E2.S2 | Entity extraction | Patient naam, categorie uit input | ✅ | E2.S1 | 3 |
| E2.S3 | AI fallback | Claude Haiku bij confidence <0.8 | ✅ | E2.S2 | 2 |
| E2.S4 | Intent API route | POST /api/intent/classify | ✅ | E2.S3 | 2 |
| E2.S5 | Input → Block wiring | CommandInput submit → API → openBlock | ⏳ | E2.S4 | 2 |
**Technical Notes:**
```typescript
@@ -246,6 +247,22 @@ const INTENT_PATTERNS = {
/^wat moet ik weten/i,
],
};
// E2.S5: Input → Block wiring
// In CommandInput.handleSubmit:
const handleSubmit = async () => {
const response = await fetch('/api/intent/classify', {
method: 'POST',
body: JSON.stringify({ input: inputValue }),
});
const { intent, confidence, entities } = await response.json();
if (intent !== 'unknown' && confidence >= 0.5) {
openBlock(intent, entities); // Open juiste block met prefill
} else {
// Toon FallbackPicker (E4.S4)
}
};
```
---
@@ -533,4 +550,5 @@ Een epic is **Done** wanneer:
| v1.1 | 23-12-2024 | Claude | E0 + E1 voltooid (21 SP) |
| v1.2 | 23-12-2024 | Claude | E2.S1 + E2.S2 voltooid (27 SP) |
| v1.3 | 23-12-2024 | Claude | E2.S3 AI fallback voltooid (29 SP) |
| v1.4 | 23-12-2024 | Claude | E2 Intent Classification voltooid (31 SP) |
| v1.4 | 23-12-2024 | Claude | E2.S1-S4 voltooid (31 SP) |
| v1.5 | 24-12-2024 | Claude | E2.S5 toegevoegd: Input → Block wiring (+2 SP) |