Computed flow layout, and mobile written into the design

The canvas lays itself out: a layered graph, left to right on a desktop and
top to bottom on a phone, with room reserved for the value each edge carries.
Nodes cannot be dragged and `NodeDef.position` is gone from the document —
a graph nobody can arrange is one worth keeping small, which is what keeps
flows atomic. Endpoints join the same layout, so their lanes and the
localStorage that remembered where they were dragged go too.

Mobile, per the new Responsive section of DESIGN-GUIDELINES.md: the dock caps
its width and wraps instead of running off the screen, the dashboard stacks
into one column rather than shrinking a wall panel to a fifth of its size, and
Home stops widening its grid track past the viewport. A Playwright project at
a phone's width fails the build when a screen no longer fits.

Along the way: publish is the checkmark that was already there rather than a
button that appears and disappears, with discard beside it on both the flow
and the dashboard; the brain reveals a neuron's name on the first tap; and the
port sparklines get room to breathe.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VDSXaRhvqHYNevgDGmNAto
This commit is contained in:
2026-08-17 17:35:14 +02:00
co-authored by Claude Opus 5
parent e7a1466d7b
commit 39ee0e0aa5
37 changed files with 998 additions and 527 deletions
+6 -9
View File
@@ -24,20 +24,17 @@ def _validate_name(value: str) -> str:
return value
class Position(BaseModel):
"""Where a node sits on the canvas."""
x: float = 0
y: float = 0
class NodeDef(BaseModel):
"""A node as stored: identity, placement, configuration and ports."""
"""A node as stored: identity, configuration and ports.
Deliberately no canvas position. The editor lays a flow out itself, so
where a node sits is a fact about the drawing rather than about the flow —
and a graph nobody can arrange is one worth keeping small.
"""
id: str
type: str = "python"
title: str = ""
position: Position = Position()
params: dict[str, Any] = Field(default_factory=dict)
requires: list[MessageSpec] = Field(default_factory=list)
provides: list[MessageSpec] = Field(default_factory=list)
-2
View File
@@ -23,13 +23,11 @@ def a_flow(name: str = "demo") -> dict:
{
"id": "sensor",
"type": "python",
"position": {"x": 0, "y": 0},
"provides": [{"name": "reading", "dtype": "float"}],
},
{
"id": "logger",
"type": "python",
"position": {"x": 240, "y": 0},
"requires": [{"name": "reading", "dtype": "float"}],
},
],