Skip to content

feat(layout): collapse LayoutNode to container | segment (2de.11)#70

Merged
brandon-fryslie merged 2 commits into
mainfrom
layout-substrate-2de.11-collapse
Jun 4, 2026
Merged

feat(layout): collapse LayoutNode to container | segment (2de.11)#70
brandon-fryslie merged 2 commits into
mainfrom
layout-substrate-2de.11-collapse

Conversation

@brandon-fryslie

Copy link
Copy Markdown
Contributor

What

Collapses LayoutNode to exactly container | segment (epic 2de, child .11). segment is the unit of rendering — one ref into the named segments map → one strip item (the 2de.10 structural join). The inline and stepper node kinds are deleted: their job (interaction, state-driven display, multi-region clickability) belongs in a segment's template (widgets today; the actions: model lands in .12), not in extra node kinds.

cells and layout rows survive as authoring sugar, lowered at the loader to container(horizontal, [segment…]) — so nothing downstream sees more than two kinds ([LAW:one-source-of-truth]).

Why

[LAW:one-type-per-behavior] / [LAW:no-mode-explosion]: the four old kinds encoded interaction-variability in the node union. Once "one unit = one strip item" became structural (2de.10), that variability is just template content. Collapsing it is a net −1445 lines — the validators, derivation paths, and dead tests the extra kinds required all fall away.

Deleted (surface gone, not relocated yet)

  • InlineNode / StepperNode / InlineCell / ClickWrite + the nodeStateUse projection
  • node-registry inline/stepper arms, the composite HUE PIN, setStateUrl/step glyphs
  • validateInlineNode / validateInlineCell / validateClickWrite / validateStepperNode
  • deriveNodeValidators / nodeContributions / nodeDeriveSpecsderiveValidators is now widget-only (the actions surface merges in at .12)
  • the node-set-write session.id trigger + the node backing-var cross-ref loop

Hue rotation is retained but purely decorative (each segment advances the cursor by one, a container by none) — it carries no structural meaning now.

Tests

Verification

  • dsl-spine snapshot byte-identical (default bar visual-equivalent)
  • typecheck + lint clean; full suite green (1057/1057)
  • Live daemon on the real path (freshly-built dist, real config) renders unchanged: multi-row powerline, hue rotation, surviving theme-picker/hue-stepper widgets, working OSC-8 dispatch links, zero errors

Epic

brandon-layout-substrate-2de.11 — next: .12 (static actions: table + sub-template action fn + derived validators).

[LAW:one-type-per-behavior] LayoutNode is now exactly `container | segment`.
The `inline` and `stepper` node kinds are deleted: interaction, state-driven
display, and multi-region clickability all live in a segment's TEMPLATE (via
widgets today; the `actions:` model in .12), so they were variability the node
type should never have carried. A `segment` is THE unit of rendering — one ref
into the named segments map, rendered to one strip item (the 2de.10 structural
join). `cells` and `layout` rows survive as authoring SUGAR, lowered at the
loader to `container(horizontal, [segment…])` so nothing downstream sees more
than two kinds [LAW:one-source-of-truth].

Deleted (their surface is gone, not relocated yet):
- InlineNode/StepperNode/InlineCell/ClickWrite types + nodeStateUse projection
- node-registry inline/stepper arms, the composite "HUE PIN", setStateUrl/glyphs
- validateInlineNode/InlineCell/ClickWrite/StepperNode loader validators
- deriveNodeValidators/nodeContributions/nodeDeriveSpecs; deriveValidators is
  now widget-only (the actions surface merges in at .12)
- the node-set-write session.id trigger + node backing-var cross-ref loop

Hue rotation is retained but purely DECORATIVE — each segment advances the
cursor by one, a container by none; it carries no structural meaning now that
cohesion is one-segment-one-item.

Tests: dsl-inline-cell + dsl-stepper-node deleted (they pinned the removed
surfaces); segment-render-unit #1/#2 re-expressed through the segment surface
(a link-bearing template; an empty template) [LAW:behavior-not-structure]; node
builders in the suite construct the canonical container|segment tree.

dsl-spine snapshot byte-identical; full suite green (1057); live daemon renders
the real config (widgets, hue, OSC-8) unchanged.
Copilot AI review requested due to automatic review settings June 4, 2026 01:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR collapses the DSL layout substrate so downstream code only ever sees two node kinds (container | segment), removing the former inline and stepper node kinds and treating cells/layout rows as loader-only authoring sugar. It updates rendering, payload gating, debug/introspection, and tests to align with “segment = unit of rendering (one strip item)” and keeps hue rotation as a decorative per-segment cursor.

Changes:

  • Collapse LayoutNode to container | segment, deleting inline/stepper node kinds and lowering cells/layout sugar at load time.
  • Simplify the render pipeline and node registry to render segment leaves only, advancing hue per segment and removing inline/stepper click/state handling.
  • Remove node-derived state validators (now widget-only) and update daemon payload gating/debug ordering plus the test suite and default config.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/config/dsl-types.ts Redefines the layout union to `container
src/config/dsl-loader.ts Lowers layout rows and cells sugar into container(horizontal,[segment…]); removes inline/stepper validation and related cross-ref logic.
src/dsl/node-registry.ts Deletes cells/inline/stepper node implementations; introduces segment node type as the sole leaf renderer.
src/dsl/render.ts Updates render driver/context for the two-kind tree; hue cursor advances per segment; removes inline session-id plumbing.
src/daemon/render-payload.ts Updates provider gating reachability walk to seed from segment nodes instead of cells/inline surfaces.
src/daemon/verbs/state-validators.ts Removes node-derived validator contributions; validators are derived from widgets only (pre-actions:).
src/daemon/debug.ts Updates layout-order segment enumeration to follow segment nodes.
src/config/default-dsl-config.ts Updates bundled default root to the canonical container(vertical)->container(horizontal)->segment… form.
test/segment-render-unit.test.ts Re-expresses render-unit assertions using segment templates (OSC-8 links / empty template) instead of inline leaves.
test/render-payload-gating.test.ts Updates test layout helpers/fixtures to build `container
test/dsl-spine.test.ts Updates spine assertions to collect segment names via segment nodes.
test/dsl-merge.test.ts Updates merge tests’ layout builders to emit canonical `container
test/dsl-loader.test.ts Updates loader tests to reflect cells lowering and segment-based cross-ref checks.
test/default-dsl-config.test.ts Updates default-config assertions to validate segment nodes rather than cells nodes.
test/daemon-render-cache.test.ts Updates layout flattening helpers to read segment names from segment nodes.
test/daemon-debug.test.ts Updates expected introspected layout shape to the new canonical tree.
test/dsl-inline-cell.test.ts Deletes tests that pinned the removed inline-cell surface.
test/dsl-stepper-node.test.ts Deletes tests that pinned the removed stepper-node surface.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/config/dsl-loader.ts Outdated
Comment thread src/daemon/verbs/state-validators.ts
[LAW:comments-explain-why-only] Remove a stale WHAT-comment above
layoutRowsToNode — it still described the lowering as "a vertical container of
cells leaves" and sat directly above the correct description, two divergent
copies back-to-back.

[LAW:one-source-of-truth] deriveValidators delegates to deriveWidgetValidators
rather than duplicating its body. The widget surface IS the whole writable-key
surface today, so one body means no drift; when the actions table lands (.12)
this single site becomes the widget+action merge.

Addresses PR #70 review (both nits). lint + typecheck clean; validator/loader
suites green.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated no new comments.

@brandon-fryslie brandon-fryslie merged commit 60935fb into main Jun 4, 2026
7 checks passed
@elton-prawn elton-prawn deleted the layout-substrate-2de.11-collapse branch June 4, 2026 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants