graphic design tool
git clone https://git.lucas.co/cce-designer.git
feat: get_state reports the network grid geometry
The live pitch and node size, the zoom percent, and the configured pitch
and node size — the one way to check from outside that a config edit
reached the lattice. Added while chasing a grid that "would not change":
a stale spacing_x in the per-app config override, which cce-ui merges over
the main config, was winning; documented beside the grid section.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
CLAUDE.md | 10 ++++++++++
src/window.rs | 11 +++++++++++
2 files changed, 21 insertions(+)
diff --git a/CLAUDE.md b/CLAUDE.md
index 362d3bb..43d417f 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -724,6 +724,16 @@ same day). Until 2026-09-22 the grid was rounded CELLS with grout between
them, configured as a cell size (also the node size) plus a gap, and a node
filled its cell.
+**Which file sets the pitch is easy to get wrong.** cce-ui merges the
+per-app override `~/.config/cce/cce-designer/config.kdl` OVER the main
+`~/.config/cce/config.kdl`, key by key, so a `spacing_x` in the per-app
+file wins over any edit to the main one — a whole afternoon of "the grid
+size is not changing" (2026-09-22) was a stale `spacing_x=71` in the
+override, left from the cell model. `get_state` over MCP reports `grid`
+(the live pitch and node size, the zoom percent, and the CONFIGURED pitch
+and node size), which is the one way to check from outside that a config
+edit reached the lattice.
+
`State::grid_pitch_x` / `grid_pitch_y` and `node_w` / `node_h` are the
zoomed geometry — `configured_grid_geometry` at 100%, scaled TOGETHER by
`scale_grid_geometry`, which is the only relation between them; there is no
diff --git a/src/window.rs b/src/window.rs
index ad5ecff..956ec39 100644
--- a/src/window.rs
+++ b/src/window.rs
@@ -641,6 +641,17 @@ impl State {
"start_frame": pb.start_frame.round() as i64,
"end_frame": pb.end_frame.round() as i64,
});
+ // The network grid as it is right now, beside what config says
+ // it is at 100%: the one way to check, from outside, that a
+ // config edit reached the lattice on screen.
+ let cfg = crate::app::configured_grid_geometry();
+ v["grid"] = serde_json::json!({
+ "pitch": [self.grid_pitch_x, self.grid_pitch_y],
+ "node_size": [self.node_w, self.node_h],
+ "zoom_percent": self.zoom_percent(),
+ "configured_pitch": [cfg.pitch_x, cfg.pitch_y],
+ "configured_node_size": [cfg.node_w, cfg.node_h],
+ });
return Ok(v);
}
let mut req = if call.arguments.is_object() {