Files
WRNexusJS/docs/plans/2026-10-19-design-system-phase-3-implementation.md
T

4.6 KiB
Raw Blame History

Phase 3 — Complete component contract rollout

Date: 2026-10-19. Delivered: contracts, additive part hooks and preset recipes for the remaining 90 components, bringing coverage to 104/104.

Implementation

  • COMPONENT_CONTRACTS contains all 104 contracts. CATALOG_COMPONENT_CONTRACTS contains the new 90; the existing CORE_COMPONENT_CONTRACTS remains the original 14. Both engine and optional UI metadata entry expose the complete registry. Existing lookup now accepts every catalog component.
  • Contracts record axes, parts, ownership, property allowlists, slots, source tokens, compatibility and region limitations. Shared property profiles avoid duplicating the allowlists throughout the exported catalog.
  • All three existing design systems include recipes for all 104 components. New recipes apply typography, eligible surface radius and elevation. They do not add layout dimensions, positioning, display, clipping or graph geometry. Existing component colors continue through the theme token adapter.
  • Explicit instance size, radius, shape, rounded, shadow and other applicable axes guard default rules. Semantic geometry such as sliders, progress indicators and status marks keeps its existing shape.
  • Chart canvas/runtime accessible output, Drawflow provider DOM, embedded map documents, native controls and user-authored editor content retain documented ownership boundaries. A contract describes the controllable wrapper; it does not promise styling of provider pixels or native popups.
  • Recipe compilation omits duplicate mode rules while still resolving and validating each mode. Mode-specific literal values continue to emit overrides.

Compatibility and verification

The rollout generator checks canonical parsed component trees before writing and rejects any change beyond the added hooks. An independent comparison against the saved pre-rollout sources passed for all 90 components: props, events, functions, existing attributes, styles, slots and markup structure are preserved. Re-running generation produces byte-identical component files.

Validation completed:

  • 346 tests pass, zero failures, across engine, design CLI, styles, UI, SSR and theme runtime (6,845 assertions).
  • Focused TypeScript source check passes; targeted lint passes.
  • All 90 additional components server-render successfully with their defaults.
  • All three complete presets validate and compile in light and dark modes. Tests verify ownership boundaries and mode-rule deduplication.
  • Real browser: seven catalog pages × three systems × two modes = 42 checked pages, covering 624 default component appearances. Every page had its expected component owners and no page-level horizontal overflow at the tested desktop width. Browser results are in output/design-system-phase-3/browser-checks.json.
  • Inspected screenshots for each system. The existing linked-CSS interactive preview remains usable; its switch changed state in the browser. Existing interaction suites, including provider adapters, continue to pass.
  • Coverage audit: 104 source components, 104 reference entries, 104 catalog entries, 104 with hooks, zero metadata gaps.

The catalog is an SSR baseline gallery: empty lists and closed overlays intentionally retain defaults. This verification does not certify every populated state, every viewport, external provider rendering or accessibility conformance. Existing Phase 2 interaction and mobile coverage remains documented separately.

Review and regeneration

Run bun run scripts/preview-design-systems.ts. Open /catalog?system=soft&mode=light&page=1 on the printed address for the added components; / retains the interactive core fixture. Catalog pages are numbered 0–6 in URLs. Switch system between square, soft, angular, and mode between light, dark.

Run bun run scripts/rollout-design-contracts.ts to audit or append --write to regenerate. Review inferred parts and ownership when changing component markup; generation is a migration aid, not semantic or accessibility certification. Regenerate coverage with node scripts/audit-design-system.mjs.

Screenshots: Square, Soft, Angular.

API baselines were updated only for the engine and UI design-contract entry; visual hashes only for the 90 migrated components. Pre-existing workspace-wide type/API/visual drift outside this scope remains separate. No dependencies, publication or deployment were added. Studio authoring and AI/agent tools remain subsequent phases.