From 29875de89f9d80d8a788f1eb066a034af4521247 Mon Sep 17 00:00:00 2001 From: rakadu1 Date: Tue, 2 Dec 2025 10:24:58 +0530 Subject: [PATCH] feat(ui): Enable timeline scroll on speed graph Adds a 'wheel' event listener to the speed graph container, binding it to the existing `handleTimelineWheel` function. This change enhances user experience by allowing timeline scrubbing via the mouse scroll wheel when the cursor is over the speed graph. It creates consistent behavior across all major visualization components (radar canvas, timeline, and speed graph), improving the application's usability. The logic is centralized within `initSyncUIHandlers` in `sync.js` to keep all synchronization-related event bindings in one place. --- steps/src/sync.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/steps/src/sync.js b/steps/src/sync.js index 6443899..5742c14 100644 --- a/steps/src/sync.js +++ b/steps/src/sync.js @@ -13,6 +13,7 @@ import { egoSpeedDisplay, canSpeedDisplay, autoOffsetIndicator, + speedGraphContainer } from "./dom.js"; import { VIDEO_FPS } from "./constants.js"; import { findRadarFrameIndexForTime, precomputeRadarVideoSync } from "./utils.js"; @@ -410,4 +411,8 @@ export function initSyncUIHandlers() { videoPlayer.addEventListener("wheel", handleVideoPanelWheel, { passive: false, }); + // Use the speed graph container for radar frame seeking + speedGraphContainer.addEventListener("wheel", handleTimelineWheel, { + passive: false, + }); }