Pure useShape API for mutations, event lifecycle e2e tests

Refactor FestipodDataContext to use only the useShape ORM API:
- Remove ng.sparql_update, sessionPromise, ensureGraphNuri imports
- Use privateNuri (useShape scope) directly as @graph for adds
- Create/join are now synchronous (no async wrapper needed)
- Leave uses ngSet.delete() — known limitation: doesn't persist (@wip)

Add event lifecycle e2e scenarios (cycle-de-vie-evenement.feature):
- Create event via form and verify on home screen
- Created event persists after reconnexion
- Consult event detail from home
- Join an event
- Modify event location and verify
- Leave + persistence tagged @wip (ngSet.delete doesn't persist)

Fix DemoMode external navigation: sync initialScreenId prop changes
to internal state via useEffect (was ignored after first mount).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Sylvain Duchesne
2026-04-09 13:03:02 +02:00
parent 6b95695d34
commit 7099c817db
5 changed files with 562 additions and 60 deletions
+9
View File
@@ -28,6 +28,15 @@ export function DemoMode({ initialScreenId, onBack, onNavigateToStory }: DemoMod
const [sidebarOpen, setSidebarOpen] = useState(false);
const isMobile = useIsMobile();
// Sync with external hash navigation (e.g. e2e tests changing window.location.hash)
useEffect(() => {
if (initialScreenId !== currentScreenId) {
setCurrentScreenId(initialScreenId);
setHistory(prev => [...prev, initialScreenId]);
setHistoryIndex(prev => prev + 1);
}
}, [initialScreenId]);
const currentScreen = getScreen(currentScreenId);
const ScreenComponent = currentScreen?.component;
const linkedStories = getStoriesForScreen(currentScreenId);