Skip to content

WIP / RFC -- Scxtop scrolling and pane focus capability#3307

Open
rrnewton wants to merge 4 commits intomainfrom
scxtop-scroll
Open

WIP / RFC -- Scxtop scrolling and pane focus capability#3307
rrnewton wants to merge 4 commits intomainfrom
scxtop-scroll

Conversation

@rrnewton
Copy link
Copy Markdown
Collaborator

On machines with >300 cores, we cannot see nearly all the DSQs! This adds the ability to scroll up and down.

…ew scroll sub-methods

Semantics-preserving refactors to prepare for pane focus and scrolling:

- Extract inline scheduler rendering code from render() dispatch into
  a dedicated render_scheduler() method, matching the pattern used by
  all other views.

- Extract duplicated BPF programs list construction (filtered or sorted
  by avg runtime) into bpf_programs_to_display() helper, replacing 4
  identical blocks in on_down/on_up/on_pg_down/on_pg_up.

- Extract per-view scroll logic from the monolithic on_down/on_up/
  on_pg_down/on_pg_up methods into focused sub-methods
  (on_down_bpf_programs, on_down_bpf_detail, on_down_perf_top,
  on_down_filtered, etc.), converting if/else chains to match dispatches.
Add the infrastructure needed for pane focus and scrolling without
wiring it into the App yet:

- New pane.rs module with PaneScrollState (per-pane scroll offset/
  content/visible tracking) and PaneFocusManager (focus cycling, hit
  testing via screen Rects, per-pane scroll states).

- New Action variants: FocusNext (Tab), MouseClick, MouseScrollUp,
  MouseScrollDown for pane interaction.

- Tab key binding in keymap.rs and parse_action support.

- Enable mouse capture in tui.rs.

- Handle mouse events in main.rs event loop, translating crossterm
  mouse events to Action variants.

- Add focused_border_style() to AppTheme for visual focus feedback.

- Update exhaustive Action match in mcp/events.rs.
Wire PaneFocusManager into the App and add scrolling/focus rendering
for Default, Scheduler, LLC, and Node views:

- Add pane_focus field to App, configured per view in set_state()
  (Default/LLC/Node/PerfTop=2 panes, Scheduler=5 panes).

- Handle FocusNext/MouseClick/MouseScrollUp/MouseScrollDown actions
  in handle_action().

- Add pane focus guards to on_down/on_up/on_pg_down/on_pg_up so
  non-table panes scroll via PaneScrollState instead of table nav.

- Register pane areas and apply focused_border_style() in
  render_default(), render_llc(), render_node(), render_scheduler().

- Add render_table_with_border() to pass border_style_override through
  to ProcessRenderer for focus-aware table borders.

- Add border_style_override parameter to ProcessRenderer's
  render_process_table() and render_thread_table().

- Add border_style_override, scroll_offset, scroll_visible to
  SchedulerViewParams/SchedulerStatsParams; apply scroll offset
  in render_scheduler_sparklines/barchart with Scrollbar widgets.

- Update tests to pass new parameters.
@hodgesds
Copy link
Copy Markdown
Contributor

Makes a lot of sense! There's a lot of linters compared to the rest of the repo, so you may need to run cargo clippy --no-deps --all -- -Dwarnings

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