aboutsummaryrefslogtreecommitdiff
path: root/src/app/input/mod.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-04-22 17:01:25 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-04-22 17:01:25 +0300
commit4b482f37a1e233b9aca6bf99b12e8b4da3e5c05e (patch)
tree69d1a56ad6335547eec9727691310cf96ebe9623 /src/app/input/mod.rs
parent5bd939fbfc92a8073d0eac11dfb02a31ea638b15 (diff)
feat: add terminal-delivered client notifications
Diffstat (limited to 'src/app/input/mod.rs')
-rw-r--r--src/app/input/mod.rs37
1 files changed, 8 insertions, 29 deletions
diff --git a/src/app/input/mod.rs b/src/app/input/mod.rs
index 2f069fea..9676da62 100644
--- a/src/app/input/mod.rs
+++ b/src/app/input/mod.rs
@@ -37,11 +37,11 @@ pub(crate) use self::{
handle_keybind_help_key, handle_rename_key, handle_resize_key,
},
navigate::{handle_navigate_key, terminal_direct_navigation_action},
+ settings::open_settings,
};
use self::{
modal::{
- modal_action_from_key, ModalAction, ONBOARDING_NOTIFICATION_ACTIONS,
- ONBOARDING_WELCOME_ACTIONS, RELEASE_NOTES_ACTIONS,
+ modal_action_from_key, ModalAction, ONBOARDING_WELCOME_ACTIONS, RELEASE_NOTES_ACTIONS,
},
settings::SettingsAction,
};
@@ -89,32 +89,11 @@ impl App {
}
pub(crate) fn handle_onboarding_key(&mut self, key: KeyEvent) {
- match self.state.onboarding_step {
- 0 => match key.code {
- KeyCode::Right | KeyCode::Char('l') => {
- self.state.onboarding_step = 1;
- }
- _ => match modal_action_from_key(&key, ONBOARDING_WELCOME_ACTIONS) {
- Some(ModalAction::Continue) => self.state.onboarding_step = 1,
- _ => {}
- },
- },
- _ => match key.code {
- KeyCode::Up | KeyCode::Char('k') => self.state.onboarding_list.move_prev(),
- KeyCode::Down | KeyCode::Char('j') => self.state.onboarding_list.move_next(4),
- KeyCode::Left | KeyCode::Char('h') => {
- self.state.onboarding_step = 0;
- }
- KeyCode::Char(c) if ('1'..='4').contains(&c) => {
- self.state
- .onboarding_list
- .select((c as usize) - ('1' as usize));
- }
- _ => match modal_action_from_key(&key, ONBOARDING_NOTIFICATION_ACTIONS) {
- Some(ModalAction::Back) => self.state.onboarding_step = 0,
- Some(ModalAction::Save) => self.complete_onboarding(),
- _ => {}
- },
+ match key.code {
+ KeyCode::Right | KeyCode::Char('l') => self.open_settings_from_onboarding(),
+ _ => match modal_action_from_key(&key, ONBOARDING_WELCOME_ACTIONS) {
+ Some(ModalAction::Continue) => self.open_settings_from_onboarding(),
+ _ => {}
},
}
}
@@ -170,7 +149,7 @@ impl App {
match action {
SettingsAction::SaveTheme(name) => self.save_theme(&name),
SettingsAction::SaveSound(enabled) => self.save_sound(enabled),
- SettingsAction::SaveToast(enabled) => self.save_toast(enabled),
+ SettingsAction::SaveToastDelivery(delivery) => self.save_toast_delivery(delivery),
}
}