fix: enforce minimum 360px height for all tracks using Math.max

- Track component now uses Math.max to ensure track.height is at least MIN_TRACK_HEIGHT
- TrackList component also uses Math.max for consistent enforcement
- Fixes issue where tracks with old height values (340px, 357px) were smaller
- All tracks now guaranteed to be exactly 360px regardless of stored height

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-19 13:09:44 +01:00
parent 6658bbbbd4
commit 0babc469cc
2 changed files with 3 additions and 3 deletions

View File

@@ -641,7 +641,7 @@ export function Track({
} }
}; };
const trackHeight = track.collapsed ? COLLAPSED_TRACK_HEIGHT : track.height; const trackHeight = track.collapsed ? COLLAPSED_TRACK_HEIGHT : Math.max(track.height || MIN_TRACK_HEIGHT, MIN_TRACK_HEIGHT);
// Track height resize handlers // Track height resize handlers
const handleResizeStart = React.useCallback( const handleResizeStart = React.useCallback(

View File

@@ -7,7 +7,7 @@ import { Track } from './Track';
import { TrackExtensions } from './TrackExtensions'; import { TrackExtensions } from './TrackExtensions';
import { ImportTrackDialog } from './ImportTrackDialog'; import { ImportTrackDialog } from './ImportTrackDialog';
import type { Track as TrackType } from '@/types/track'; import type { Track as TrackType } from '@/types/track';
import { DEFAULT_TRACK_HEIGHT, COLLAPSED_TRACK_HEIGHT } from '@/types/track'; import { DEFAULT_TRACK_HEIGHT, COLLAPSED_TRACK_HEIGHT, MIN_TRACK_HEIGHT } from '@/types/track';
import { createEffect, type EffectType, EFFECT_NAMES } from '@/lib/audio/effects/chain'; import { createEffect, type EffectType, EFFECT_NAMES } from '@/lib/audio/effects/chain';
import { AutomationLane } from '@/components/automation/AutomationLane'; import { AutomationLane } from '@/components/automation/AutomationLane';
import type { AutomationPoint as AutomationPointType } from '@/types/automation'; import type { AutomationPoint as AutomationPointType } from '@/types/automation';
@@ -211,7 +211,7 @@ export function TrackList({
<div <div
className="flex flex-col" className="flex flex-col"
style={{ style={{
height: track.collapsed ? `${COLLAPSED_TRACK_HEIGHT}px` : `${track.height || DEFAULT_TRACK_HEIGHT}px` height: track.collapsed ? `${COLLAPSED_TRACK_HEIGHT}px` : `${Math.max(track.height || DEFAULT_TRACK_HEIGHT, MIN_TRACK_HEIGHT)}px`
}} }}
> >
{/* Waveform - Takes remaining space */} {/* Waveform - Takes remaining space */}