feat: improve layout of SequencerCanvas and SequencerPage for better responsiveness and overflow handling

This commit is contained in:
JSC
2025-09-03 15:06:38 +02:00
parent 25eacbc85f
commit a0d5840166
2 changed files with 20 additions and 23 deletions

View File

@@ -127,12 +127,11 @@ function TrackRow({ track, duration, zoom, isPlaying, currentTime, draggedItem,
ref={setDropRef}
id={`track-${track.id}`}
className={`
w-full h-full border-b border-border/50
h-full border-b border-border/50
relative overflow-hidden
${isOver ? 'bg-accent/30' : 'bg-muted/10'}
transition-colors
`}
style={{ minWidth: `${totalWidth}px` }}
>
{/* Grid lines for time markers */}
<div className="absolute inset-0 pointer-events-none">
@@ -274,26 +273,24 @@ export const SequencerCanvas = forwardRef<HTMLDivElement, SequencerCanvasProps>(
</div>
{/* Tracks */}
<div className="flex-1 overflow-hidden">
<div
ref={ref}
className="w-full h-full overflow-auto"
onScroll={handleTracksScroll}
>
<div style={{ minWidth: `${totalWidth}px` }}>
{tracks.map((track) => (
<TrackRow
key={track.id}
track={track}
duration={duration}
zoom={zoom}
isPlaying={isPlaying}
currentTime={currentTime}
draggedItem={draggedItem}
dragOverInfo={dragOverInfo}
/>
))}
</div>
<div
ref={ref}
className="flex-1 min-h-0 min-w-0 overflow-auto"
onScroll={handleTracksScroll}
>
<div style={{ width: `${totalWidth}px`, minWidth: `${totalWidth}px` }}>
{tracks.map((track) => (
<TrackRow
key={track.id}
track={track}
duration={duration}
zoom={zoom}
isPlaying={isPlaying}
currentTime={currentTime}
draggedItem={draggedItem}
dragOverInfo={dragOverInfo}
/>
))}
</div>
</div>
</div>