Stepping along the roll across a loaded-window boundary #64

Closed
opened 2026-09-25 00:05:48 +00:00 by dtourolle · 1 comment
Owner

Stepping along the roll may go wrong when the grid's loaded window moves. Since 41486bd the arrows, space, A and D in a library's develop open the roll's neighbouring frame: library-roll-pick(library-roll-current ± 1). roll-current is a row of the loaded window (ctl.paths), set when a photograph is opened — and nothing recomputes it when the window's offset changes.

Why

On the 70-image demo library the whole library is one window, so this was not exercised. On a large library, stepping far enough (or the roll scrolling and reloading the window) could leave roll-current pointing at a row that now holds a different photograph, or past the end of the window, where the pick silently does nothing. Clicking the roll has the same exposure; the keys make it easy to hit.

Deliverable

Either keep roll-current in step with the window (recompute it from the open photograph's ordinal whenever the offset changes), or step by library ordinal and let Rust load the window around the target, as move-cursor does in the grid.

Acceptance

  • On a library larger than one loaded window, holding D from the first frame reaches the last, one photograph per press, in grid order
  • The same backwards with A
  • A test covers stepping across a window boundary
**Stepping along the roll may go wrong when the grid's loaded window moves.** Since 41486bd the arrows, space, A and D in a library's develop open the roll's neighbouring frame: `library-roll-pick(library-roll-current ± 1)`. `roll-current` is a *row of the loaded window* (`ctl.paths`), set when a photograph is opened — and nothing recomputes it when the window's offset changes. ## Why On the 70-image demo library the whole library is one window, so this was not exercised. On a large library, stepping far enough (or the roll scrolling and reloading the window) could leave `roll-current` pointing at a row that now holds a different photograph, or past the end of the window, where the pick silently does nothing. Clicking the roll has the same exposure; the keys make it easy to hit. ## Deliverable Either keep `roll-current` in step with the window (recompute it from the open photograph's ordinal whenever the offset changes), or step by library ordinal and let Rust load the window around the target, as `move-cursor` does in the grid. ## Acceptance - [ ] On a library larger than one loaded window, holding D from the first frame reaches the last, one photograph per press, in grid order - [ ] The same backwards with A - [ ] A test covers stepping across a window boundary
dtourolle added the developuisize:S labels 2026-09-25 00:05:48 +00:00
Author
Owner

Fixed in a030bfd and 19dd325, released in v0.16.0. Stepping now goes by library ordinal, and Rust brings the window to the target (sharing bring_window_to with the grid cursor). The roll's mark follows the open photograph by id across every window reload. Tests cover stepping across window boundaries both ways. Checked in the app on a 400-photo library: D from first to last and A from last to first, one photograph per press, in grid order.

Fixed in a030bfd and 19dd325, released in v0.16.0. Stepping now goes by library ordinal, and Rust brings the window to the target (sharing `bring_window_to` with the grid cursor). The roll's mark follows the open photograph by id across every window reload. Tests cover stepping across window boundaries both ways. Checked in the app on a 400-photo library: D from first to last and A from last to first, one photograph per press, in grid order.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dtourolle/DarkRoom#64