From 0cfd5dc89ef64074a11ba921f3143dfa27afd5d4 Mon Sep 17 00:00:00 2001 From: Jean-Gabriel Gill-Couture Date: Wed, 29 Jan 2025 15:50:35 -0500 Subject: [PATCH] fix(tui): handle 'End' key for bottom logs navigation Update the TUI to handle both 'Shift+G' and 'End' keys for navigating to the bottom of logs. Adjusted the help widget text accordingly to reflect this change. --- harmony-rs/harmony_tui/src/lib.rs | 2 +- harmony-rs/harmony_tui/src/widget/help.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/harmony-rs/harmony_tui/src/lib.rs b/harmony-rs/harmony_tui/src/lib.rs index 0387d49..23fa32b 100644 --- a/harmony-rs/harmony_tui/src/lib.rs +++ b/harmony-rs/harmony_tui/src/lib.rs @@ -171,7 +171,7 @@ impl HarmonyTUI { KeyCode::Char('q') | KeyCode::Esc => self.should_quit = true, KeyCode::PageUp => self.tui_state.transition(TuiWidgetEvent::PrevPageKey), KeyCode::PageDown => self.tui_state.transition(TuiWidgetEvent::NextPageKey), - KeyCode::Char('G') => self.tui_state.transition(TuiWidgetEvent::EscapeKey), + KeyCode::Char('G') | KeyCode::End => self.tui_state.transition(TuiWidgetEvent::EscapeKey), _ => self.score.handle_event(event).await, } } diff --git a/harmony-rs/harmony_tui/src/widget/help.rs b/harmony-rs/harmony_tui/src/widget/help.rs index f418161..0e72ddb 100644 --- a/harmony-rs/harmony_tui/src/widget/help.rs +++ b/harmony-rs/harmony_tui/src/widget/help.rs @@ -11,7 +11,7 @@ impl Widget for HelpWidget { fn render(self, area: ratatui::prelude::Rect, buf: &mut ratatui::prelude::Buffer) where Self: Sized { - let text = Paragraph::new("Usage => q/Esc: Quit | j/↑ :Select UP | k/↓: Select Down | Enter: Launch Score | PageUp/PageDown: Scroll Logs | g/Home: Logs top | Shift+G/End: Logs bottom") + let text = Paragraph::new("Usage => q/Esc: Quit | j/↑ :Select UP | k/↓: Select Down | Enter: Launch Score\nPageUp/PageDown: Scroll Logs | Shift+G/End: Logs bottom") .centered() .wrap(Wrap { trim: false });