Skip to content

Microflow canvas: container Size, edge waypoints and merge positions are not writable — hand-quality layout impossible via MDL #884

Description

@Chendodelangen

Microflow canvas: container Size, edge waypoints and merge positions are not writable — hand-quality layout is impossible via MDL

mxcli version: 0.17.0 (file backend, Mendix 11.12.2)

Context

We are generating TOF-convention microflows via MDL and steering layout with
@position(x, y) and @anchor(from: ..., to: ...) — both work well
(and deserve documentation in mxcli syntax; they currently appear only in
DESCRIBE output). With those two annotations we can reproduce a hand-aligned
reference flow's node geometry byte-for-byte. Three remaining canvas
properties are not writable, and they are exactly what separates
"generated" from "hand-aligned" quality.

Problem 1: container Size ignores authored positions (and @SiZe is silently ignored)

LoopedActivity Size is computed by the writer's own auto-layout pass
(driven by statement count/kind), not from the @positions the script
assigns to the container's children. Result: the box is far wider than the
authored content and, since @position on a container is its CENTER, the
box overhangs the main lane on both sides.

Evidence (two flows with identical child @positions, verified via
mxcli bson dump --type microflow):

Flow WHILE Size inner LOOP Size
Hand-aligned in Studio Pro 3110;460 750;260
Same MDL re-written by mxcli 4840;460 1170;260

With the same center (3145;200), the writer's box starts at x=725 instead
of x=1590 and swallows the eight preceding lane nodes.

Additionally, @size(600, 300) before a LOOP parses without error but the
stored Size is unchanged (auto-computed). Silent acceptance of an
ineffective annotation is itself a trap.

Ask: derive container Size from the authored child positions when they
are present (bounding box + padding), or honor an explicit @size(w, h).
Erroring on unsupported annotations would also help.

Workaround we use now: exec, read the real Size back via
mxcli bson dump, re-exec with center = intended_left_edge + Size/2 and
post-container nodes pushed past intended_left_edge + Size. Converges in
one iteration (Size is position-independent), but the box keeps large empty
interior space that only a manual resize in Studio Pro removes.

Problem 2: sequence-flow waypoints (bezier points) are not in the MDL surface

A hand-curved edge (e.g. a false-bypass routed over the top of a loop
container to the rejoin merge) does not round-trip: DESCRIBE output is
identical before and after the manual adjustment, so the curvature is
invisible and unwritable. Only endpoint sides are steerable via @anchor.
Same family as association line anchors (issue #872), but for microflow
sequence flows.

Ask: expose edge waypoints (or at least an "route around containers"
hint) in the MDL surface.

Problem 3: implicit merge nodes and ON ERROR rejoin points are auto-placed

End-if merges land ~1-3 grid steps right of the join and ON ERROR handler
rejoins land ~80px after the call node; neither is addressable via
@position (statements only). They routinely overlap neighbouring
activities (mxcli lint MPR008 flags them) and there is no way to fix it
from a script.

Ask: make merge nodes positionable (e.g. @position on END IF;) or
include them in the bounding-box/spacing computation of Problem 1.

Aside: lint MPR008 compares coordinates across container planes

A node at (141, 130) inside a record loop is reported as overlapping a
node at (134, 230) inside the surrounding WHILE, although they live on
different canvases. This makes MPR008 noisy on any nested-container flow;
comparisons should be scoped per container plane.

Impact

Layout quality is an explicit review criterion in our team conventions
(happy flow on one lane, failure stubs straight below their decision,
containers tight on the lane). Node geometry is now fully scriptable, but
every generated flow still needs a manual pass in Studio Pro for box sizes
and line curvature — which defeats scripted regeneration, since the manual
polish is destroyed on every re-exec.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions