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:
@@ -37,6 +37,9 @@ async def load_canvas(
|
||||
edges=[EdgeResponse.model_validate(e) for e in edges],
|
||||
viewport=viewport,
|
||||
custom_style=state.custom_style if state else None,
|
||||
# A CanvasState row exists only after a save (or explicit design create),
|
||||
# so its presence marks an intentional canvas vs. a never-touched one.
|
||||
initialized=state is not None,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user