feat(demo): add Demo Guide (8-step guided tour) and scenario overview

Adds a compact "Probeer een demonstratiescenario" page listing the 5 named
scenarios with live readiness from the manifest, plus a Demo Guide side
panel (bottom sheet on mobile) that walks an Operations Manager through
all 8 steps with per-step context, live-resolved routes, sessionStorage
progress, and a "Demo opnieuw voorbereiden" restart. Login's guided-demo
CTA now actually opens the guide. Fixes a real mobile topbar overflow the
new guide trigger introduced.
This commit is contained in:
NuklearRabbit
2026-08-03 14:15:15 +02:00
parent c63903cc94
commit 9fff84dc68
11 changed files with 647 additions and 29 deletions
+38
View File
@@ -593,3 +593,41 @@ scenarios, demo manifest, About page). Gap audit: `docs/demo-release/current-dem
server demo-ready.
- Exact next action: Demo Guide (collapsible panel, 8 steps) + scenario overview (5 cards
on the dashboard, consuming `/api/v1/demo/manifest`'s `scenarios` array) — task #31.
### Batch 3 — Demo Guide + scenario overview (complete)
- New `/scenarios` page (`Scenarios.tsx`): all 5 named scenarios as cards (title,
operational problem, duration, required role(s), "toont aan", ready/blocked status
from the manifest, "Start scenario" linking to the live `start_path`). Dashboard gets
one compact "Probeer een demonstratiescenario" panel (not 5 more cards — keeps the
existing dashboard uncluttered per the brief) showing readiness count and, for
Operations Managers, a guide resume/start control.
- New Demo Guide: `DemoGuideContext` (sessionStorage-persisted `currentIndex`/`completed`
set — browser-only, never touches auth or business logic), 8 static steps
(`data/demoGuideSteps.ts`) each with what-you'll-see/why/start-action/expected-outcome,
resolving live routes from the manifest for the two scenario-backed steps (return,
duplicate-merge) so they can't drift from actual records. `DemoGuide.tsx` renders a
fixed side panel (desktop) that becomes a bottom sheet at ≤700px via CSS only (no
layout duplication); `DemoGuideTrigger` (topbar, Operations-Manager-only — the 8 steps
require OM throughout) shows a live `completed/8` pill. "Demo opnieuw voorbereiden"
calls the real reset endpoint, resets guide progress, and returns to `/login` (mirrors
the existing sidebar reset flow). Login's "Start begeleide demo" logs in as OM and
passes a one-shot `?guide=start` marker the dashboard consumes once then strips.
- Fixed a real regression caught by the responsive-overflow tests: the new topbar guide
trigger pushed `.topbar-meta` past the viewport at ≤420px; fixed by hiding the guide
trigger (icon+pill) at that breakpoint — the Dashboard's own "Start demo-gids" control
remains reachable there. Also fixed a genuine mobile overflow in the new
`.demo-start-panel` (flex items without `min-width:0`/wrap on narrow screens).
- Fixed one fragile new test (asserted on the transient `?guide=start` URL param, which
the app intentionally strips immediately — changed to assert the guide's actual open
state instead) and two Playwright strict-mode ambiguous-match errors; confirmed the
full 41+6=47-test suite passes twice in a row after these fixes (ruling out flakiness).
- Evidence: frontend `tsc -b` clean, `npm run build` clean; full Playwright suite
**47 passed** (41 existing + 6 new `demo-guide.spec.ts`: scenario overview shows 5
ready cards after reset, starting a scenario navigates to its fixed record, guide
step navigation/jump/close, progress persists across page navigation, guide hidden
from Rental Employee, restart-from-guide resets data and returns to login). Backend
untouched this batch (no re-run needed; last backend gate was 127 passed/ruff/mypy
clean in Batch 2).
- Exact next action: layer plain-language Dutch explanation onto the return flow, the 5
data-quality panels, and fix the knowledge assistant's RAGcore-naming bug — task #33.