Skip to content

Load a layout's variables and conditions even when they arrive after it - #73

Merged
rayliverified merged 1 commit into
masterfrom
claude/project-thread-isalyz
Oct 20, 2026
Merged

rayliverified merged 1 commit into
masterfrom
claude/project-thread-isalyz

Conversation

@rayliverified

Copy link
Copy Markdown
Contributor

Requested by Ray · project thread

Before: a layout could render without its variables and conditions. In the editor's onboarding survey (layout 0RAA1RWimj5i1rmAD0OR), clicking an option didn't select it and the first step bar wasn't highlighted.

After: the layout always runs with its variables and conditions, so options select on click and the step bars highlight.

DataManager.getOrFetchPopulatedLayout added a downloaded layout to the publish model before awaiting its variables and conditions. CodelesslyWidget builds a layout as soon as the model holds it, and CodelesslyLayoutBuilder.loadLayout reads variables and conditions only then. Its didUpdateWidget reloads only when the layout's id, canvas or lastUpdated changes. So any rebuild in that window left the layout without them for good: conditions never applied, and set variable actions found no variable to set. Rebuilds there are common with preload: true, where other layouts emit the model, or when the status stream changes. A layout cached without its variables and conditions ends up the same way.

How:

  • The data manager adds a downloaded layout only after its variables and conditions are in the model.
  • CodelesslyLayoutBuilder remembers the variables and conditions it loaded, and reloads when the publish model holds different ones for the layout. This also picks up a publish that changes only conditions or variables.
  • test/layout_loading_test.dart covers both cases with the survey's option tile as a fixture. Both tests fail without the fix. flutter analyze is clean and all 71 tests pass.

Rendering the full survey layout headless works on 7.3.0 when the variables and conditions are loaded, so the condition and formula changes in #71 are not the cause.


Generated by Claude Code

A downloaded layout was added to the publish model before its variables and
conditions finished downloading. Any rebuild in that window (another layout
emitting the model, the status stream) built the layout without them, and
CodelesslyLayoutBuilder only reloads when the layout itself changes, so the
layout stayed without them: conditions never applied and set variable
actions found no variable. A layout cached without them had the same result.

The data manager now adds a downloaded layout only after its variables and
conditions, and the layout builder reloads when they change.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B86QWEkjWBfHUrfXKRv6i5
@rayliverified rayliverified self-assigned this Oct 19, 2026
@rayliverified
rayliverified merged commit 3dad103 into master Oct 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants