-
Notifications
You must be signed in to change notification settings - Fork 52
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
chore(launchpad): refactor status screen #2231
Conversation
fn update_node_items(&mut self) -> Result<()> { | ||
// Iterate over existing node services and update their corresponding NodeItem | ||
if let Some(ref mut items) = self.items { | ||
for (node_item, item) in self.node_services.iter().zip(&mut items.items) { |
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.
Would this cause an issue if node_services.len() > items.len()
? The items
field is updated only during // If items is None, create a new list (fallback)
part of the code. This would mean that if we were to add a new node, just the node_services
would be updated and not items
. Then the zip()
would ignore these new nodes.
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.
The solution is to keep node_services
and items
in sync.
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.
We will not delete nodes just now. That hopefully will come in the next PR when we manage nodes individually.
Thanks for your feedback @RolandSherwin !
Description
To unify patterns and to be prepared for the next feature, we use now
NodeItem
and aStatefulTable
for the status screen as we use on the drive selection and connection popups.With this architecture is easier to understand how to update the real time node status and changing rendering modes per node. We update stats and spinners on
Tick
.Next feature: Call To Actions on individual nodes.