Skip to content

Commit fb1f19d

Browse files
committed
feat: enhance settings modal input handling (#21)
- Change settings key from S back to comma (,) for consistency - Add vim-style navigation: k/j for up/down movement - Add Space as alternative to Enter for theme selection - Remove T key theme toggle functionality (now modal-only) - Update footer to show enhanced key bindings - Maintain backward compatibility with arrow keys Resolves #21
1 parent 686719d commit fb1f19d

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/events.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,10 @@ impl EventHandler {
5555
match key_event.code {
5656
KeyCode::Char('q') => Ok(AppEvent::Quit),
5757
KeyCode::Esc => Ok(AppEvent::CloseSettings),
58-
KeyCode::Char('s') | KeyCode::Char('S') => Ok(AppEvent::OpenSettings),
59-
KeyCode::Char('t') | KeyCode::Char('T') => Ok(AppEvent::ToggleTheme),
60-
KeyCode::Up => Ok(AppEvent::NavigateUp),
61-
KeyCode::Down => Ok(AppEvent::NavigateDown),
62-
KeyCode::Enter => Ok(AppEvent::Select),
58+
KeyCode::Char(',') => Ok(AppEvent::OpenSettings),
59+
KeyCode::Up | KeyCode::Char('k') => Ok(AppEvent::NavigateUp),
60+
KeyCode::Down | KeyCode::Char('j') => Ok(AppEvent::NavigateDown),
61+
KeyCode::Enter | KeyCode::Char(' ') => Ok(AppEvent::Select),
6362
KeyCode::Char('c')
6463
if key_event.modifiers.contains(KeyModifiers::CONTROL) =>
6564
{

src/ui/app.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,8 @@ impl App {
186186
}
187187
}
188188
AppEvent::ToggleTheme => {
189-
// Toggle theme through settings system
190-
self.settings.get_mut().toggle_theme();
191-
self.settings.get().apply_theme(&mut self.theme);
189+
// T key functionality removed in Issue #21
190+
// Theme changes now only available through settings modal
192191
}
193192
AppEvent::Resize(width, height) => {
194193
self.last_size = Some((width, height));
@@ -371,11 +370,11 @@ impl App {
371370

372371
let footer_text = match self.state {
373372
AppState::Main => format!(
374-
"ESC/q: Quit | T: Toggle Theme | S: Settings | Current: [{}] | Production v0.1.0",
373+
"ESC/q: Quit | ,: Settings | Current: [{}] | Production v0.1.0",
375374
current_theme
376375
),
377376
AppState::Settings => format!(
378-
"ESC: Back to Main | T: Toggle Theme | Current: [{}] | Settings Mode",
377+
"ESC: Back to Main | ↑↓/kj: Navigate | Enter/Space: Select | Current: [{}]",
379378
current_theme
380379
),
381380
AppState::Quitting => "Application shutting down gracefully...".to_string(),

0 commit comments

Comments
 (0)