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.
This commit is contained in:
Jean-Gabriel Gill-Couture 2025-01-29 15:50:35 -05:00
parent f1f2c796c4
commit 0cfd5dc89e
2 changed files with 2 additions and 2 deletions

View File

@ -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,
}
}

View File

@ -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 });