Setting up your dashboard0 entities found · 7/31 branches scanned
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.
Accept SPEC-033 and break down into work items WORK-110–116
Acceptance Criteria
RuneConfig in packages/transform/src/types.ts has slots?: string[]
StructureEntry has slot?: string and order?: number fields
When slots is declared, the engine assembles children by iterating slots in order, collecting structure entries per slot sorted by order, and placing content children at the 'content' slot
When slots is not declared, existing before/after behavior is unchanged (backward compatible)
When slots is declared, before: true maps to the first non-content slot and before: false maps to the last non-content slot
Explicit slot assignments take precedence over before mapping
mergeThemeConfig merges slots arrays (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.ts to support slot-based ordering when slots is present
Implement the backward-compat mapping from before to slot positions
Update mergeThemeConfig in packages/transform/src/merge.ts
Write comprehensive tests for slot assembly, ordering, and backward compat