fix: stabilize multi-account chat handling

This commit is contained in:
Mikhail Kilin
2026-05-17 04:06:19 +03:00
parent 1208aa5afb
commit 42884d174e
22 changed files with 471 additions and 203 deletions

View File

@@ -83,7 +83,7 @@ async fn test_vim_navigation_in_chat_list() {
assert_eq!(app.chat_list_state.selected(), Some(0));
}
/// Test: Русские клавиши о/р для навигации
/// Test: Русские клавиши о/л для навигации
#[tokio::test]
async fn test_russian_keyboard_navigation() {
let mut app = TestAppBuilder::new()
@@ -99,8 +99,8 @@ async fn test_russian_keyboard_navigation() {
handle_main_input(&mut app, key(KeyCode::Char('о'))).await;
assert_eq!(app.chat_list_state.selected(), Some(1));
// р (русская k) - вверх
handle_main_input(&mut app, key(KeyCode::Char('р'))).await;
// л (русская k) - вверх
handle_main_input(&mut app, key(KeyCode::Char('л'))).await;
assert_eq!(app.chat_list_state.selected(), Some(0));
}

View File

@@ -25,4 +25,4 @@ expression: output
┌──────────────────────┐│ │
│ ││ │
└──────────────────────┘└──────────────────────────────────────────────────────┘
Инициализация TDLib...
[default] Инициализация TDLib...

View File

@@ -435,9 +435,9 @@ async fn test_ctrl_w_deletes_word_with_spaces() {
assert_eq!(app.cursor_position, 9);
}
/// Ctrl+A → курсор в начало в Insert mode
/// Home → курсор в начало в Insert mode
#[tokio::test]
async fn test_ctrl_a_moves_to_start_in_insert() {
async fn test_home_moves_to_start_in_insert() {
let mut app = TestAppBuilder::new()
.with_chats(vec![create_test_chat("Chat", 101)])
.selected_chat(101)
@@ -446,7 +446,7 @@ async fn test_ctrl_a_moves_to_start_in_insert() {
.build();
app.cursor_position = 11;
handle_main_input(&mut app, ctrl_key('a')).await;
handle_main_input(&mut app, key(KeyCode::Home)).await;
assert_eq!(app.cursor_position, 0);
}