fix(agent-map): hold orchestration chevrons at a fixed pitch - #14256
fix(agent-map): hold orchestration chevrons at a fixed pitch#14256brennanb2025 wants to merge 1 commit into
Conversation
CHEVRON_SPACING only chose how many chevrons to draw; placement then divided the edge evenly, so the pitch grew with the distance between agents and, past the 32-chevron cap, grew without bound. Step at a literal 8px pitch instead, centering the run so it never overhangs either node. Fixed pitch makes length drive the chevron count, so cap coverage now decides how far the run reaches: at 32 it spanned only 248px and every longer link would have shown a chevron cluster stranded mid-edge. Raise it to 256 (~2048px, past any real in-project link) and memoize the generated path per endpoint coordinates, since the scene rebuilds every path string on each zoom frame and on 4Hz snapshot refreshes while world positions stay put.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe lineage path generator now places chevrons at fixed 8-unit intervals centered along each path. The per-path limit increased from 32 to 256 chevrons. Direct lineage paths now use a 512-entry LRU cache keyed by node coordinates and radii. The module exports a cache-size inspection function. Tests cover spacing, cache reuse, and cache bounds during edge churn. Mergeability Score: ⚪ Minimal · up to This change standardizes Agent Map chevron spacing and caches generated paths without changing persisted data or external interfaces; no actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ELI5
The little
> > > >arrows that run between agents on the Agent Map were spread out to fill whatever gap they had to cross. Two agents close together got tight arrows; two far apart got the same number of arrows stretched thin. Now every arrow sits exactly 8px from the next one, no matter how far apart the agents are.What Changed
agent-map-lineage-chevron-path.ts:CHEVRON_SPACING = 8only ever chose how many chevrons to draw — placement then divided the edge evenly (totalLength * (index + 1) / (count + 1)), so the gap tracked the edge length. Chevrons now step at a literal 8px pitch, with the run centered on the trimmed segment so it never overhangs either node.MAX_CHEVRONS_PER_PATH32 → 256. With fixed pitch the cap decides how far the run reaches, not just how dense it is. At 32 it covered only 248px, so every longer link would have drawn a short chevron cluster stranded mid-edge with bare gaps at both ends. 256 covers ~2048px — past any real in-project link (adjacent worktree rings sit ≥152 units apart; a large project tops out around 1400) — and stays as a runaway guard on path-string size.Why
The pitch bug is visible in the app: the long cross-worktree links read as sparse dashes while short intra-ring links read as a dense dotted line, so the same relationship looked like two different kinds of edge depending on where packing happened to place the rings.
The memo is here because fixed pitch makes edge length drive the chevron count, which raises the
dpayload on long links (a 1200px edge goes 1.2 KB → 5.0 KB). That lands on a path with no caching at all:AgentMapSceneandAgentMapWorktreeRingNodeboth call the generator inline inside.map(), and the scene fully re-renders on every zoom frame and on 4Hz snapshot refreshes (refreshAgentMapMetadatarebuilds every node object, solayoutidentity always changes and no ring node bails out). That was ~150 KB of string churn per frame during a zoom gesture before this change.Node positions are in world space, so zooming changes no endpoint coordinate — the cache hits ~100% during zoom gestures and across metadata-only refreshes, and only misses during enter/exit motion, when nodes genuinely move. Panning was already free (
AgentMapSceneismemo'd and onlycenterchanges).Measured on the real module, 60 edges per render pass:
dper edgeLinked Issue
N/A — reported directly from the running app, no tracking issue.
Visual Proof
Same 42-agent / 41-edge fixture in both, published over the real
dashboard:publishSnapshotrelay into the pop-out map. Measured from the rendered DOM (tip-to-tip distance on every[data-agent-map-lineage-link]):The longest edge before drew its capped 32 chevrons at a 25.47 pitch; after, it draws 105 at 8.
Before
After
Close-up of the same region — watch the long links from
orchestratordown tocatalog-identity,folder-note, andunified-gateagainst the short links inside each ring:Testing
pnpm typecheck— cleanoxlint+audit:code-quality:native— cleanvitest run src/renderer/src/components/dashboard-popout— 31 files, 268 tests passNew tests in
agent-map-lineage-chevron-path.test.ts:Platforms: exercised on macOS. Pure renderer geometry + an in-memory Map, no platform, path, SSH, or remote-wire surface touched.
Review
MAX_CHEVRONS_PER_PATH).Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)