Skip to content

layout: interleaved = cannon row over a projector row (zipper); hide Grace tabs - #153

Merged
pyramation merged 2 commits into
mainfrom
devin/1794561198-interleaved-zipper
Nov 13, 2026
Merged

pyramation merged 2 commits into
mainfrom
devin/1794561198-interleaved-zipper

Conversation

@pyramation

Copy link
Copy Markdown
Contributor

Summary

interleaved-12x2 was built as two rows that each alternated cannon/projector. The real rig is one row of 12 cannons and one row of 12 projectors, the projector row shifted half a step so they zipper together.

  • interleavedLayout({ cols, rows, stagger = 0.5, first = 'cannon' }): even rows are all first, odd rows the other kind and shifted stagger cells right. Indices are row-major: cannons 0–11, projectors 12–23, with projector i sitting between cannon i and i+1. It now throws on an unknown first.
  • examples/routing-interleaved-12x2.json regenerated with labels C1–C12 / P1–P12.
  • Artist UI: SHOWN_TABS is now paint, pool, gradient. Grace and GracePaint are hidden; their code stays.

Link to Devin session: https://app.devin.ai/sessions/e6939c79261649988b8277ba34725160
Open in Devin Desktop: https://app.devin.ai/desktop/session/e6939c79261649988b8277ba34725160?variant=devin
Requested by: @pyramation

…cell (zipper)

Row 0 holds every cannon, row 1 every projector, shifted stagger (default
0.5) cells right so each projector sits between two cannons and one finger
can zigzag across the show. Example routing labels C1-C12 / P1-P12.
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@luxor-code-review

luxor-code-review Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Review complete. 🟡 1 medium

📍 Findings outside the diff (1) — 🟡 1 medium — defects on lines GitHub can't attach comments to

🟡 Medium — Persisted interleaved specs silently reinterpret stagger and flip kinds · generators.ts:130–152 · unchanged line

// packages/layout/src/generators.ts
130	export function interleavedLayout({ cols, rows, stagger = 0.5, first = 'cannon', id, name }: InterleavedParams): Layout {
131	  if (cols < 1 || rows < 1) throw new Error('interleavedLayout requires cols >= 1 and rows >= 1');
132	  if (!Number.isFinite(stagger) || stagger < 0 || stagger >= 1) {
133	    throw new Error(`interleavedLayout stagger must be 0 <= stagger < 1, got ${String(stagger)}`);
134	  }
135	  if (first !== 'cannon' && first !== 'projector') {
136	    throw new Error(`interleavedLayout first must be "cannon" or "projector", got ${String(first)}`);
137	  }
138	  const other: FixtureKind = first === 'cannon' ? 'projector' : 'cannon';
139	  const cx = (cols - 1 + (rows > 1 ? stagger : 0)) / 2;
140	  const cy = (rows - 1) / 2;
141	  const raw: RawFixture[] = [];

interleavedLayout changed semantics in place: kinds now alternate per row instead of per column, and stagger now means a horizontal shift with default 0.5 instead of a vertical drop with default 0.15 (packages/layout/src/generators.ts:130-152). Project configs persist a LayoutSpec that is resolved via resolveLayout with no version marker or migration, so a project saved under the old semantics loads with every logical index's kind flipped wherever row parity disagrees with column parity, and with a horizontal zipper shift instead of the saved vertical offset. Since routing specs key cannon entries (with fb4Serial/kind) by logical index (packages/layout/src/routing.ts), projector routes and BEYOND bindings silently target the wrong physical fixtures after upgrade.


The change replaces the column-parity interleaved layout with a row-parity zipper scheme: cannons on even rows, projectors on odd rows, each odd row shifted right by stagger (now defaulting to 0.5 cells and meaning a horizontal shift instead of the previous vertical drop). The example project, generator tests, and spec-resolution tests are rewritten to match, and packages/ui/src/app.tsx narrows the shown tool tabs to paint, pool, and gradient.

Files Change
packages/layout/src/generators.ts, packages/layout/src/types.ts Rewrites interleavedLayout to row-major alternating kinds with a horizontal stagger shift, adds first validation, and updates JSDoc/defaults
packages/layout/src/layout-spec.ts, packages/layout/src/presets.ts Updates grammar documentation and preset definitions for the new stagger/first semantics
packages/layout/__tests__/generators.test.ts, packages/layout/__tests__/layout-spec.test.ts Rewrites tests to assert the row-major kind assignment, symmetric extent, and new stagger default
examples/routing-interleaved-12x2.json Rebuilds the 12x2 example routing file (C1–C12 cannons, P1–P12 projectors) to match the generator's row-major indexing
packages/ui/src/app.tsx Adds a SHOWN_TABS filter that hides the Grace and GracePaint tool tabs

Not reviewed: none — all eight changed files were covered. One verified finding on silent backward-compatibility of persisted interleaved specs is reported below.

Reviewed commit: 749a419

@pyramation
pyramation merged commit 93f3d85 into main Nov 13, 2026
5 checks passed
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.

1 participant