style: auto-format entire codebase with cargo fmt (stable rustfmt.toml)
Some checks failed
ci/woodpecker/pr/check Pipeline failed
CI / Check (pull_request) Has been cancelled
CI / Format (pull_request) Has been cancelled
CI / Clippy (pull_request) Has been cancelled
CI / Build (macos-latest) (pull_request) Has been cancelled
CI / Build (ubuntu-latest) (pull_request) Has been cancelled
CI / Build (windows-latest) (pull_request) Has been cancelled
Some checks failed
ci/woodpecker/pr/check Pipeline failed
CI / Check (pull_request) Has been cancelled
CI / Format (pull_request) Has been cancelled
CI / Clippy (pull_request) Has been cancelled
CI / Build (macos-latest) (pull_request) Has been cancelled
CI / Build (ubuntu-latest) (pull_request) Has been cancelled
CI / Build (windows-latest) (pull_request) Has been cancelled
This commit is contained in:
@@ -3,35 +3,26 @@
|
||||
//! Dispatches keyboard events to specialized handlers based on current app mode.
|
||||
//! Priority order: modals → search → compose → chat → chat list.
|
||||
|
||||
use crate::app::methods::{
|
||||
compose::ComposeMethods, messages::MessageMethods, modal::ModalMethods,
|
||||
navigation::NavigationMethods, search::SearchMethods,
|
||||
};
|
||||
use crate::app::App;
|
||||
use crate::app::InputMode;
|
||||
use crate::app::methods::{
|
||||
compose::ComposeMethods,
|
||||
messages::MessageMethods,
|
||||
modal::ModalMethods,
|
||||
navigation::NavigationMethods,
|
||||
search::SearchMethods,
|
||||
};
|
||||
use crate::tdlib::TdClientTrait;
|
||||
use crate::input::handlers::{
|
||||
chat::{handle_enter_key, handle_message_selection, handle_open_chat_keyboard_input},
|
||||
chat_list::handle_chat_list_navigation,
|
||||
compose::handle_forward_mode,
|
||||
handle_global_commands,
|
||||
modal::{
|
||||
handle_account_switcher,
|
||||
handle_profile_mode, handle_profile_open, handle_delete_confirmation,
|
||||
handle_reaction_picker_mode, handle_pinned_mode,
|
||||
handle_account_switcher, handle_delete_confirmation, handle_pinned_mode,
|
||||
handle_profile_mode, handle_profile_open, handle_reaction_picker_mode,
|
||||
},
|
||||
search::{handle_chat_search_mode, handle_message_search_mode},
|
||||
compose::handle_forward_mode,
|
||||
chat_list::handle_chat_list_navigation,
|
||||
chat::{
|
||||
handle_message_selection, handle_enter_key,
|
||||
handle_open_chat_keyboard_input,
|
||||
},
|
||||
};
|
||||
use crate::tdlib::TdClientTrait;
|
||||
use crossterm::event::KeyEvent;
|
||||
|
||||
|
||||
|
||||
/// Обработка клавиши Esc в Normal mode
|
||||
///
|
||||
/// Закрывает чат с сохранением черновика
|
||||
@@ -55,7 +46,10 @@ async fn handle_escape_normal<T: TdClientTrait>(app: &mut App<T>) {
|
||||
let _ = app.td_client.set_draft_message(chat_id, draft_text).await;
|
||||
} else {
|
||||
// Очищаем черновик если инпут пустой
|
||||
let _ = app.td_client.set_draft_message(chat_id, String::new()).await;
|
||||
let _ = app
|
||||
.td_client
|
||||
.set_draft_message(chat_id, String::new())
|
||||
.await;
|
||||
}
|
||||
|
||||
app.close_chat();
|
||||
@@ -252,7 +246,7 @@ pub async fn handle<T: TdClientTrait>(app: &mut App<T>, key: KeyEvent) {
|
||||
}
|
||||
|
||||
/// Обработка модального окна просмотра изображения
|
||||
///
|
||||
///
|
||||
/// Hotkeys:
|
||||
/// - Esc/q: закрыть модальное окно
|
||||
/// - ←: предыдущее фото в чате
|
||||
@@ -331,4 +325,3 @@ async fn navigate_to_adjacent_photo<T: TdClientTrait>(app: &mut App<T>, directio
|
||||
};
|
||||
app.status_message = Some(msg.to_string());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user