refactor: eliminate code duplication - extract helpers and use retry utils
Extracted duplicate code and unified timeout handling across the codebase. Changes: - Extracted open_chat_and_load_data() function (eliminates 52 lines of duplication) - Replaced manual y/н/Enter handling with handle_yes_no() from modal_handler (2 places) - Replaced 7 direct tokio::time::timeout calls with retry utils (auth, main_input, main) - Added with_timeout_ignore() for non-critical operations - Fixed modal_handler.rs bug: corrected Russian 'y' key (д → н) - Removed unused imports in handlers/mod.rs and utils/mod.rs Impact: - main_input.rs: 1164 → 958 lines (-206 lines, -18%) - Code duplication: 52 lines eliminated - Direct timeout calls: 7 → 1 (-86%) - DRY principle applied throughout Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -17,10 +17,10 @@ pub mod modal;
|
||||
pub mod profile;
|
||||
pub mod search;
|
||||
|
||||
pub use chat_list::*;
|
||||
// pub use chat_list::*; // Пока не используется
|
||||
pub use clipboard::*;
|
||||
pub use global::*;
|
||||
pub use messages::*;
|
||||
pub use modal::*;
|
||||
pub use profile::*;
|
||||
pub use search::*;
|
||||
// pub use messages::*; // Пока не используется
|
||||
// pub use modal::*; // Пока не используется
|
||||
pub use profile::get_available_actions_count; // Используется в main_input
|
||||
// pub use search::*; // Пока не используется
|
||||
|
||||
Reference in New Issue
Block a user