From f1e03d00221c17e889a150bca2abff4154eeff2e Mon Sep 17 00:00:00 2001 From: Min Idzelis Date: Wed, 15 Oct 2025 13:13:05 -0400 Subject: [PATCH] fix(web): improve scrubber behavior on scroll-limited timelines (#22917) Improves scroll indicator positioning when scrubbing through timelines with limited scrollable content (e.g., small albums). When a timeline's scrollable height is less than 50% of the viewport height, the scroll position is now properly distributed across the entire scrubber height, making the indicator more responsive and accurate. Changes: - Add `limitedScroll` state to detect scroll-constrained timelines (threshold: 50%) - Introduce `ViewportTopMonth` type to handle lead-in/lead-out sections - Calculate `totalViewerHeight` including top/bottom sections for accurate positioning - Refactor scrubber to treat lead-in and lead-out as distinct scroll segments - Update scroll position calculations to use relative percentages on constrained timelines --- .../lib/components/timeline/Scrubber.svelte | 114 +++++++++--------- .../lib/components/timeline/Timeline.svelte | 102 ++++++---------- .../timeline-manager.svelte.spec.ts | 2 +- .../timeline-manager.svelte.ts | 21 +++- .../lib/managers/timeline-manager/types.ts | 4 +- web/src/lib/utils/timeline-util.ts | 4 +- 6 files changed, 120 insertions(+), 127 deletions(-) diff --git a/web/src/lib/components/timeline/Scrubber.svelte b/web/src/lib/components/timeline/Scrubber.svelte index 76a12ea1ec..2c22af98ad 100644 --- a/web/src/lib/components/timeline/Scrubber.svelte +++ b/web/src/lib/components/timeline/Scrubber.svelte @@ -1,9 +1,9 @@