Skip to content

Waveform lanes are sized once at load and never fit the panel again #497

Description

@thcp

The problem

The waveform lanes are sized once, when a track loads, and never again. Any
change to the panel's height after that becomes empty space under the lanes
rather than taller lanes.

Resizing the window is enough to show it. On a 1366x768 window the wave panel is
370px and each lane 72px. Drag the window to 1200px tall and the panel becomes
802px while the lanes stay at 72:

Window height Wave panel Lane height Unused
768 370 px 72 px -
1200 802 px 72 px 432 px

So the taller the window, the more of it the waveforms refuse to use. On a large
display most of the panel is empty.

_applyLaneHeight computes the height and is called from wireUpAudio and
renderEmptyShell. Nothing calls it again.

A second, smaller error in the same function

It divides the whole panel height by the lane count, but the stack is lanes
plus the separators between them, so the result overshoots by
(count - 1) * 2px. That has never been visible: the lanes sit at their 70px
floor and overflow the panel anyway, so a few pixels more overflow changes
nothing. It becomes a scrollbar the moment the lanes actually fit.

Constraints

  • The wave panel is flex: 1 inside a fixed-height column, so its height comes
    from its parent and never from the lanes. Anything that recomputes on resize
    can write lane heights without feeding itself.
  • .waves-column takes its height from the multitrack, whose own lane height is
    fixed when the tracks are created. Growing the lanes means the column needs a
    floor of its own, or it stays the size it was at load.
  • On the streaming path the visible lanes are WaveSurfer canvases.
    setOptions({height}) only re-renders the ones that have audio, so a lane for
    a stem the user did not extract keeps its old height. Measured on a six-lane
    job with two empty: 93, 93, 93, 70, 70, 93 while the mixer rows were all 95.
    Any fix has to either solve that or leave that path alone, because a mixer
    column out of step with its waveforms is worse than unused space.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions