Skip to content

Row/column spacing and wrap; keep formula values of any variable type - #40

Merged
BuildCodelessly merged 4 commits into
masterfrom
claude/bold-shannon-4t04vs
Oct 23, 2026
Merged

BuildCodelessly merged 4 commits into
masterfrom
claude/bold-shannon-4t04vs

Conversation

@BuildCodelessly

Copy link
Copy Markdown
Contributor

Summary

Model changes the editor and SDK need for gaps found while recreating a code-built app (an RV trip planner) in CodelesslyEditor. The editor changes are in the CodelesslyEditor PR on the same branch name, and the runtime changes are in the CodelesslySDK PR.

This PR is intended ONLY to add:

  • RowColumnMixin.spacing: the gap between children along the main axis (Flutter's Row/Column spacing, Figma item spacing).
  • RowColumnMixin.wrap and runSpacing: children wrap onto further runs, like Flutter's Wrap. The doc comments describe how alignment and flex behave while wrapping.
  • Computed variables: sanitizeValueForVariableType keeps a ${= ...} formula as the value for every variable type, so a list or map variable can hold one.

All new fields default to 0/false and are left out of JSON at their defaults. Older JSON loads unchanged, and nodes that don't use them serialize the same as before.

Tests:

  • test/row_column_spacing_test.dart
  • test/row_column_wrap_test.dart
  • test/computed_variable_value_test.dart

The full suite passes (303), and dart analyze lib reports no issues.

Known Issues

  • Accordion, expansion tile and canvas nodes carry the new mixin fields, but only row/column nodes use them so far.

Generated by Claude Code

A computed variable holds a ${= ...} formula whatever its declared type;
sanitizing turned a list or map variable's formula into an empty value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UErtKMSFkZWHUh8DrQMcZW
RowColumnMixin.spacing (default 0) is the gap between consecutive
children along the main axis, like Flutter's Row/Column spacing and
Figma auto-layout item spacing. RowColumnNode takes it in its
constructor and exposes it as a layout field. JSON omits it when 0 and
JSON without it loads as 0 for every RowColumnMixin node.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UErtKMSFkZWHUh8DrQMcZW
RowColumnMixin.wrap (default false) makes a row/column lay its children
out like Flutter's Wrap: a row wraps horizontally, a column vertically,
with spacing between children of a run and RowColumnMixin.runSpacing
(default 0) between runs. The doc comment sets the behavior: the main-axis
alignment aligns each run, the cross-axis alignment aligns children in
their run and the runs in the free space (stretch/baseline act as start),
flex children keep their design size, formula-hidden children take no
space or gap, and a hugging cross axis is as thick as the runs.

RowColumnNode takes both in its constructor and exposes them as layout
fields; JSON omits them at their defaults and old JSON loads them as
defaults for every RowColumnMixin node. A wrapping RowColumnNode scrolls
along its cross axis (through its runs), as its main axis is where it
wraps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UErtKMSFkZWHUh8DrQMcZW
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UErtKMSFkZWHUh8DrQMcZW
@BuildCodelessly
BuildCodelessly merged commit 37fe436 into master Oct 23, 2026
0 of 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