refactor: move effects panel from global to per-track

- Added showEffects property to Track type
- Added "E" button with Sparkles icon to toggle per-track effects
- Effects panel now appears below each track when toggled
- Removed global EffectsPanel from AudioEditor
- Updated useMultiTrack to persist showEffects state
- Streamlined workflow: both automation and effects are now per-track

This aligns the UX with professional DAWs like Ableton Live, where
effects and automation are track-scoped rather than global.

🤖 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:44:06 +01:00
parent 03a7e2e485
commit d2709b8fc2
5 changed files with 82 additions and 22 deletions

View File

@@ -14,7 +14,6 @@ import { useEffectChain } from '@/lib/hooks/useEffectChain';
import { useToast } from '@/components/ui/Toast';
import { TrackList } from '@/components/tracks/TrackList';
import { ImportTrackDialog } from '@/components/tracks/ImportTrackDialog';
import { EffectsPanel } from '@/components/effects/EffectsPanel';
import { formatDuration } from '@/lib/audio/decoder';
import { useHistory } from '@/lib/hooks/useHistory';
import { useRecording } from '@/lib/hooks/useRecording';
@@ -40,8 +39,6 @@ export function AudioEditor() {
const [punchOutTime, setPunchOutTime] = React.useState(0);
const [overdubEnabled, setOverdubEnabled] = React.useState(false);
const [settingsDialogOpen, setSettingsDialogOpen] = React.useState(false);
const [effectsPanelHeight, setEffectsPanelHeight] = React.useState(300);
const [effectsPanelVisible, setEffectsPanelVisible] = React.useState(false);
const { addToast } = useToast();
@@ -816,24 +813,6 @@ export function AudioEditor() {
trackLevels={trackLevels}
/>
</div>
{/* Effects Panel - Global Folding State, Collapsed when no track */}
<EffectsPanel
track={selectedTrack || null}
visible={selectedTrack ? effectsPanelVisible : false}
height={effectsPanelHeight}
onToggleVisible={() => {
if (selectedTrack) {
setEffectsPanelVisible(!effectsPanelVisible);
}
}}
onResizeHeight={setEffectsPanelHeight}
onAddEffect={handleAddEffect}
onToggleEffect={handleToggleEffect}
onRemoveEffect={handleRemoveEffect}
onUpdateEffect={handleUpdateEffect}
onToggleEffectExpanded={handleToggleEffectExpanded}
/>
</main>
</div>