feat: move effects section to collapsible area below track waveform
Major UX improvement inspired by Ableton Live's device view: - Effects section now appears below the waveform in the track lane - Toggle button in control panel shows/hides the effects area - Gives much more horizontal space for device rack - Effects section spans full width of track (control panel + waveform) - Clean separation between track controls and effects - Header with device count, add button, and close button Layout changes: - Track structure changed from horizontal to vertical flex - Top row contains control panel + waveform (fixed height) - Bottom section contains collapsible effects area (when shown) - Effects hidden by default, toggled via "Devices" button - When collapsed, track doesn't show effects section This provides a cleaner workflow where users can focus on mixing when effects are hidden, then expand to full device view when needed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -57,6 +57,7 @@ export function Track({
|
|||||||
const [isEditingName, setIsEditingName] = React.useState(false);
|
const [isEditingName, setIsEditingName] = React.useState(false);
|
||||||
const [nameInput, setNameInput] = React.useState(String(track.name || 'Untitled Track'));
|
const [nameInput, setNameInput] = React.useState(String(track.name || 'Untitled Track'));
|
||||||
const [effectBrowserOpen, setEffectBrowserOpen] = React.useState(false);
|
const [effectBrowserOpen, setEffectBrowserOpen] = React.useState(false);
|
||||||
|
const [showEffects, setShowEffects] = React.useState(false);
|
||||||
const inputRef = React.useRef<HTMLInputElement>(null);
|
const inputRef = React.useRef<HTMLInputElement>(null);
|
||||||
|
|
||||||
const handleNameClick = () => {
|
const handleNameClick = () => {
|
||||||
@@ -252,16 +253,17 @@ export function Track({
|
|||||||
<div
|
<div
|
||||||
ref={containerRef}
|
ref={containerRef}
|
||||||
className={cn(
|
className={cn(
|
||||||
'flex',
|
'flex flex-col',
|
||||||
isSelected && 'ring-2 ring-primary ring-inset'
|
isSelected && 'ring-2 ring-primary ring-inset'
|
||||||
)}
|
)}
|
||||||
style={{ height: trackHeight }}
|
|
||||||
>
|
>
|
||||||
{/* Left: Track Control Panel (Fixed Width) */}
|
{/* Top: Track Row (Control Panel + Waveform) */}
|
||||||
<div
|
<div className="flex" style={{ height: trackHeight }}>
|
||||||
className="w-72 flex-shrink-0 bg-card border-r border-border border-b border-border p-3 flex flex-col gap-2"
|
{/* Left: Track Control Panel (Fixed Width) */}
|
||||||
onClick={(e) => e.stopPropagation()}
|
<div
|
||||||
>
|
className="w-72 flex-shrink-0 bg-card border-r border-border border-b border-border p-3 flex flex-col gap-2"
|
||||||
|
onClick={(e) => e.stopPropagation()}
|
||||||
|
>
|
||||||
{/* Track Name & Collapse Toggle */}
|
{/* Track Name & Collapse Toggle */}
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<Button
|
<Button
|
||||||
@@ -389,43 +391,26 @@ export function Track({
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Devices/Effects Section */}
|
{/* Devices Toggle Button */}
|
||||||
<div className="pt-2">
|
{!track.collapsed && (
|
||||||
<div className="flex items-center justify-between mb-2">
|
<div className="pt-2">
|
||||||
<span className="text-xs font-medium text-muted-foreground uppercase">
|
|
||||||
Devices ({track.effectChain.effects.length})
|
|
||||||
</span>
|
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="outline"
|
||||||
size="icon-sm"
|
size="sm"
|
||||||
onClick={() => setEffectBrowserOpen(true)}
|
onClick={() => setShowEffects(!showEffects)}
|
||||||
title="Add effect"
|
className="w-full"
|
||||||
className="h-5 w-5"
|
|
||||||
>
|
>
|
||||||
<Plus className="h-3 w-3" />
|
<span className="flex-1 text-left">
|
||||||
|
Devices ({track.effectChain.effects.length})
|
||||||
|
</span>
|
||||||
|
{showEffects ? (
|
||||||
|
<ChevronDown className="h-3.5 w-3.5" />
|
||||||
|
) : (
|
||||||
|
<ChevronRight className="h-3.5 w-3.5" />
|
||||||
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
{/* Horizontal scrolling device rack */}
|
|
||||||
<div className="overflow-x-auto custom-scrollbar -mx-3 px-3">
|
|
||||||
<div className="flex gap-2 pb-2">
|
|
||||||
{track.effectChain.effects.length === 0 ? (
|
|
||||||
<div className="text-xs text-muted-foreground text-center py-4 w-full">
|
|
||||||
No devices. Click + to add an effect.
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
track.effectChain.effects.map((effect) => (
|
|
||||||
<EffectDevice
|
|
||||||
key={effect.id}
|
|
||||||
effect={effect}
|
|
||||||
onToggleEnabled={() => onToggleEffect?.(effect.id)}
|
|
||||||
onRemove={() => onRemoveEffect?.(effect.id)}
|
|
||||||
/>
|
|
||||||
))
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -472,6 +457,59 @@ export function Track({
|
|||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Bottom: Effects Section (Collapsible, Full Width) */}
|
||||||
|
{showEffects && !track.collapsed && (
|
||||||
|
<div className="bg-card border-b border-border">
|
||||||
|
{/* Effects Header */}
|
||||||
|
<div className="flex items-center justify-between px-3 py-2 border-b border-border">
|
||||||
|
<span className="text-xs font-medium text-muted-foreground uppercase">
|
||||||
|
Devices ({track.effectChain.effects.length})
|
||||||
|
</span>
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
size="icon-sm"
|
||||||
|
onClick={() => setEffectBrowserOpen(true)}
|
||||||
|
title="Add effect"
|
||||||
|
className="h-6 w-6"
|
||||||
|
>
|
||||||
|
<Plus className="h-3.5 w-3.5" />
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
size="icon-sm"
|
||||||
|
onClick={() => setShowEffects(false)}
|
||||||
|
title="Close devices"
|
||||||
|
className="h-6 w-6"
|
||||||
|
>
|
||||||
|
<ChevronDown className="h-3.5 w-3.5" />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Horizontal scrolling device rack */}
|
||||||
|
<div className="overflow-x-auto custom-scrollbar p-3">
|
||||||
|
<div className="flex gap-2">
|
||||||
|
{track.effectChain.effects.length === 0 ? (
|
||||||
|
<div className="text-xs text-muted-foreground text-center py-8 w-full">
|
||||||
|
No devices. Click + to add an effect.
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
track.effectChain.effects.map((effect) => (
|
||||||
|
<EffectDevice
|
||||||
|
key={effect.id}
|
||||||
|
effect={effect}
|
||||||
|
onToggleEnabled={() => onToggleEffect?.(effect.id)}
|
||||||
|
onRemove={() => onRemoveEffect?.(effect.id)}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
{/* Effect Browser Dialog */}
|
{/* Effect Browser Dialog */}
|
||||||
<EffectBrowser
|
<EffectBrowser
|
||||||
|
|||||||
Reference in New Issue
Block a user