ID:WORK-112Status:done
Implement named slots with ordering for structure entries
Add a slots array to RuneConfig and slot/order fields to StructureEntry. The engine assembles children by iterating slots in declared order instead of using binary before/after placement. This is the core structural change in SPEC-033 that enables multi-zone layouts.
Priority:highComplexity:moderateMilestone:v1.0.0Source:SPEC-033
Acceptance Criteria
RuneConfiginpackages/transform/src/types.tshasslots?: string[]StructureEntryhasslot?: stringandorder?: numberfields- When
slotsis declared, the engine assembles children by iterating slots in order, collecting structure entries per slot sorted byorder, and placing content children at the'content'slot - When
slotsis not declared, existing before/after behavior is unchanged (backward compatible) - When
slotsis declared,before: truemaps to the first non-content slot andbefore: falsemaps to the last non-content slot - Explicit
slotassignments take precedence overbeforemapping mergeThemeConfigmergesslotsarrays (theme replaces base) and structure entries with slot assignments- Unit tests cover: slot assembly ordering, order within slots, content slot placement, backward compat without slots, before-to-slot mapping, merge behavior
- TypeScript compiles cleanly across all packages
- All existing tests pass
Approach
- Add interface changes to
packages/transform/src/types.ts - Modify the engine's child assembly logic in
packages/transform/src/engine.tsto support slot-based ordering whenslotsis present - Implement the backward-compat mapping from
beforeto slot positions - Update
mergeThemeConfiginpackages/transform/src/merge.ts - Write comprehensive tests for slot assembly, ordering, and backward compat
References
- Structure Slots and Declarative Flexibility (Feature 1 — Named Slots with Ordering)
- Add value mapping to modifier config (value mapping should land first)
- Replace hardcoded density contexts with configurable childDensity (density contexts should land first)
Relationships
Related
ID:WORK-114Status:done0/11
Implement element projection (hide, group, relocate)
Priority:mediumComplexity:complexMilestone:v1.0.0
ID:WORK-116Status:ready0/7
Update inspect and contracts tooling for structure slots features
Priority:mediumComplexity:moderateMilestone:v1.0.0
ID:WORK-110Status:done0/7
Add value mapping to modifier config
Priority:highComplexity:simpleMilestone:v1.0.0
ID:WORK-111Status:done0/8
Replace hardcoded density contexts with configurable childDensity
Priority:highComplexity:simpleMilestone:v1.0.0
ID:WORK-113Status:done0/8
Add repeated element generation to structure entries
Priority:mediumComplexity:moderateMilestone:v1.0.0