fix: restore waveform click-to-seek functionality

Re-enabled mouse event handlers on waveform canvas that were accidentally
removed. Users can now:
- Click to seek to a specific position
- Drag to create selection regions

Also fixed TypeScript error by properly typing EffectType parameter in
handleAddEffect callback.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-18 18:18:17 +01:00
parent 17381221d8
commit f6857bfc7b
2 changed files with 6 additions and 2 deletions

View File

@@ -18,6 +18,7 @@ import { EffectsPanel } from '@/components/effects/EffectsPanel';
import { formatDuration } from '@/lib/audio/decoder';
import { useHistory } from '@/lib/hooks/useHistory';
import { useRecording } from '@/lib/hooks/useRecording';
import type { EffectType } from '@/lib/audio/effects/chain';
import {
createMultiTrackCutCommand,
createMultiTrackCopyCommand,
@@ -209,7 +210,7 @@ export function AudioEditor() {
};
// Effects Panel handlers
const handleAddEffect = React.useCallback((effectType: any) => {
const handleAddEffect = React.useCallback((effectType: EffectType) => {
if (!selectedTrackId) return;
const track = tracks.find((t) => t.id === selectedTrackId);
if (!track) return;

View File

@@ -628,7 +628,10 @@ export function Track({
{/* Waveform Canvas */}
<canvas
ref={canvasRef}
className="absolute inset-0 w-full h-full"
className="absolute inset-0 w-full h-full cursor-pointer"
onMouseDown={handleCanvasMouseDown}
onMouseMove={handleCanvasMouseMove}
onMouseUp={handleCanvasMouseUp}
/>
</>
) : (