Skip to content

Scroll Graphics Devices and File Systems lists when selection overflows#186

Merged
bvaisvil merged 2 commits into
bvaisvil:masterfrom
vincentqb:fix-160-scrolling-graphics-disk
May 8, 2026
Merged

Scroll Graphics Devices and File Systems lists when selection overflows#186
bvaisvil merged 2 commits into
bvaisvil:masterfrom
vincentqb:fix-160-scrolling-graphics-disk

Conversation

@vincentqb
Copy link
Copy Markdown
Contributor

@vincentqb vincentqb commented May 8, 2026

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 stateful List so 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 clippy
  • zenith -c 30 -n 10 -d 8 -g 10 -p 40, Tab to Disk / Graphics, ↓/↑ past visible rows — list scrolls, stays on selection

@vincentqb vincentqb marked this pull request as ready for review May 8, 2026 19:40
@vincentqb vincentqb marked this pull request as draft May 8, 2026 19:55
@vincentqb vincentqb force-pushed the fix-160-scrolling-graphics-disk branch from 53e5a1d to a4a0f14 Compare May 8, 2026 20:04
vincentqb added 2 commits May 8, 2026 20:07
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.
@bvaisvil bvaisvil self-assigned this May 8, 2026
@vincentqb vincentqb force-pushed the fix-160-scrolling-graphics-disk branch from a4a0f14 to 81654b5 Compare May 8, 2026 20:13
@vincentqb vincentqb marked this pull request as ready for review May 8, 2026 20:14
Copy link
Copy Markdown
Owner

@bvaisvil bvaisvil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thanks for the contribution!

@bvaisvil bvaisvil merged commit e99775a into bvaisvil:master May 8, 2026
5 checks passed
@vincentqb vincentqb deleted the fix-160-scrolling-graphics-disk branch May 8, 2026 20:52
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.

2 participants