Mikhail Kilin
|
264f183510
|
style: auto-format entire codebase with cargo fmt (stable rustfmt.toml)
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
|
2026-02-22 17:09:51 +03:00 |
|
Mikhail Kilin
|
7b2dd6c9a9
|
refactor: encapsulate auth fields (Group 1/5)
Фаза 1, Подход 2 - постепенная инкапсуляция полей App.
Changes:
- src/app/mod.rs: сделаны приватными phone_input, code_input, password_input
- src/input/auth.rs: замены на phone_input_mut(), code_input_mut(), password_input_mut()
- src/ui/auth.rs: замены на phone_input(), code_input(), password_input()
- tests/helpers/app_builder.rs: замены на set_phone_input(), set_code_input(), set_password_input()
Используются существующие геттеры/сеттеры (были добавлены ранее).
Progress: Group 1/5 complete (auth fields)
Next: Group 2 (UI state: screen, is_loading, needs_redraw, is_searching)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
2026-02-02 17:56:34 +03:00 |
|
Mikhail Kilin
|
3c8fec7ca6
|
refactor: integrate validation utils and complete refactoring #1
Завершена интеграция validation utils во всех местах проверки user input:
Changes:
- src/utils/mod.rs: раскомментирован экспорт validation::*
- src/input/auth.rs: 3 замены .is_empty() -> is_non_empty()
* phone_input validation (line 18)
* code_input validation (line 50)
* password_input validation (line 82)
- src/input/main_input.rs: 1 замена для message_input (line 484)
- src/main.rs: заменён последний прямой timeout на with_timeout_ignore
Documentation:
- REFACTORING_OPPORTUNITIES.md: обновлён статус категории #1
* Отмечено как "ПОЛНОСТЬЮ ЗАВЕРШЕНО" (2026-02-02)
* Добавлены метрики: 100% покрытие retry utils, 0 прямых timeouts
* Обновлён план выполнения: фаза 1 завершена
- CONTEXT.md: добавлен раздел об интеграции validation utils
Result:
✅ Категория #1 (Дублирование кода) - ПОЛНОСТЬЮ ЗАВЕРШЕНА!
- retry utils: 100% покрытие (8+ мест)
- modal_handler: 2 диалога
- validation: 4 места
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
2026-02-02 17:38:49 +03:00 |
|
Mikhail Kilin
|
0768283e8a
|
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>
|
2026-02-02 14:20:33 +03:00 |
|
Mikhail Kilin
|
8e48d076de
|
refactor: implement trait-based DI for TdClient and fix stack overflow
Implement complete trait-based dependency injection pattern for TdClient
to enable testing with FakeTdClient mock. Fix critical stack overflow bugs
caused by infinite recursion in trait implementations.
Breaking Changes:
- App is now generic: App<T: TdClientTrait = TdClient>
- All UI and input handlers are generic over TdClientTrait
- TdClient methods now accessed through trait interface
New Files:
- src/tdlib/trait.rs: TdClientTrait definition with 40+ methods
- src/tdlib/client_impl.rs: TdClientTrait impl for TdClient
- tests/helpers/fake_tdclient_impl.rs: TdClientTrait impl for FakeTdClient
Critical Fixes:
- Fix stack overflow in send_message, edit_message, delete_messages
- Fix stack overflow in forward_messages, current_chat_messages
- Fix stack overflow in current_pinned_message
- All methods now call message_manager directly to avoid recursion
Testing:
- FakeTdClient supports configurable auth_state for auth screen tests
- Added pinned message support in FakeTdClient
- All 196+ tests passing (188 tests + 8 benchmarks)
Dependencies:
- Added async-trait = "0.1"
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
2026-02-02 05:42:19 +03:00 |
|
Mikhail Kilin
|
bba5cbd22d
|
fixes
|
2026-01-30 23:55:01 +03:00 |
|
Mikhail Kilin
|
4deb0fbe00
|
commit
|
2026-01-30 15:07:13 +03:00 |
|
Mikhail Kilin
|
b6d9291864
|
fixes
|
2026-01-20 01:00:12 +03:00 |
|