Is your feature request related to a problem?
layout.alignX/layout.alignY only model three main-axis positions: start (0), center (2), end (1). There's no way to distribute free space between children the way flexbox does. Any layout that wants items spread across a row currently needs hand-positioned spacers.
Describe the solution you'd like
Expand the layout enums to add distribution modes that split free space across inter-child gaps, mirroring the CSS justify-content property: space-between (3), space-around (4), space-evenly (5).
const node = open("row", {
layout: {
width: grow(),
direction: "ltr",
alignX: 3,
},
}); // space-between
For the two-child width-10 case: space-between gives A B (x=0, x=9); space-evenly splits three equal gaps of (10-2)/3 into A B (x=2, x=6); space-around puts half-gaps on the ends. Rounds to whole cells deterministically, applies to both axes (alignX for ltr, alignY for ttb). Should follow the alignment string-literal refactor in #42 (re: #3).
Describe alternatives you've considered
Fake it JS-side by measuring children and emitting fixed-width spacers, but those are baked at encode time so they don't reflow on resize, force the caller to re-measure every frame, and info.get(id).bounds won't reflect a real distribution—it reconstructs layout logic outside the engine.
Additional context
Failing test case on nm/repro/justify-space (test · diff). The wire already carries 3/4/5 unchanged (ops.ts:118, unpacked at src/clayterm.c:514-515); the gap is likely the engine's on-axis alignment switch (clay/clay.h:2971-2975 for x, :2986-2990 for y), which handles only LEFT/CENTER and lets everything else hit default: break, collapsing 3/4/5 to end.
Is your feature request related to a problem?
layout.alignX/layout.alignYonly model three main-axis positions: start (0), center (2), end (1). There's no way to distribute free space between children the way flexbox does. Any layout that wants items spread across a row currently needs hand-positioned spacers.Describe the solution you'd like
Expand the layout enums to add distribution modes that split free space across inter-child gaps, mirroring the CSS
justify-contentproperty:space-between(3),space-around(4),space-evenly(5).For the two-child width-10 case:
space-betweengivesA B(x=0, x=9);space-evenlysplits three equal gaps of (10-2)/3 intoA B(x=2, x=6);space-aroundputs half-gaps on the ends. Rounds to whole cells deterministically, applies to both axes (alignXforltr,alignYforttb). Should follow the alignment string-literal refactor in #42 (re: #3).Describe alternatives you've considered
Fake it JS-side by measuring children and emitting fixed-width spacers, but those are baked at encode time so they don't reflow on resize, force the caller to re-measure every frame, and
info.get(id).boundswon't reflect a real distribution—it reconstructs layout logic outside the engine.Additional context
Failing test case on
nm/repro/justify-space(test · diff). The wire already carries 3/4/5 unchanged (ops.ts:118, unpacked atsrc/clayterm.c:514-515); the gap is likely the engine's on-axis alignment switch (clay/clay.h:2971-2975for x,:2986-2990for y), which handles only LEFT/CENTER and lets everything else hitdefault: break, collapsing 3/4/5 toend.