-
Notifications
You must be signed in to change notification settings - Fork 11
Add --hide-unmonitored flag to ncurses frontend #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --hide-unmonitored flag to ncurses frontend #20
Conversation
Signed-off-by: Blake McHale <bmchale@nvidia.com>
Signed-off-by: Blake McHale <bmchale@nvidia.com>
Greptile SummaryThis PR adds a
The changes are well-structured, maintain backward compatibility (defaults to showing all topics), and follow existing code patterns. All functionality remains intact with the toggle behavior working both via command-line flag and runtime keyboard shortcut. Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Script as ncurses_dashboard
participant ArgParser as parse_args()
participant Main as main()
participant Node as GreenwaveNcursesFrontend
participant UI as curses_main()
User->>Script: ./ncurses_dashboard --hide-unmonitored
Script->>Script: Parse bash arguments
Script->>Script: Set HIDE_UNMONITORED=true
Script->>Main: python3 -m ncurses_frontend --hide-unmonitored
Main->>ArgParser: parse_args(args)
ArgParser->>ArgParser: parse_known_args()
ArgParser-->>Main: (parsed_args, ros_args)
Main->>Main: rclpy.init(args=ros_args)
Main->>Node: GreenwaveNcursesFrontend(hide_unmonitored=True)
Node->>Node: self.hide_unmonitored = True
Node->>Node: update_topic_list()
Node->>Node: update_visible_topics()
Note over Node: Filters topics based on<br/>hide_unmonitored flag
Main->>UI: curses.wrapper(curses_main, node)
loop Display Loop
UI->>Node: Check node.hide_unmonitored
alt hide_unmonitored == True
UI->>UI: Display "monitored only"
UI->>UI: Show help "h=show unmonitored"
else hide_unmonitored == False
UI->>UI: Display "all topics"
UI->>UI: Show help "h=hide unmonitored"
end
end
User->>UI: Press 'h' key
UI->>Node: Toggle node.hide_unmonitored
Node->>Node: update_visible_topics()
UI->>UI: Update display with new filter
|
Greptile found no issues!From now on, if a review finishes and we haven't found any issues, we will not post anything, but you can confirm that we reviewed your changes in the status check section. This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR". |
| self.status_message = '' | ||
| self.status_timeout = 0 | ||
| self.show_only_monitored = False | ||
| self.show_only_monitored = hide_unmonitored |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit but we should pick one name or the other, I don't care too much which (but I'll vote for show_only_monitored)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I switched it to "hide unmonitored" to stay consistent with the controls in the ncurses interface. We call it that there and should have one consistent naming.
Signed-off-by: Blake McHale <bmchale@nvidia.com>
Signed-off-by: Blake McHale <bmchale@nvidia.com>
Signed-off-by: Blake McHale <bmchale@nvidia.com>
Signed-off-by: Blake McHale <bmchale@nvidia.com>
Signed-off-by: Blake McHale <bmchale@nvidia.com>
sgillen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Add a
--hide-unmonitoredflag to the ncurses frontend. This makes it possible for the user to start greenwave monitor with only the topics that are being monitored visible.Tests were also added to verify the argument parsing is functional with the frontend.