Repository navigation
Conversation
… to the loop A loop written by 'create microflow' got its Size from its body's ABSOLUTE canvas coordinates: moving the loop 600px right grew the box by exactly 600 (body at 600,300 -> 710;380; at 1200,300 -> 1310;380), and the centred box swallowed its neighbours - MPR008/MPR011 then blamed the neighbourhood. Rebuilt flows kept the sticky wrong size (mendixlabs#1935). Root cause: @position is a canvas coordinate everywhere in the language, but a loop's ObjectCollection stores children relative to the loop's top-left frame. The builder filed the authored value raw, fitContainerSize measured those canvas values, and Studio Pro drew the child shifted inside the frame. One contract, both directions - canvas in the language, frame in storage: - builder: addStatement records the consumed canvas @position per built object (save/restored across nested dispatches so an IF's branches do not wipe the split's); @merge-positioned merges join the canvas family in container bodies; the container's finalize translates them into its frame once the box size is final, and re-derives enum-split tail sides whose creation-time comparison mixed spaces. - sizing: fitContainerSizeWithAuthored bounds the box around the loop's own anchor (authored centre sized symmetrically, flow-placed loops grow from their pinned edge), so the box depends on where the body sits RELATIVE to the loop, never on where the loop sits on the canvas. - describer: emission adds the frame back on @position/@merge inside loop bodies (ExecContext.describeFrameOrigin), keeping describe->exec byte-identical for Studio Pro and mxcli-authored flows alike. - splice: storedLocator.within, pinBody and storedLoopStatement translate the other way, so create or modify keeps addressing loop bodies. Old scripts' stored loop geometry changes on re-exec - that is the fix: the sticky wrong box heals on rebuild. Auto-placed bodies (mendixlabs#884) and explicit @SiZe overrides (#2369) keep their contracts. Test: mdl/executor/issue1935_loop_box_test.go (box independent of loop position for loop and while; child stored relative to the frame; the auto-placed and @SiZe contracts kept). Verified end to end on 11.12.4: bson dump of the issue's own repro stores 220;360 for both loops and 110;280 for both children, describe->exec reports Unchanged, mx check and lint stay quiet.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A loop written by 'create microflow' got its Size from its body's ABSOLUTE
canvas coordinates: moving the loop 600px right grew the box by exactly 600
(body at 600,300 -> 710;380; at 1200,300 -> 1310;380), and the centred box
swallowed its neighbours - MPR008/MPR011 then blamed the neighbourhood.
Rebuilt flows kept the sticky wrong size (#1935).
Root cause: @position is a canvas coordinate everywhere in the language, but
a loop's ObjectCollection stores children relative to the loop's top-left
frame. The builder filed the authored value raw, fitContainerSize measured
those canvas values, and Studio Pro drew the child shifted inside the frame.
One contract, both directions - canvas in the language, frame in storage:
object (save/restored across nested dispatches so an IF's branches do not
wipe the split's); @merge-positioned merges join the canvas family in
container bodies; the container's finalize translates them into its frame
once the box size is final, and re-derives enum-split tail sides whose
creation-time comparison mixed spaces.
anchor (authored centre sized symmetrically, flow-placed loops grow from
their pinned edge), so the box depends on where the body sits RELATIVE to
the loop, never on where the loop sits on the canvas.
bodies (ExecContext.describeFrameOrigin), keeping describe->exec
byte-identical for Studio Pro and mxcli-authored flows alike.
the other way, so create or modify keeps addressing loop bodies.
Old scripts' stored loop geometry changes on re-exec - that is the fix:
the sticky wrong box heals on rebuild. Auto-placed bodies (#884) and
explicit @SiZe overrides (#2369) keep their contracts.
Test: mdl/executor/issue1935_loop_box_test.go (box independent of loop
position for loop and while; child stored relative to the frame; the
auto-placed and @SiZe contracts kept). Verified end to end on 11.12.4:
bson dump of the issue's own repro stores 220;360 for both loops and
110;280 for both children, describe->exec reports Unchanged, mx check
and lint stay quiet.
Fixes #1935