Scroll Graphics Devices and File Systems lists when selection overflows#186
Merged
bvaisvil merged 2 commits intoMay 8, 2026
Merged
Conversation
53e5a1d to
a4a0f14
Compare
The left-hand 'Graphics Devices' list was rendered as a stateless ratatui List with a '→' indicator baked into each ListItem's text. Arrow-key navigation advanced gfx_device_index past the last visible row, but the list always rendered starting from item 0, so the selection (and its arrow) silently scrolled off-screen even though the right-hand histograms kept updating to the hidden selection. Draw the list via render_stateful_widget with highlight_symbol, mirroring the Section Manager popup in renderer/section.rs. The caller syncs a ListState from the existing gfx_device_index before each render; ratatui then tracks the scroll offset and keeps the selected GPU visible. Fixes bvaisvil#160.
Apply the same stateful-list treatment to the Disk pane's 'File Systems' list that the previous commit applied to the Graphics Devices list. The list had the same latent bug: a plain stateless List with a '→' indicator baked into each row, so navigating past the last visible file system walked the selection off-screen while only the right-hand histograms kept updating. Draw the list via render_stateful_widget with highlight_symbol; the caller syncs a ListState from the existing file_system_index before each render so ratatui tracks the scroll offset and keeps the selected file system visible.
a4a0f14 to
81654b5
Compare
bvaisvil
approved these changes
May 8, 2026
Owner
bvaisvil
left a comment
There was a problem hiding this comment.
This looks great, thanks for the contribution!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In case you'd also like the scrolling, here's an implementation addressing #160 — plus the same fix for the Disk pane, which had the same issue. Let me know if you want it or have any feedback. Thanks!
Summary
Arrow-key navigation in the Graphics Devices list moved the selection past the last visible row without scrolling — the
→walked off-screen while the right-hand histograms kept updating to the hidden GPU. Switched the list to ratatui's statefulListso the scroll offset tracks the selection. Applied the same change to the File Systems list.Test plan
cargo build/cargo build --features nvidia,cargo test,cargo clippyzenith -c 30 -n 10 -d 8 -g 10 -p 40, Tab to Disk / Graphics, ↓/↑ past visible rows — list scrolls,→stays on selection