Implement a click handler for Meters and make the thr/kthr counters in TasksMeter toggle thread visibility - #2085
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe change adds Merge Risk: 🔵 Low · up to The PR adds header click handling and lets the thread counters toggle visibility, but when updates are paused the visible process rows may remain stale after a toggle. This is a bounded UI correctness risk that is mergeable with explicit owner awareness or follow-up. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Columns align in measured rows, Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: b866daa5-8423-4d2a-9022-bcff22d81fd3
📒 Files selected for processing (5)
Header.cHeader.hMeter.hScreenManager.cTasksMeter.c
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.
BenBE
left a comment
There was a problem hiding this comment.
OVerall handling LGTM; minor function split to help keep some location calculations in sync.
Unrelated note: The , text should probably be printed in teal always, not just when the element after them (thr/kthr) are active. ATM they are grey when inactive.
5becead to
aa4d475
Compare
|
@fasterit I built the branch and yes, it's working! Nice! Clicking threads on and off like this made me realize that I never kept the selection stable across these toggles (that's most noticeable in tree view). If I'm looking at a process and then enable threads, the list jumps around and I have to hunt for the process again. That was already the case when toggling via keyboard; this just made me notice it. Implementation-wise, I understand it's a bit trickier to keep the selection stable when disabling rather than enabling: if the selection is in a process, it's easy to keep it in the same PID and have threads show up beneath it. If the current selection is a thread and one toggles threads off, then of course the selected PID disappears, so I guess the logical thing for the selection would be for it to go up to the parent process. But yeah, that would no longer be just flicking a boolean. But then of course that's a general behavior pattern: htop doesn't preserve the selected PID when going in and out of tree view, etc. But I don't know if it's worth it: preserving the selection across toggles (without having to enable "follow") doesn't make a lot of sense unless one is in "tree view sorted by PID" (which tends to be the most stable view in terms of screen movement). But that's just an aside, just thinking out loud about the UI behavior! The clickable Meter is already a nice improvement! Thank you!! |
|
@hishamhm: you have stable tree mode (check Setup -> Display options -> Tree view is kept visually stable) and we have much improved the Follow function (F) and there is "Sticky follow" in the Display options too which allows you to get out of Follow mode with the UP/DOWNcursor keys. Or not. That may help a bit already. I don't think people toggle the thread views that often. But if you (or somebody else, please chime in) think differently ... we can make the view "stable" on the last PID selected. |
f03813f to
83b0fdf
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
TasksMeter.c (1)
90-99: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winRefresh process rows when updates are paused.
When
pauseUpdateis enabled, the requested recalculation does not callMachine_scanTables. These toggles update the setting and redraw the meter, but process rows retain the previous thread visibility until updates resume. Use the shared thread-toggle action path or refresh the process table before returning the reaction.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 1dbbd584-2127-4ef7-b15b-29486909ea6f
📒 Files selected for processing (4)
Header.cHeaderLayout.hScreenManager.cTasksMeter.c
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.
Co-authored-by: Benny Baumann <BenBE@geshi.org> Assisted-by: Microsoft Copilot/Claude Sonnet 4.6
…icked Idea from Hisham in htop-dev#2083 (comment) Assisted-by: Microsoft Copilot/Claude Sonnet 4.6
fe87829 to
f575168
Compare
…hreads / container visibility Applies on top of the header-meter-clicks branch (PR htop-dev#2085) Assisted-by: OpenCode Zen
Idea from Hisham in #2083 (comment)
Assisted-by: Microsoft Copilot/Claude Sonnet 4.6