song grid: auto-scroll the window to follow the playhead during playback nf-mnv0 ← Beads

open priority 2 task unassigned

Twinned from https://github.com/cfsh/ninefold/issues/394 by tools/beads/import_github.py's reconcile pass.

Follow-up from #321, never filed at the time. Originally proposed as suggestion 1 in [this comment](https://github.com/cfsh/ninefold/issues/321#issuecomment-5107968236): *"with both editors fixed, the playhead sweep and cell pulses never shift mid-song; we can add a subtle row-follow (auto-scroll the song window to keep the sounding rows visible during playback)."*

Why it matters now. #334 capped the SONG window at ~5.5 rows, so any song with 6+ sounds has rows outside the window at all times. During playback the playhead sweeps every row, including the ones you can't see — the sweep is drawn on an overlay inside the clipped window, so off-screen rows pulse invisibly. With enough sounds you're watching a third of your song play.

The mechanism already exists. SongGrid has follow-focus scrolling (UpdateScrollLayout glides _scrollTarget with a peek margin, _Process eases toward it). Playback row-follow is the same glide driven by a different signal — EditorState.PlayheadMoved / the playing rows — rather than by _lastFocusCoords.

Design questions worth settling before building:

  1. What counts as "the sounding row"? Several rows sound at once. Options: follow the row of the *selected* sound; follow the lowest/highest sounding row; or don't follow rows at all and instead keep the window still unless *no* sounding row is visible.
  2. Does it fight the user? If focus is parked on a cell in row 7 while playback is down in row 2, auto-scrolling steals the view from where the user is working. Suggest: only follow while focus is outside the grid (or while nothing in the grid is focused), so it never yanks the view mid-edit. That rule is cheap — _scrollView/cell focus state is already tracked.
  3. Does it apply in Loop mode? Loop plays one pattern, so there's arguably nothing to follow; likely Song mode only.

Probe-gateable: expect_pixel or a shot after starting playback with 8+ sounds; the existing grid-scroll.json fixture (grows the song to 8 sounds) is the natural place to extend.

Unclaimed — filed so it isn't lost now that #321 is closed.

Dependencies

None.

Comments

No comments.

Add a comment