Setting up your dashboard0 entities found · 9/32 branches scanned
ID:WORK-113Status:done
Add repeated element generation to structure entries
Extend StructureEntry with a repeat field that generates N copies of a template element, with optional filled/unfilled distinction. Eliminates the testimonial rune's postTransform for star ratings.
Accept SPEC-033 and break down into work items WORK-110–116
Acceptance Criteria
StructureEntry in packages/transform/src/types.ts has a repeat field with count (modifier name), max (cap, default 10), filled (optional modifier name), element (template), and filledElement (optional template)
The engine's buildStructureElement generates count copies when repeat is present
When filled is specified, the first N elements get data-filled="true" (or use filledElement), the rest get data-filled="false" (or use element)
The max cap prevents runaway generation
Non-numeric or missing count values produce zero elements (no crash)
Unit tests cover: basic repetition, filled/unfilled split, max cap, edge cases (0, negative, non-numeric)
TypeScript compiles cleanly
All existing tests pass
Approach
Add the repeat interface to StructureEntry in types
In the engine's structure element building, detect repeat and generate child elements in a loop
Read count and filled values from the modifier map (already resolved at that point)
Apply the filled/unfilled logic
Write tests
References
SPEC-033 (Feature 3 — Repeated Elements)
WORK-112 (slots should land first so repeat can target slots)