From 10fa1ec88a0b7f0926c0d3c9fa83474b6d75d0bf Mon Sep 17 00:00:00 2001 From: midzelis Date: Fri, 10 Oct 2025 18:04:41 +0000 Subject: [PATCH] fix(web): improve scrubber behavior on scroll-limited timelines 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 @@