project-bifrost-platform/tests
Jonathan Hvid 66b460c35f feat(lib): roadmap-layout — coordinate generation for the route component
Pure math, no DOM. computeRouteLayout(opts) takes itemCount + viewport
width and returns trackWidth, pathD, itemX, itemY, cardSide, midY:

- itemX evenly distributes items between padding and viewport-padding,
  expanding the canvas beyond the viewport when itemCount * minSpacingX
  exceeds the available width. Single-item case centres the dot.
- itemY puts the first item on the centreline; subsequent items
  alternate +amplitude / -amplitude so the path snakes gently up and
  down. The route reads as a river rather than a saw-tooth because the
  cubic-bezier control points use the segment midpoint x — that holds
  the tangent flat at each milestone.
- cardSide alternates 'below' / 'above' starting from 'below' on item 0.
  Cards hang from their dot via a thin vertical connector in the
  consuming component.

Also adds travelledStopFor(statuses) — the stop position on the path
stroke gradient where 'travelled' fades into 'ahead'. Clamps to 0.98
even when every item is shipping so the fade is always visible.

9 unit tests cover itemCount 1/2/3/7/20 plus the travelledStop edge
cases (no shipping → 0; all shipping → ≤ 0.98; mixed → exact midpoint).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 11:40:26 +02:00
..
dispatches.test.ts feat(component): DispatchesSection + reusable Avatar + tests 2026-05-11 15:57:52 +02:00
focus-tags.test.ts feat(db): dispatches + member-number allocation + focus-tags parser 2026-05-11 15:55:35 +02:00
home-route.test.ts test: vitest suite — pulse status, vote uniqueness, home route 2026-05-11 14:45:55 +02:00
member-number.test.ts feat(db): dispatches + member-number allocation + focus-tags parser 2026-05-11 15:55:35 +02:00
pulse-status.test.ts test: vitest suite — pulse status, vote uniqueness, home route 2026-05-11 14:45:55 +02:00
roadmap-layout.test.ts feat(lib): roadmap-layout — coordinate generation for the route component 2026-05-12 11:40:26 +02:00
setup.ts test: vitest suite — pulse status, vote uniqueness, home route 2026-05-11 14:45:55 +02:00
tenure-milestone.test.ts feat(pulse): two-column greeting + tenure-milestone copy 2026-05-12 10:48:50 +02:00
vote-count.test.ts feat(pulse): nav restructure, white surfaces, membership card, dispatches 2026-05-11 16:02:46 +02:00
votes.test.ts test: vitest suite — pulse status, vote uniqueness, home route 2026-05-11 14:45:55 +02:00