//! Input handlers organized by functionality //! //! This module contains handlers for different input contexts: //! - global: Global commands (Ctrl+R, Ctrl+S, etc.) //! - clipboard: Clipboard operations //! - profile: Profile helper functions //! - chat: Keyboard input handling for open chat view //! - chat_list: Navigation and interaction in the chat list //! - compose: Text input, editing, and message composition //! - modal: Modal dialogs (delete confirmation, emoji picker, etc.) //! - search: Search functionality (chat search, message search) pub mod clipboard; pub mod global; pub mod profile; pub mod chat; pub mod chat_list; pub mod compose; pub mod modal; pub mod search; pub use clipboard::*; pub use global::*; pub use profile::get_available_actions_count; use crate::app::App; use crate::tdlib::TdClientTrait; use crate::types::MessageId; /// Скроллит к сообщению по его ID в текущем чате pub fn scroll_to_message(app: &mut App, message_id: MessageId) { let msg_index = app .td_client .current_chat_messages() .iter() .position(|m| m.id() == message_id); if let Some(idx) = msg_index { let total = app.td_client.current_chat_messages().len(); app.message_scroll_offset = total.saturating_sub(idx + 5); } }