refactor: make effects section always visible with inline collapse toggle
- Removed "Devices" button from control panel - Effects section now always present below each track - Collapsible via chevron in the effects header itself - Click header to expand/collapse the device rack - "+" button in header to add effects (with stopPropagation) - Each track has independent collapse state - Hover effect on header for better UX This matches the typical DAW layout where each track has its own device section that can be individually collapsed/expanded. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -390,27 +390,6 @@ export function Track({
|
|||||||
: `R${Math.round(track.pan * 100)}`}
|
: `R${Math.round(track.pan * 100)}`}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Devices Toggle Button */}
|
|
||||||
{!track.collapsed && (
|
|
||||||
<div className="pt-2">
|
|
||||||
<Button
|
|
||||||
variant="outline"
|
|
||||||
size="sm"
|
|
||||||
onClick={() => setShowEffects(!showEffects)}
|
|
||||||
className="w-full"
|
|
||||||
>
|
|
||||||
<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>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -460,54 +439,58 @@ export function Track({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Bottom: Effects Section (Collapsible, Full Width) */}
|
{/* Bottom: Effects Section (Collapsible, Full Width) */}
|
||||||
{showEffects && !track.collapsed && (
|
{!track.collapsed && (
|
||||||
<div className="bg-card border-b border-border">
|
<div className="bg-card border-b border-border">
|
||||||
{/* Effects Header */}
|
{/* Effects Header */}
|
||||||
<div className="flex items-center justify-between px-3 py-2 border-b border-border">
|
<div
|
||||||
<span className="text-xs font-medium text-muted-foreground uppercase">
|
className="flex items-center justify-between px-3 py-2 border-b border-border cursor-pointer hover:bg-accent/50 transition-colors"
|
||||||
Devices ({track.effectChain.effects.length})
|
onClick={() => setShowEffects(!showEffects)}
|
||||||
</span>
|
>
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<Button
|
{showEffects ? (
|
||||||
variant="ghost"
|
<ChevronDown className="h-3.5 w-3.5 text-muted-foreground" />
|
||||||
size="icon-sm"
|
) : (
|
||||||
onClick={() => setEffectBrowserOpen(true)}
|
<ChevronRight className="h-3.5 w-3.5 text-muted-foreground" />
|
||||||
title="Add effect"
|
)}
|
||||||
className="h-6 w-6"
|
<span className="text-xs font-medium text-foreground">
|
||||||
>
|
Devices ({track.effectChain.effects.length})
|
||||||
<Plus className="h-3.5 w-3.5" />
|
</span>
|
||||||
</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>
|
||||||
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
size="icon-sm"
|
||||||
|
onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
setEffectBrowserOpen(true);
|
||||||
|
}}
|
||||||
|
title="Add effect"
|
||||||
|
className="h-6 w-6"
|
||||||
|
>
|
||||||
|
<Plus className="h-3.5 w-3.5" />
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Horizontal scrolling device rack */}
|
{/* Horizontal scrolling device rack */}
|
||||||
<div className="overflow-x-auto custom-scrollbar p-3">
|
{showEffects && (
|
||||||
<div className="flex gap-2">
|
<div className="overflow-x-auto custom-scrollbar p-3">
|
||||||
{track.effectChain.effects.length === 0 ? (
|
<div className="flex gap-2">
|
||||||
<div className="text-xs text-muted-foreground text-center py-8 w-full">
|
{track.effectChain.effects.length === 0 ? (
|
||||||
No devices. Click + to add an effect.
|
<div className="text-xs text-muted-foreground text-center py-8 w-full">
|
||||||
</div>
|
No devices. Click + to add an effect.
|
||||||
) : (
|
</div>
|
||||||
track.effectChain.effects.map((effect) => (
|
) : (
|
||||||
<EffectDevice
|
track.effectChain.effects.map((effect) => (
|
||||||
key={effect.id}
|
<EffectDevice
|
||||||
effect={effect}
|
key={effect.id}
|
||||||
onToggleEnabled={() => onToggleEffect?.(effect.id)}
|
effect={effect}
|
||||||
onRemove={() => onRemoveEffect?.(effect.id)}
|
onToggleEnabled={() => onToggleEffect?.(effect.id)}
|
||||||
/>
|
onRemove={() => onRemoveEffect?.(effect.id)}
|
||||||
))
|
/>
|
||||||
)}
|
))
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user