WIP / RFC -- Scxtop scrolling and pane focus capability#3307
Open
WIP / RFC -- Scxtop scrolling and pane focus capability#3307
Conversation
…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.
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 |
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.
On machines with >300 cores, we cannot see nearly all the DSQs! This adds the ability to scroll up and down.