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