From 1b389b1dcf89078b37fb9a300f146f90db15f8f7 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 13 Oct 2026 15:58:22 +0000 Subject: [PATCH] Build the canvas from the resolved node registry (7.0.1) On web release builds every published layout failed with "Node with id not found": the layout was replaced by a freshly decoded copy with the same lastUpdated, didUpdateWidget did not reload it, and the canvas was built from that copy, whose nodes have no parent links. Read the canvas from the node registry, which loadLayout resolved. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01A67XoQYsLVvoMtiKcXXUxY --- CHANGELOG.md | 8 ++++++++ lib/src/ui/layout_builder.dart | 8 ++++++++ pubspec.yaml | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93ee31f..6b9485d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## 7.0.1 + +- Fix published layouts failing with "Node with id not found" on web + release builds. When the layout was replaced by a freshly decoded copy + with the same `lastUpdated`, the canvas was built from that copy, whose + nodes have no parent links. The canvas is now read from the resolved + node registry. + ## 7.0.0 ### Breaking changes diff --git a/lib/src/ui/layout_builder.dart b/lib/src/ui/layout_builder.dart index fe4da44..ffa6ee6 100644 --- a/lib/src/ui/layout_builder.dart +++ b/lib/src/ui/layout_builder.dart @@ -130,7 +130,15 @@ class _CodelesslyLayoutBuilderState extends State { ), ); + /// The canvas node from [nodeRegistry], whose parent links [loadLayout] + /// resolved. + /// + /// [widget.layout] can be replaced by a freshly decoded copy with the same + /// [SDKPublishLayout.lastUpdated], which [didUpdateWidget] does not reload. + /// Its nodes have no parent links, so building from it would look up a + /// parent with an empty ID. CanvasNode get canvasNode => + nodeRegistry.getNodeByIdOrNull(widget.canvasId) as CanvasNode? ?? widget.layout.canvases[widget.canvasId]![widget.canvasId] as CanvasNode; /// Whether the layout should be loaded. This is used to prevent the layout diff --git a/pubspec.yaml b/pubspec.yaml index 7156fd0..e7c836c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: codelessly_sdk description: Codelessly CloudUIâ„¢ - Server-driven UI for Flutter. Supercharge your Flutter apps with dynamic UI and real-time updates. Build and publish UI without code! -version: 7.0.0 +version: 7.0.1 homepage: https://codelessly.com/ repository: https://github.com/Codelessly/CodelesslySDK issue_tracker: https://github.com/Codelessly/CodelesslySDK/issues