ID:WORK-111Status:readyPriority:highComplexity:simpleMilestone:v1.0.0
Replace hardcoded density contexts with configurable childDensity
Remove the hardcoded COMPACT_CONTEXTS and MINIMAL_CONTEXTS sets from the identity transform engine and replace them with a childDensity field on RuneConfig. This lets community packages declare density behavior without modifying the engine.
Acceptance Criteria
RuneConfiginpackages/transform/src/types.tshaschildDensity?: 'compact' | 'minimal'field- The engine in
packages/transform/src/engine.tsreadschildDensityfrom the parent rune's config instead of checking hardcoded sets data-densityattribute is applied to child runes identically to current behavior- Core config in
packages/runes/src/config.tsdeclareschildDensityfor Grid, Bento, Gallery, Showcase, Split (compact) and Backlog, DecisionLog (minimal) - Hardcoded
COMPACT_CONTEXTSandMINIMAL_CONTEXTSsets are removed from the engine - Community packages can declare
childDensityin theirRunePackage.theme.runesconfig - All existing tests pass — HTML output is identical before and after
- TypeScript compiles cleanly
Approach
- Add
childDensitytoRuneConfigin types - Add
childDensityentries to the 7 core runes inpackages/runes/src/config.ts - Modify the engine's density resolution to look up the parent's
RuneConfig.childDensityfrom the theme config map - Remove the hardcoded sets
- Verify with
refrakt inspectthat output is unchanged for affected runes
References
- SPEC-033 (Feature 4 — Configurable Density Contexts)