Skip to content

fix(#1935): layout flows replaces a loop's stale box instead of carrying it - #1943

Open
engalar wants to merge 1 commit into
mendixlabs:mainfrom
engalar:fix/1935-layout-flows-own-loop-size
Open

engalar wants to merge 1 commit into
mendixlabs:mainfrom
engalar:fix/1935-layout-flows-own-loop-size

Conversation

@engalar

@engalar engalar commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

mxcli layout flows reported moved N of M objects on a flow whose loop
had been written by the pre-#1935 builder, while bson dump showed the loop's
Size unchanged - and another --dry-run reported the same objects again.
Two carries restored the stale value:

  • stripFlowLayout cleared @position/@anchor/@curve/@merge/@start but not
    @SiZe, so DESCRIBE re-emitted the STORED box and the rebuild reused it.
    It now clears ActivityAnnotations.Size, so the rebuild's fitContainerSize
    decides.

  • canon.CarryUnexpressed kept max(written, stored) per dimension on every
    write (the #2179 contract, from when MDL could not state a size). Even the
    correct smaller box was replaced by the larger stored one before equality,
    so the write elided as unchanged. A write authoritative about geometry
    needs an explicit option: canon.ContentsOwnLayout(), plumbed through a new
    backend path UpdateRawUnitOwningLayout (interface, modelsdk backend,
    writer, mock, regenerated unimplemented/unsupported), which layoutFlow
    uses.

The default carry stays for rebuilds: a loop box drawn larger in Studio Pro
is still not shrunk by create or drop+create.

Test: mdl/executor/issue1935_layout_flows_test.go injects the stale Size,
asserts layout replaces it and a second run changes nothing; canon's
TestUnexpressed_LoopSizeReplacingStaleBoxWhenLayoutOwnsIt, with the #2179
default-carry tests as the control. go build ./..., the layout/describe
executor tests and the cmd/mxcli layout flows tests pass.

Refs #1935 (the layout-flows half; the box computation is #1942).

`mxcli layout flows` reported `moved N of M objects` on a flow whose loop
had been written by the pre-mendixlabs#1935 builder, while bson dump showed the loop's
Size unchanged - and another --dry-run reported the same objects again.
Two carries restored the stale value:

- stripFlowLayout cleared @position/@anchor/@curve/@merge/@start but not
  @SiZe, so DESCRIBE re-emitted the STORED box and the rebuild reused it.
  It now clears ActivityAnnotations.Size, so the rebuild's fitContainerSize
  decides.

- canon.CarryUnexpressed kept max(written, stored) per dimension on every
  write (the #2179 contract, from when MDL could not state a size). Even the
  correct smaller box was replaced by the larger stored one before equality,
  so the write elided as unchanged. A write authoritative about geometry
  needs an explicit option: canon.ContentsOwnLayout(), plumbed through a new
  backend path UpdateRawUnitOwningLayout (interface, modelsdk backend,
  writer, mock, regenerated unimplemented/unsupported), which layoutFlow
  uses.

The default carry stays for rebuilds: a loop box drawn larger in Studio Pro
is still not shrunk by create or drop+create.

Test: mdl/executor/issue1935_layout_flows_test.go injects the stale Size,
asserts layout replaces it and a second run changes nothing; canon's
TestUnexpressed_LoopSizeReplacingStaleBoxWhenLayoutOwnsIt, with the #2179
default-carry tests as the control. go build ./..., the layout/describe
executor tests and the cmd/mxcli layout flows tests pass.

This branch has not been deployed

No deployments
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.

1 participant