WORK-111
ID:WORK-111Status:done

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.

Priority:highComplexity:simpleMilestone:v1.0.0
claude/align-sidenav-styling-4MuxV View source

Criteria completion

No incremental history — criteria tracking started on Apr 17.

Branches 3
History 2
  1. da12420
    Content editedby Claude
    Update 8 work items to done status
  2. 41d5c52
    Created (done)by Claude
    Accept SPEC-033 and break down into work items WORK-110–116

Acceptance Criteria

  • RuneConfig in packages/transform/src/types.ts has childDensity?: 'compact' | 'minimal' field
  • The engine in packages/transform/src/engine.ts reads childDensity from the parent rune's config instead of checking hardcoded sets
  • data-density attribute is applied to child runes identically to current behavior
  • Core config in packages/runes/src/config.ts declares childDensity for Grid, Bento, Gallery, Showcase, Split (compact) and Backlog, DecisionLog (minimal)
  • Hardcoded COMPACT_CONTEXTS and MINIMAL_CONTEXTS sets are removed from the engine
  • Community packages can declare childDensity in their RunePackage.theme.runes config
  • All existing tests pass — HTML output is identical before and after
  • TypeScript compiles cleanly

Approach

  1. Add childDensity to RuneConfig in types
  2. Add childDensity entries to the 7 core runes in packages/runes/src/config.ts
  3. Modify the engine's density resolution to look up the parent's RuneConfig.childDensity from the theme config map
  4. Remove the hardcoded sets
  5. Verify with refrakt inspect that output is unchanged for affected runes

References

  • SPEC-033 (Feature 4 — Configurable Density Contexts)