Skip to content

fix: scroll settings list to keep selection in view#294

Merged
LargeModGames merged 1 commit into
mainfrom
fix/settings-list-scroll
Jun 10, 2026
Merged

fix: scroll settings list to keep selection in view#294
LargeModGames merged 1 commit into
mainfrom
fix/settings-list-scroll

Conversation

@LargeModGames

@LargeModGames LargeModGames commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Summary

The Settings screen list could not be scrolled past what initially fit on screen. Pressing Down moved the highlight through the visible rows, but the viewport never scrolled to reveal items below the fold, so the lower settings were unreachable on shorter terminals.

  • The settings list was the only scrollable list in the app rendered statelessly (f.render_widget). A stateless ratatui List has no scroll offset, so it always draws from item 0 and never follows the selection. The visible highlight is faked by per-item span styling, so it moved on screen, but once the selection passed the viewport bottom the selected row went off-screen with no scroll.
  • Fixed by rendering with a ListState seeded from settings_selected_index (f.render_stateful_widget), mirroring discover.rs, util.rs, and every other list screen, so ratatui recomputes the offset each frame to keep the selection visible.

Not actually platform-specific despite being reported on Windows: it only looked fine on Linux because that terminal was tall enough to show all 25 items at once.

Testing

  • cargo fmt --all
  • cargo clippy --no-default-features --features telemetry -- -D warnings — clean
  • cargo test --no-default-features --features telemetry — 233 passed; 0 failed
  • Manual: opened Settings, shrank the terminal so items overflow, and confirmed the list now scrolls all the way down to "Announcements Feed URL" and back, keeping the highlighted row in view.

Additional notes

  • Stateful rendering activates the already-configured highlight symbol, so the selected row now shows the arrow and all rows gain a 2-column left gutter for it. This matches the other list screens; no other layout or logic changes.

The settings list was rendered statelessly, so the viewport never
scrolled and items below the fold were unreachable on shorter terminals.
Render it with a ListState seeded from the selected index, matching every
other list screen, so ratatui scrolls to keep the selection visible.
@LargeModGames LargeModGames merged commit a412ec6 into main Jun 10, 2026
9 checks passed
@LargeModGames LargeModGames deleted the fix/settings-list-scroll branch June 10, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant