Improve timeline trim auto-scroll

This commit is contained in:
haixin.yang committed 2026-07-22 13:42:19 +08:00
1 parent 0d2b17765f
commit e5a6d0d5df
13 files changed
+508 -41

No files matched your search

+15
View File
@@ -21,6 +21,21 @@ describe("timeline ruler density", () => {
expect(ticks.filter((tick) => tick.isMajor).some((tick) => tick.label === "00:00.50")).toBe(true);
});
it("keeps labeled ticks in view while trimming expands a long mobile project", () => {
const visibleDuration = 10;
const ticks = getTimelineRulerTicks(
100,
getTimelineZoomForVisibleDuration(visibleDuration),
41,
51,
{ minimumMajorStep: (visibleDuration * 88) / 520 },
);
const visibleLabels = ticks.filter((tick) => tick.isMajor && tick.time >= 41 && tick.time <= 51);
expect(visibleLabels.length).toBeGreaterThanOrEqual(4);
expect(visibleLabels.every((tick) => tick.label)).toBe(true);
});
});
describe("mobile timeline pinch zoom", () => {