refactor: extract state modules and services from monolithic files
Some checks 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

Извлечены state модули и сервисы из монолитных файлов для улучшения структуры:

State модули:
- auth_state.rs: состояние авторизации
- chat_list_state.rs: состояние списка чатов
- compose_state.rs: состояние ввода сообщений
- message_view_state.rs: состояние просмотра сообщений
- ui_state.rs: UI состояние

Сервисы и утилиты:
- chat_filter.rs: централизованная фильтрация чатов (470+ строк)
- message_service.rs: сервис работы с сообщениями (17KB)
- key_handler.rs: trait для обработки клавиш (380+ строк)

Config модуль:
- config.rs -> config/mod.rs: основной конфиг
- config/keybindings.rs: настраиваемые горячие клавиши (420+ строк)

Тесты: 626 passed 

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Mikhail Kilin
2026-02-04 19:29:25 +03:00
parent 72c4a886fa
commit bd5e5be618
13 changed files with 3173 additions and 369 deletions

View File

@@ -1,6 +1,6 @@
// Integration tests for config flow
use tele_tui::config::{Config, ColorsConfig, GeneralConfig, HotkeysConfig};
use tele_tui::config::{Config, ColorsConfig, GeneralConfig, Keybindings};
/// Test: Дефолтные значения конфигурации
#[test]
@@ -32,7 +32,7 @@ fn test_config_custom_values() {
reaction_chosen: "green".to_string(),
reaction_other: "white".to_string(),
},
hotkeys: HotkeysConfig::default(),
keybindings: Keybindings::default(),
};
assert_eq!(config.general.timezone, "+05:00");
@@ -115,7 +115,7 @@ fn test_config_toml_serialization() {
reaction_chosen: "green".to_string(),
reaction_other: "white".to_string(),
},
hotkeys: HotkeysConfig::default(),
keybindings: Keybindings::default(),
};
// Сериализуем в TOML