refactor: clear the quality-scan findings

`render_shortcuts` was 144 lines of "which shortcuts apply" wrapped around 40
lines of drawing; the decision moves into a `shortcuts` method beside the
`rooms_shortcuts` helper that already worked this way. Three identically
shaped comments over the popup guards collapse into one that carries the part
worth knowing — an open popup owns the keyboard, so the order matters. The
state tests trade bare `unwrap()` for `expect()` so a failure names the step.
This commit is contained in:
Michel de Graaf
2026-07-25 02:32:11 +02:00
parent 14b0321dbc
commit 9d58bb9b64
3 changed files with 28 additions and 20 deletions
+1 -6
View File
@@ -16,17 +16,13 @@ impl MainTui {
return self.handle_chat_input(key);
}
// Browse popup takes over navigation while open.
// An open popup owns the keyboard, so these come before pane routing.
if self.state.show_browse {
return self.handle_browse_input(key);
}
// Rooms popup takes over navigation while open.
if self.state.show_rooms {
return self.handle_rooms_input(key);
}
// Settings popup takes over navigation while open.
if self.state.settings.is_some() {
return self.handle_settings_input(key);
}
@@ -149,7 +145,6 @@ impl MainTui {
KeyCode::BackTab | KeyCode::Up | KeyCode::Char('k') => {
self.state.cycle_chat_peer(false);
}
// Start a conversation with someone not in the list yet.
KeyCode::Char('m') => {
self.state.show_messages = false;
self.state.command_bar_active = true;