Expand description
Shared scroll helpers for components with selectable / overflowing
lists (S2 stamps, S6 peers, S9 tags). Components track a usize
offset alongside their selected index; this module bundles the
“keep selected visible” math + the right-edge scrollbar render.
Each helper is pure where possible so unit tests can exercise the offset arithmetic without spinning up a Frame.
Functions§
- clamp_
scroll - Recompute
scroll_offsetsoselectedis inside thevisible_rowswindow. Pure — no Frame access. - render_
scrollbar - Render the right-edge scrollbar over
areaif the list overflows. Silently no-ops when every row already fits — that’s the common case (most operators have <8 batches / <30 peers / <5 tags).