From 7406bf5a4c0f4a9759f3ddfce45e5b6c6b632d90 Mon Sep 17 00:00:00 2001 From: shrimbly Date: Wed, 18 Feb 2026 20:58:15 +1300 Subject: [PATCH] fix: add click-to-seek on GenerateAudioNode waveform The waveform container was missing an onClick handler, preventing scrubbing. Added handleSeek using audioRef.current.duration directly. Co-Authored-By: Claude Opus 4.6 --- src/components/nodes/GenerateAudioNode.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/components/nodes/GenerateAudioNode.tsx b/src/components/nodes/GenerateAudioNode.tsx index aa32d93a..22c478ca 100644 --- a/src/components/nodes/GenerateAudioNode.tsx +++ b/src/components/nodes/GenerateAudioNode.tsx @@ -193,6 +193,18 @@ export function GenerateAudioNode({ id, data, selected }: NodeProps) => { + if (!audioRef.current || !audioRef.current.duration || !isFinite(audioRef.current.duration) || !waveformContainerRef.current) return; + + const rect = waveformContainerRef.current.getBoundingClientRect(); + const x = e.clientX - rect.left; + const progress = x / rect.width; + const newTime = progress * audioRef.current.duration; + + audioRef.current.currentTime = newTime; + setCurrentTime(newTime); + }, []); + const handlePlayPause = useCallback(() => { if (!audioRef.current) return; @@ -418,6 +430,7 @@ export function GenerateAudioNode({ id, data, selected }: NodeProps