Goal
Pure function that computes all spatial positions from phase/agent configuration. No Excalibur dependency — just geometry.
Tasks
- Create
src/client/visualizations/catwalk/layout/catwalk-layout.ts
- Implement
computeCatwalkLayout() function that takes phase/agent configuration and returns:
- Station X positions (asymmetric content-extent spacing with fixed inter-station gap)
- Dynamic canvas/platform width computed from layout (not a fixed value)
- Agent positions (X, Y for each agent within a station)
- Orchestrator position (X, Y for a given station index)
- Chute endpoints (top and bottom for each agent position)
- Gate positions (midpoint between adjacent stations)
- Rail and ground line endpoints
- Canvas bounds
- Port the prototype's content-driven layout algorithm (final prototype at commit
fe19d60 on branch 162, in demos/catwalk/):
- Each station has asymmetric extents: left = agent half-width + input artifact overhang; right = agent half-width + output overhang
- Fixed
STATION_GAP (30px) between adjacent stations' content edges
PLATFORM_W computed dynamically from total layout
- Support compact layout mode: remove absent stations entirely and recompute positions for visible stations only
- Accept variable agent counts per station (e.g., Review may have 1–4 reviewers depending on the run)
- Unit tests for layout computation
Key algorithm
The prototype uses layoutStations(phaseIndices) which:
- Computes per-station left extent (agents half-width +
ART_W * 1.5 + 11 input overhang)
- Computes per-station right extent (agents half-width +
ART_W / 2 output overhang)
- Places stations sequentially with
STATION_GAP between content edges
- Returns positions array and computed
platformW
Compact mode filters to visible station indices only, then runs the same algorithm.
The agent count per station is not fixed — it comes from the run data. The layout must handle any number of agents at any station.
Acceptance criteria
- Layout is deterministic (same input → same output)
- No Excalibur imports
- Canvas width is computed, not fixed
- Tests cover: single-agent stations, multi-agent stations (Review with 4 agents), single reviewer, absent stations, compact mode
Goal
Pure function that computes all spatial positions from phase/agent configuration. No Excalibur dependency — just geometry.
Tasks
src/client/visualizations/catwalk/layout/catwalk-layout.tscomputeCatwalkLayout()function that takes phase/agent configuration and returns:fe19d60on branch162, indemos/catwalk/):STATION_GAP(30px) between adjacent stations' content edgesPLATFORM_Wcomputed dynamically from total layoutKey algorithm
The prototype uses
layoutStations(phaseIndices)which:ART_W * 1.5 + 11input overhang)ART_W / 2output overhang)STATION_GAPbetween content edgesplatformWCompact mode filters to visible station indices only, then runs the same algorithm.
The agent count per station is not fixed — it comes from the run data. The layout must handle any number of agents at any station.
Acceptance criteria