fix: persist top/left/right connection-point counts (issue #243)

The backend only stored bottom_handles, so top/left/right_handles were dropped
on canvas save and reset to defaults on reload — a left/right snappoint would
vanish after reload.

- models.py: add top_handles (default 1), left_handles (0), right_handles (0)
- database.py: ALTER TABLE migrations for the three columns
- schemas: add fields to NodeBase, NodeUpdate, and the canvas-save node schema
- tests: save+reload round-trip and default-fallback coverage

ha-relevant: no
This commit is contained in:
Pouzor
2026-07-04 00:04:24 +02:00
parent 63e664efdd
commit 6302c43e06
5 changed files with 44 additions and 0 deletions
+3
View File
@@ -34,6 +34,9 @@ class NodeSave(BaseModel):
width: float | None = None
height: float | None = None
bottom_handles: int = 1
top_handles: int = 1
left_handles: int = 0
right_handles: int = 0
pos_x: float = 0
pos_y: float = 0
+6
View File
@@ -32,6 +32,9 @@ class NodeBase(BaseModel):
width: float | None = None
height: float | None = None
bottom_handles: int = 1
top_handles: int = 1
left_handles: int = 0
right_handles: int = 0
class NodeCreate(NodeBase):
@@ -66,6 +69,9 @@ class NodeUpdate(BaseModel):
width: float | None = None
height: float | None = None
bottom_handles: int | None = None
top_handles: int | None = None
left_handles: int | None = None
right_handles: int | None = None
class NodeResponse(NodeBase):