Skip to content

Add Layout's own macro slot arrangement - #14

Merged
einari merged 2 commits into
mainfrom
feature/layout-macro-arrangement
Aug 15, 2026
Merged

Add Layout's own macro slot arrangement#14
einari merged 2 commits into
mainfrom
feature/layout-macro-arrangement

Conversation

@einari

@einari einari commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Added

  • Layout.Arrangement: an optional FlowArrangement/FreeformSlotArrangement describing how a layout's own named slots position relative to each other, filling a gap where Screenplay's template/row/column/grid/variant constructs (which arrange slots) had nowhere to go in the object model - only a single slot's own filled content could be arranged before this
  • FlowSlotLeaf/SlotPlacement: the slot-referencing counterparts to FlowLeaf/ElementPlacement, used only within a Layout's own arrangement tree
  • FreeformSlotArrangementEvaluator (+ TypeScript evaluateFreeformSlotArrangement): selects a Layout's macro placement variant for a size class, mirroring FreeformArrangementEvaluator

Context

Found while implementing Cratis/Stage#37 (the Screenplay → Scene translation seam) - Screenplay's layout construct places named slots via template/variant blocks, but Layout had no field to receive that structure, only Slot.Arrangement for a slot's own content. Fully additive: no existing type's shape changed, and FlowArrangementEvaluator is reused unmodified since it never inspects leaf content.

einari added 2 commits August 15, 2026 10:55
While researching Cratis/Stage#37, found that Layout had no way to
represent Screenplay's `template`/`row`/`column`/`grid`/`variant`
constructs, which position a layout's own named slots relative to each
other. The existing Arrangement types on Slot only ever positioned
that one slot's own filled content elements (FlowLeaf/ElementPlacement
both embed a SceneElement) - there was nowhere to record which slot
sits where within the layout itself, so a Stage translator would have
had to silently drop that structure.

Layout gets a new optional `Arrangement` (same FlowArrangement/
FreeformSlotArrangement types as a Slot's own arrangement), whose leaf
content references a slot by name instead of an element:
FlowSlotLeaf/SlotPlacement mirror FlowLeaf/ElementPlacement exactly,
just swapping "which element" for "which slot". Fully additive - no
existing type's shape changed, and FlowArrangementEvaluator is reused
unmodified for the new macro case since it never inspects leaf
content; only the freeform side needed a new evaluator
(FreeformSlotArrangementEvaluator), which reuses the very same
'freeformCases' shared fixtures as FreeformArrangementEvaluator since
the algorithm is identical and content-agnostic.
Evaluates a Layout's own FreeformSlotArrangement the same way
FreeformArrangementEvaluator evaluates a Slot's - exact size-class
match or nothing, no fallback. Both the C# and TypeScript specs reuse
the existing 'freeformCases' shared fixtures verbatim: the algorithm
only selects a variant by size class and never inspects what a
placement's leaf content actually is, so the same corpus proves both
evaluators.
@einari einari added screen Screen/UI work: Screenplay UI constructs, Scene runtime, Stage rendering, Studio designers minor labels Aug 15, 2026
@einari
einari merged commit 87e0fc4 into main Aug 15, 2026
5 of 6 checks passed
@einari
einari deleted the feature/layout-macro-arrangement branch August 15, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor screen Screen/UI work: Screenplay UI constructs, Scene runtime, Stage rendering, Studio designers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant