fix: automation bar now properly foldable with default parameter

- Default selectedParameterId to 'volume' when undefined
- Fixes issue where clicking automation header did nothing
- Chevron now correctly shows fold/unfold state

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-19 12:40:45 +01:00
parent a2542ac87f
commit 950c0f69a6

View File

@@ -381,8 +381,9 @@ export function TrackList({
<div <div
className="flex items-center gap-2 px-3 py-1.5 cursor-pointer hover:bg-accent/30 transition-colors" className="flex items-center gap-2 px-3 py-1.5 cursor-pointer hover:bg-accent/30 transition-colors"
onClick={() => { onClick={() => {
const selectedParam = track.automation.selectedParameterId || 'volume';
const currentLane = track.automation.lanes.find( const currentLane = track.automation.lanes.find(
l => l.parameterId === track.automation.selectedParameterId l => l.parameterId === selectedParam
); );
if (currentLane) { if (currentLane) {
const updatedLanes = track.automation.lanes.map((l) => const updatedLanes = track.automation.lanes.map((l) =>
@@ -394,7 +395,7 @@ export function TrackList({
} }
}} }}
> >
{track.automation.lanes.find(l => l.parameterId === track.automation.selectedParameterId)?.visible ? ( {track.automation.lanes.find(l => l.parameterId === (track.automation.selectedParameterId || 'volume'))?.visible ? (
<ChevronDown className="h-3 w-3 text-muted-foreground" /> <ChevronDown className="h-3 w-3 text-muted-foreground" />
) : ( ) : (
<ChevronRight className="h-3 w-3 text-muted-foreground" /> <ChevronRight className="h-3 w-3 text-muted-foreground" />
@@ -407,7 +408,7 @@ export function TrackList({
{/* Automation Lane Content - Collapsible */} {/* Automation Lane Content - Collapsible */}
{track.automation.lanes {track.automation.lanes
.filter((lane) => lane.parameterId === track.automation.selectedParameterId && lane.visible) .filter((lane) => lane.parameterId === (track.automation.selectedParameterId || 'volume') && lane.visible)
.map((lane) => ( .map((lane) => (
<div key={lane.id} className="h-32"> <div key={lane.id} className="h-32">
<AutomationLane <AutomationLane