ID:WORK-076Status:donePriority:highComplexity:simple
Extract Shared Layout Meta Tag Utility
Summary
Runes that extend SplitLayoutModel all emit identical boilerplate for layout meta tags (layout, ratio, valign, gap, collapse). Extract this into a shared utility in @refrakt-md/runes so each rune's transform calls one function instead of copy-pasting the conditional logic.
Acceptance Criteria
- New
buildLayoutMetas()utility exported frompackages/runes/src/common.ts(or a newlayout-helpers.ts) - Utility accepts the split layout attrs object and returns
{ metas: Tag[], properties: Record<string, Tag> } - Handles the
layout !== 'stacked'guard, gap/collapse conditionals, and all five meta tags (layout, ratio, valign, gap, collapse) recipe.tsin@refrakt-md/learningrefactored to use the shared utilityrealm.tsandfaction.tsin@refrakt-md/storytellingrefactored to use the shared utilityplaylist.tsin@refrakt-md/mediarefactored to use the shared utility- All existing tests pass — no change to identity transform output
Approach
- Study the layout meta tag block in
recipe.ts(reference implementation) and compare withrealm.ts,faction.ts,playlist.ts - Extract the shared pattern into a utility function
- Replace the inline blocks in all four runes with calls to the utility
- Run tests to verify output is unchanged
References
- SPEC-028 (Standard 6 — Layout Meta Tag Emission Should Be Shared)