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:
@@ -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
|
||||
const handleResizeStart = React.useCallback(
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Track } from './Track';
|
||||
import { TrackExtensions } from './TrackExtensions';
|
||||
import { ImportTrackDialog } from './ImportTrackDialog';
|
||||
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 { AutomationLane } from '@/components/automation/AutomationLane';
|
||||
import type { AutomationPoint as AutomationPointType } from '@/types/automation';
|
||||
@@ -211,7 +211,7 @@ export function TrackList({
|
||||
<div
|
||||
className="flex flex-col"
|
||||
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 */}
|
||||
|
||||
Reference in New Issue
Block a user