feat(canvas): distinguish new user from cleared canvas; stop demo on backend error
Cleared canvas re-showed the demo, and backend errors silently fell back to demo — hiding real outages and forcing users to wipe demo nodes before bulk edits. Now: - backend load reports `initialized` (CanvasState row exists = ever saved) - decideCanvasLoad() picks real | empty | demo; empty is kept empty - backend down/error shows an error banner + toast, never the demo - data-new-user flag reserved as the Getting Started walkthrough hook ha-relevant: yes
This commit is contained in:
@@ -84,3 +84,8 @@ class CanvasStateResponse(BaseModel):
|
||||
edges: list[EdgeResponse]
|
||||
viewport: dict[str, Any]
|
||||
custom_style: dict[str, Any] | None = None
|
||||
# True once this design's canvas has ever been persisted (a CanvasState row
|
||||
# exists). Lets the frontend tell a brand-new user (show demo) apart from one
|
||||
# who intentionally cleared their canvas (keep it empty). False also for a
|
||||
# missing/uninitialized design.
|
||||
initialized: bool = False
|
||||
|
||||
Reference in New Issue
Block a user