fix: smooth scrubber end seeking (#386)

* fix: smooth scrubber end seeking

* fix: stop timeline auto-scroll in fit mode

* feat: use percentage-based timeline zoom

* fix: sync timeline playhead on zoom changes

* fix: reset timeline scroll when returning to fit

* fix: keep timeline controls pinned
This commit is contained in:
Miguel Ángel
2026-04-22 01:51:41 +02:00
committed by GitHub
parent 0ba56f9187
commit 1aea1415c4
11 changed files with 302 additions and 36 deletions
@@ -0,0 +1,20 @@
import { describe, expect, it } from "vitest";
import { resolveSeekPercent } from "./PlayerControls";
describe("resolveSeekPercent", () => {
it("returns 0 when the track width is invalid", () => {
expect(resolveSeekPercent(100, 0, 0)).toBe(0);
});
it("snaps to the start within the edge threshold", () => {
expect(resolveSeekPercent(105, 100, 200)).toBe(0);
});
it("snaps to the end within the edge threshold", () => {
expect(resolveSeekPercent(298, 100, 200)).toBe(1);
});
it("preserves the true percent away from the edges", () => {
expect(resolveSeekPercent(150, 100, 200)).toBe(0.25);
});
});