From 46cc813a68761c7dfa03e366117738cdbb59ae2f Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Sat, 18 Oct 2025 19:26:58 +0200 Subject: [PATCH] Implement Tab key host switching functionality - Add KeyCode::Tab support to main dashboard event loop - Add Tab key handling to TuiApp handle_input method - Tab key now cycles to next host using existing navigate_host logic - Host switching infrastructure was already implemented, just needed Tab key support - Current host displayed in bold in title bar, other hosts shown normally - Metrics filtered by selected host, full navigation working --- dashboard/src/app.rs | 8 ++++++++ dashboard/src/ui/mod.rs | 3 +++ 2 files changed, 11 insertions(+) diff --git a/dashboard/src/app.rs b/dashboard/src/app.rs index 256de36..8c6ca85 100644 --- a/dashboard/src/app.rs +++ b/dashboard/src/app.rs @@ -186,6 +186,14 @@ impl Dashboard { } } } + KeyCode::Tab => { + debug!("Tab pressed - next host"); + if let Some(ref mut tui_app) = self.tui_app { + if let Err(e) = tui_app.handle_input(Event::Key(key)) { + error!("Error handling tab navigation: {}", e); + } + } + } _ => {} } } diff --git a/dashboard/src/ui/mod.rs b/dashboard/src/ui/mod.rs index c8b2986..628c55a 100644 --- a/dashboard/src/ui/mod.rs +++ b/dashboard/src/ui/mod.rs @@ -112,6 +112,9 @@ impl TuiApp { info!("Manual refresh requested"); // Refresh will be handled by main loop } + KeyCode::Tab => { + self.navigate_host(1); // Tab cycles to next host + } _ => {} } }