From f28ba4abcf1644b10d260797806f7425b391b226 Mon Sep 17 00:00:00 2001 From: WeblWabl Date: Tue, 13 Feb 2024 09:25:46 -0600 Subject: [PATCH] fix(console): remove duplicate controls from async ops view (#519) Each screen in Tokio Console has a controls section that lists all the possible keys that can be used to control that screen. However, on the Resource Detail screen, there were two controls sections - one at the top of the screen and another above the Async Ops table. Since the controls for the Async Ops view were already included in the Resource Detail view controls panel in #427, the controls for the Async Ops view only needed to be removed. This simplified the layout somewhat, as the Async Ops view now only contains a single-subview, the table itself. Closes #258 --- tokio-console/src/view/async_ops.rs | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/tokio-console/src/view/async_ops.rs b/tokio-console/src/view/async_ops.rs index 380799b8d..000319cc3 100644 --- a/tokio-console/src/view/async_ops.rs +++ b/tokio-console/src/view/async_ops.rs @@ -7,7 +7,6 @@ use crate::{ }, view::{ self, bold, - controls::Controls, table::{TableList, TableListState}, DUR_LEN, DUR_TABLE_PRECISION, }, @@ -195,24 +194,6 @@ impl TableList<9> for AsyncOpsTable { table_list_state.len() ))]); - let layout = layout::Layout::default() - .direction(layout::Direction::Vertical) - .margin(0); - - let controls = Controls::new(view_controls(), &area, styles); - let chunks = layout - .constraints( - [ - layout::Constraint::Length(controls.height()), - layout::Constraint::Max(area.height), - ] - .as_ref(), - ) - .split(area); - - let controls_area = chunks[0]; - let async_ops_area = chunks[1]; - let attributes_width = layout::Constraint::Percentage(100); let widths = &[ id_width.constraint(), @@ -233,8 +214,7 @@ impl TableList<9> for AsyncOpsTable { .highlight_symbol(view::TABLE_HIGHLIGHT_SYMBOL) .highlight_style(Style::default().add_modifier(style::Modifier::BOLD)); - frame.render_stateful_widget(table, async_ops_area, &mut table_list_state.table_state); - frame.render_widget(controls.into_widget(), controls_area); + frame.render_stateful_widget(table, area, &mut table_list_state.table_state); table_list_state .sorted_items