From b4df8e10f1ce9224ffbaa7e6e9e38eec7725801d Mon Sep 17 00:00:00 2001 From: Jonathan Hvid Date: Tue, 12 May 2026 14:32:29 +0200 Subject: [PATCH] fix(route): span ~80% of viewport + scroll padding back to 60 + track 420 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three coupled fixes to the route's geometry: - computeRouteLayout's width calculation flipped to Math.max(viewport * 0.80, itemCount * minSpacing + padding * 2). On a wide screen with few items the 80% target wins and the path stretches across the page; once item count makes the data-driven width exceed 80% (the carousel case), the data-driven value wins and the track extends past the viewport unchanged. - .rr-scroll horizontal padding 140 → 60 each side. The previous 140 was overcompensating; with the new 80% target the milestones already sit inside their own breathing room. 60 is card-half + 30px buffer, enough for a 220px card centred under a dot 60px from the edge. scroll-padding kept in sync at 60 for snap-stop landings. - trackHeight default 580 → 420; midY 290 → 210. The 580 was bandaging the vertical-clipping issue — that fix lands in the next commit. With the clip properly addressed, 420 fits the path's amplitude 120 swing cleanly with no wasted vertical space. Tests rewritten to match the new width semantics: 1 item @ 1000 → 920px (0.8 * 1000 + 120); 3 items @ 1400 → 1240px; 20 items @ 800 → 6200px (data-driven wins). midY assertion 290 → 210. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/components/RoadmapRoute.astro | 16 ++++++++-------- src/lib/roadmap-layout.ts | 14 ++++++++------ tests/roadmap-layout.test.ts | 21 +++++++++++---------- 3 files changed, 27 insertions(+), 24 deletions(-) diff --git a/src/components/RoadmapRoute.astro b/src/components/RoadmapRoute.astro index 1270ba2..ae32db5 100644 --- a/src/components/RoadmapRoute.astro +++ b/src/components/RoadmapRoute.astro @@ -72,8 +72,8 @@ const initialShippingX = lastShippingIndex >= 0 ? layout.itemX[lastShippingIndex
-
-
+