kanban-tui 0.8.0

Terminal user interface for the kanban project management tool
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
use crate::app::{App, BoardFocus, DialogMode};
use crossterm::event::KeyCode;
use kanban_domain::card_lifecycle::sorted_board_columns;
use kanban_domain::commands::{
    BoardCommand, CardCommand, ColumnCommand, Command, CreateColumn, DeleteColumn, MoveCard,
    SetBoardTaskListView, UpdateColumn,
};
use kanban_domain::{ColumnUpdate, TaskListView};

impl App {
    pub fn handle_create_column_key(&mut self) {
        if self.focus.board_focus == BoardFocus::Columns {
            {
                if self.active_board().is_some() {
                    self.open_dialog(DialogMode::CreateColumn);
                    self.input.clear();
                }
            }
        }
    }

    pub fn handle_rename_column_key(&mut self) {
        if self.focus.board_focus == BoardFocus::Columns
            && self.dialog_input.column_selection.get().is_some()
        {
            {
                if let Some(board) = self.active_board() {
                    let board_columns = sorted_board_columns(board.id, self.model.columns());

                    if let Some(column_idx) = self.dialog_input.column_selection.get() {
                        if let Some(column) = board_columns.get(column_idx) {
                            self.input.set(column.name.clone());
                            self.open_dialog(DialogMode::RenameColumn);
                        }
                    }
                }
            }
        }
    }

    pub fn handle_delete_column_key(&mut self) {
        if self.focus.board_focus == BoardFocus::Columns
            && self.dialog_input.column_selection.get().is_some()
        {
            {
                if let Some(board) = self.active_board() {
                    let column_count = self
                        .model
                        .columns()
                        .iter()
                        .filter(|col| col.board_id == board.id)
                        .count();

                    if column_count > 1 {
                        self.open_dialog(DialogMode::DeleteColumnConfirm);
                    } else {
                        tracing::warn!("Cannot delete the last column");
                    }
                }
            }
        }
    }

    pub fn handle_move_column_up(&mut self) {
        if self.focus.board_focus == BoardFocus::Columns
            && self.dialog_input.column_selection.get().is_some()
        {
            {
                if let Some(board) = self.active_board() {
                    let board_columns: Vec<(uuid::Uuid, i32)> =
                        sorted_board_columns(board.id, self.model.columns())
                            .into_iter()
                            .map(|col| (col.id, col.position))
                            .collect();

                    if let Some(selected_idx) = self.dialog_input.column_selection.get() {
                        if selected_idx > 0 && selected_idx < board_columns.len() {
                            let prev_col_id = board_columns[selected_idx - 1].0;
                            let curr_col_id = board_columns[selected_idx].0;
                            let prev_pos = board_columns[selected_idx - 1].1;
                            let curr_pos = board_columns[selected_idx].1;

                            // Swap positions using batched commands
                            let cmd1 = Command::Column(ColumnCommand::Update(UpdateColumn {
                                column_id: prev_col_id,
                                updates: ColumnUpdate {
                                    position: Some(curr_pos),
                                    ..Default::default()
                                },
                            }));

                            let cmd2 = Command::Column(ColumnCommand::Update(UpdateColumn {
                                column_id: curr_col_id,
                                updates: ColumnUpdate {
                                    position: Some(prev_pos),
                                    ..Default::default()
                                },
                            }));

                            if let Err(e) = self.execute_commands_batch(vec![cmd1, cmd2]) {
                                tracing::error!("Failed to move column: {}", e);
                                self.set_error(format!("Failed to move column: {}", e));
                                return;
                            }

                            self.dialog_input.column_selection.prev();
                            tracing::info!("Moved column up");
                        }
                    }
                }
            }
        }
    }

    pub fn handle_move_column_down(&mut self) {
        if self.focus.board_focus == BoardFocus::Columns
            && self.dialog_input.column_selection.get().is_some()
        {
            {
                if let Some(board) = self.active_board() {
                    let board_columns: Vec<(uuid::Uuid, i32)> =
                        sorted_board_columns(board.id, self.model.columns())
                            .into_iter()
                            .map(|col| (col.id, col.position))
                            .collect();

                    if let Some(selected_idx) = self.dialog_input.column_selection.get() {
                        if selected_idx < board_columns.len() - 1 {
                            let curr_col_id = board_columns[selected_idx].0;
                            let next_col_id = board_columns[selected_idx + 1].0;
                            let curr_pos = board_columns[selected_idx].1;
                            let next_pos = board_columns[selected_idx + 1].1;

                            // Swap positions using batched commands
                            let cmd1 = Command::Column(ColumnCommand::Update(UpdateColumn {
                                column_id: next_col_id,
                                updates: ColumnUpdate {
                                    position: Some(curr_pos),
                                    ..Default::default()
                                },
                            }));

                            let cmd2 = Command::Column(ColumnCommand::Update(UpdateColumn {
                                column_id: curr_col_id,
                                updates: ColumnUpdate {
                                    position: Some(next_pos),
                                    ..Default::default()
                                },
                            }));

                            if let Err(e) = self.execute_commands_batch(vec![cmd1, cmd2]) {
                                tracing::error!("Failed to move column: {}", e);
                                self.set_error(format!("Failed to move column: {}", e));
                                return;
                            }

                            let column_count = board_columns.len();
                            self.dialog_input.column_selection.next(column_count);
                            tracing::info!("Moved column down");
                        }
                    }
                }
            }
        }
    }

    pub fn handle_toggle_task_list_view(&mut self) {
        if self.focus.active != crate::app::Focus::Cards {
            return;
        }

        if let Some(board) = self.active_board() {
            let current_view_idx = match board.task_list_view {
                TaskListView::Flat => 0,
                TaskListView::GroupedByColumn => 1,
                TaskListView::ColumnView => 2,
            };
            self.dialog_input
                .task_list_view_selection
                .set(Some(current_view_idx));
            self.open_dialog(DialogMode::SelectTaskListView);
        }
    }

    pub fn create_column(&mut self) {
        {
            // Collect board_id before command execution
            let board_id = self.active_board().map(|board| board.id);

            if let Some(board_id) = board_id {
                let column_name = self.input.as_str().trim().to_string();

                if column_name.is_empty() {
                    tracing::warn!("Column name cannot be empty");
                    return;
                }

                let position = self
                    .model
                    .columns()
                    .iter()
                    .filter(|col| col.board_id == board_id)
                    .map(|col| col.position)
                    .max()
                    .unwrap_or(-1)
                    + 1;

                let cmd = Command::Column(ColumnCommand::Create(CreateColumn {
                    id: uuid::Uuid::new_v4(),
                    board_id,
                    name: column_name.clone(),
                    position,
                }));

                let prior_column_count = self
                    .model
                    .columns()
                    .iter()
                    .filter(|col| col.board_id == board_id)
                    .count();

                if let Err(e) = self.execute_command(cmd) {
                    tracing::error!("Failed to create column: {}", e);
                    self.set_error(format!("Failed to create column: {}", e));
                    return;
                }

                tracing::info!("Created column: {} (position: {})", column_name, position);

                self.dialog_input
                    .column_selection
                    .set(Some(prior_column_count));
            }
        }
    }

    pub fn rename_column(&mut self) {
        {
            // Collect column ID before mutable borrow
            let column_info = {
                if let Some(board) = self.active_board() {
                    if let Some(column_idx) = self.dialog_input.column_selection.get() {
                        let columns = self.model.columns();
                        let board_columns: Vec<_> = columns
                            .iter()
                            .filter(|col| col.board_id == board.id)
                            .collect();

                        board_columns.get(column_idx).map(|col| col.id)
                    } else {
                        None
                    }
                } else {
                    None
                }
            };

            if let Some(column_id) = column_info {
                let new_name = self.input.as_str().trim().to_string();

                if new_name.is_empty() {
                    tracing::warn!("Column name cannot be empty");
                    return;
                }

                let cmd = Command::Column(ColumnCommand::Update(UpdateColumn {
                    column_id,
                    updates: ColumnUpdate {
                        name: Some(new_name.clone()),
                        ..Default::default()
                    },
                }));

                if let Err(e) = self.execute_command(cmd) {
                    tracing::error!("Failed to rename column: {}", e);
                    self.set_error(format!("Failed to rename column: {}", e));
                    return;
                }

                tracing::info!("Renamed column to: {}", new_name);
            }
        }
    }

    pub fn delete_column(&mut self) {
        {
            // Collect all necessary data before mutating
            let delete_info = {
                if let Some(board) = self.active_board() {
                    if let Some(column_idx) = self.dialog_input.column_selection.get() {
                        let board_columns: Vec<(uuid::Uuid, String)> =
                            sorted_board_columns(board.id, self.model.columns())
                                .into_iter()
                                .map(|col| (col.id, col.name.clone()))
                                .collect();

                        if board_columns.len() <= 1 {
                            return;
                        }

                        let column_to_delete = board_columns.get(column_idx).cloned();
                        let first_column_id = board_columns.first().map(|(id, _)| *id);

                        if let Some((column_id, column_name)) = column_to_delete {
                            let cards_to_move: Vec<(uuid::Uuid, i32)> = self
                                .model
                                .live_cards()
                                .iter()
                                .filter(|card| card.column_id == column_id)
                                .map(|card| (card.id, card.position))
                                .collect();

                            Some((
                                column_id,
                                column_name,
                                first_column_id,
                                cards_to_move,
                                column_idx,
                            ))
                        } else {
                            None
                        }
                    } else {
                        None
                    }
                } else {
                    None
                }
            };

            if let Some((column_id, column_name, first_column_id, cards_to_move, column_idx)) =
                delete_info
            {
                let remaining_after_delete = {
                    let columns = self.model.columns();
                    self.active_board()
                        .map(|b| {
                            columns
                                .iter()
                                .filter(|c| c.board_id == b.id && c.id != column_id)
                                .count()
                        })
                        .unwrap_or(0)
                };

                tracing::warn!("Cannot delete the last column");

                // Build the full operation as one batch: move every
                // card to the first column, then delete the column.
                // One user action → one undo entry.
                let mut commands: Vec<Command> = Vec::new();
                if let Some(target_column_id) = first_column_id {
                    if target_column_id != column_id {
                        for (card_id, position) in cards_to_move {
                            commands.push(Command::Card(CardCommand::Move(MoveCard {
                                card_id,
                                new_column_id: target_column_id,
                                new_position: position,
                            })));
                        }
                    }
                }
                commands.push(Command::Column(ColumnCommand::Delete(DeleteColumn {
                    column_id,
                })));

                if let Err(e) = self.execute_commands_batch(commands) {
                    tracing::error!("Failed to delete column: {}", e);
                    self.set_error(format!("Failed to delete column: {}", e));
                    return;
                }

                tracing::info!("Deleted column: {}", column_name);

                if remaining_after_delete > 0 {
                    if column_idx >= remaining_after_delete {
                        self.dialog_input
                            .column_selection
                            .set(Some(remaining_after_delete - 1));
                    } else {
                        self.dialog_input.column_selection.set(Some(column_idx));
                    }
                } else {
                    self.dialog_input.column_selection.clear();
                }
            }
        }
    }

    pub fn handle_create_column_dialog(&mut self, key_code: KeyCode) {
        match key_code {
            KeyCode::Esc => {
                self.pop_mode();
                self.focus.board_focus = BoardFocus::Columns;
                self.input.clear();
            }
            KeyCode::Enter => {
                self.create_column();
                self.pop_mode();
                self.focus.board_focus = BoardFocus::Columns;
                self.input.clear();
            }
            KeyCode::Char(c) => {
                self.input.insert_char(c);
            }
            KeyCode::Backspace => {
                self.input.backspace();
            }
            KeyCode::Left => {
                self.input.move_left();
            }
            KeyCode::Right => {
                self.input.move_right();
            }
            _ => {}
        }
    }

    pub fn handle_rename_column_dialog(&mut self, key_code: KeyCode) {
        match key_code {
            KeyCode::Esc => {
                self.pop_mode();
                self.focus.board_focus = BoardFocus::Columns;
                self.input.clear();
            }
            KeyCode::Enter => {
                self.rename_column();
                self.pop_mode();
                self.focus.board_focus = BoardFocus::Columns;
                self.input.clear();
            }
            KeyCode::Char(c) => {
                self.input.insert_char(c);
            }
            KeyCode::Backspace => {
                self.input.backspace();
            }
            KeyCode::Left => {
                self.input.move_left();
            }
            KeyCode::Right => {
                self.input.move_right();
            }
            _ => {}
        }
    }

    pub fn handle_delete_column_confirm_popup(&mut self, key_code: KeyCode) {
        match key_code {
            KeyCode::Enter | KeyCode::Char('y') | KeyCode::Char('Y') => {
                self.delete_column();
                self.pop_mode();
                self.focus.board_focus = BoardFocus::Columns;
            }
            KeyCode::Char('n')
            | KeyCode::Char('N')
            | KeyCode::Char('q')
            | KeyCode::Char('Q')
            | KeyCode::Esc => {
                self.pop_mode();
                self.focus.board_focus = BoardFocus::Columns;
            }
            _ => {}
        }
    }

    pub fn handle_select_task_list_view_popup(&mut self, key_code: KeyCode) {
        match key_code {
            KeyCode::Esc => {
                self.pop_mode();
                self.dialog_input.task_list_view_selection.clear();
            }
            KeyCode::Char('j') | KeyCode::Down => {
                self.dialog_input.task_list_view_selection.next(3);
            }
            KeyCode::Char('k') | KeyCode::Up => {
                self.dialog_input.task_list_view_selection.prev();
            }
            KeyCode::Enter | KeyCode::Char(' ') => {
                if let Some(view_idx) = self.dialog_input.task_list_view_selection.get() {
                    let view = match view_idx {
                        0 => TaskListView::Flat,
                        1 => TaskListView::GroupedByColumn,
                        2 => TaskListView::ColumnView,
                        _ => TaskListView::Flat,
                    };

                    let selected_card_id = self.get_selected_card_id();

                    if let Some(board_id) = self.active_board().map(|b| b.id) {
                        {
                            let cmd = Command::Board(BoardCommand::SetTaskListView(
                                SetBoardTaskListView { board_id, view },
                            ));

                            if let Err(e) = self.execute_command(cmd) {
                                tracing::error!("Failed to set task list view: {}", e);
                                self.set_error(format!("Failed to set task list view: {}", e));
                                self.pop_mode();
                                self.dialog_input.task_list_view_selection.clear();
                                return;
                            }

                            self.switch_view_strategy(view);

                            if let Some(card_id) = selected_card_id {
                                self.select_card_by_id(card_id);
                            }

                            tracing::info!("Updated task list view to: {:?}", view);
                        }
                    }
                }
                self.pop_mode();
                self.dialog_input.task_list_view_selection.clear();
            }
            _ => {}
        }
    }
}

#[cfg(test)]
mod tests {
    use crate::app::BoardFocus;
    use crate::App;

    /// Refresh the TUI model from the store so the create handlers (which read
    /// `self.model`) see prior writes. The event loop does this each frame via
    /// `prepare_frame`; tests pull the snapshot directly.
    fn refresh(app: &mut App) {
        let snap = app.ctx.snapshot().unwrap();
        app.model.load_from_snapshot(snap);
    }

    fn create_named_board(app: &mut App, name: &str) {
        app.input.set(name.to_string());
        app.create_board();
        app.input.clear();
        refresh(app);
        // Column operations act on the active board (as when editing its detail).
        app.selection.active_board_id = app.model.boards().first().map(|b| b.id);
    }

    fn create_named_column(app: &mut App, name: &str) {
        app.input.set(name.to_string());
        app.create_column();
        app.input.clear();
        refresh(app);
    }

    /// KAN-794: the TUI column-create entry point funnels through the Column
    /// factory (`Column::create` via the `CreateColumn` command), so a created
    /// column carries the factory's single-clock invariant (`created_at ==
    /// updated_at`) and appends after the three default columns the board seeds.
    #[test]
    fn test_tui_create_column_routes_through_factory() {
        let mut app = App::test_default();
        create_named_board(&mut app, "Roadmap");
        let board_id = app.ctx.data_store().list_boards().unwrap()[0].id;

        create_named_column(&mut app, "In Review");

        let columns = app.ctx.data_store().list_all_columns().unwrap();
        let column = columns
            .iter()
            .find(|c| c.board_id == board_id && c.name == "In Review")
            .expect("created column present in store");
        // Factory uses one clock for both timestamps.
        assert_eq!(column.created_at, column.updated_at);
        // Appends after the three default columns (TODO/Doing/Complete).
        assert_eq!(column.position, 3);
    }

    /// The TUI create path rejects a blank/whitespace column name before any
    /// command is built, so no column is written.
    #[test]
    fn test_tui_create_column_rejects_blank_name() {
        let mut app = App::test_default();
        create_named_board(&mut app, "Roadmap");
        let board_id = app.ctx.data_store().list_boards().unwrap()[0].id;
        let before = app
            .ctx
            .data_store()
            .list_all_columns()
            .unwrap()
            .iter()
            .filter(|c| c.board_id == board_id)
            .count();

        create_named_column(&mut app, "   ");

        let after = app
            .ctx
            .data_store()
            .list_all_columns()
            .unwrap()
            .iter()
            .filter(|c| c.board_id == board_id)
            .count();
        assert_eq!(after, before, "blank column name must not be written");
    }

    #[test]
    fn test_move_column_up_swaps_correct_pair_regardless_of_model_iteration_order() {
        use kanban_domain::KanbanOperations;

        let mut app = App::test_default();
        create_named_board(&mut app, "Roadmap");
        let board_id = app.ctx.data_store().list_boards().unwrap()[0].id;

        // Explicit-position create ties "New" with "Doing" (position 1);
        // "Doing" was created first, so canonical order is
        // [TODO(0), Doing(1), New(1), Complete(2)] -- Complete is last,
        // unambiguously, since its position (2) is unique.
        let doing_id = app
            .ctx
            .data_store()
            .list_columns_by_board(board_id)
            .unwrap()
            .iter()
            .find(|c| c.name == "Doing")
            .unwrap()
            .id;
        let complete_id = app
            .ctx
            .data_store()
            .list_columns_by_board(board_id)
            .unwrap()
            .iter()
            .find(|c| c.name == "Complete")
            .unwrap()
            .id;
        let new_col = app
            .ctx
            .create_column(board_id, "New".to_string(), Some(1))
            .unwrap();

        // Feed the model a snapshot with the tied pair's relative order
        // swapped from canonical, instead of going through the normal
        // ctx.snapshot() pipeline -- proving handle_move_column_up no longer
        // depends on the model happening to already be canonically ordered.
        let mut snapshot = app.ctx.snapshot().unwrap();
        let doing_idx = snapshot
            .columns
            .iter()
            .position(|c| c.id == doing_id)
            .unwrap();
        let new_idx = snapshot
            .columns
            .iter()
            .position(|c| c.id == new_col.id)
            .unwrap();
        snapshot.columns.swap(doing_idx, new_idx);
        app.model.load_from_snapshot(snapshot);
        app.selection.active_board_id = Some(board_id);

        // Complete is unambiguously last (index 3); moving it up must swap it
        // with "New" (its canonical predecessor, the later-created of the
        // tied pair) -- not "Doing", regardless of the scrambled model order.
        app.focus.board_focus = BoardFocus::Columns;
        app.dialog_input.column_selection.set(Some(3));
        app.handle_move_column_up();

        let doing = app.ctx.data_store().get_column(doing_id).unwrap().unwrap();
        let new = app
            .ctx
            .data_store()
            .get_column(new_col.id)
            .unwrap()
            .unwrap();
        let complete = app
            .ctx
            .data_store()
            .get_column(complete_id)
            .unwrap()
            .unwrap();

        assert_eq!(
            doing.position, 1,
            "Doing is not adjacent to Complete in canonical order and must be untouched"
        );
        assert_eq!(
            new.position, 2,
            "New (Complete's canonical predecessor) must be bumped to Complete's old position"
        );
        assert_eq!(
            complete.position, 1,
            "Complete must take New's old position"
        );
    }

    #[test]
    fn test_rename_column_resolves_correct_column_regardless_of_model_iteration_order() {
        use kanban_domain::KanbanOperations;

        let mut app = App::test_default();
        create_named_board(&mut app, "Roadmap");
        let board_id = app.ctx.data_store().list_boards().unwrap()[0].id;

        let doing_id = app
            .ctx
            .data_store()
            .list_columns_by_board(board_id)
            .unwrap()
            .iter()
            .find(|c| c.name == "Doing")
            .unwrap()
            .id;
        let new_col = app
            .ctx
            .create_column(board_id, "New".to_string(), Some(1))
            .unwrap();

        let mut snapshot = app.ctx.snapshot().unwrap();
        let doing_idx = snapshot
            .columns
            .iter()
            .position(|c| c.id == doing_id)
            .unwrap();
        let new_idx = snapshot
            .columns
            .iter()
            .position(|c| c.id == new_col.id)
            .unwrap();
        snapshot.columns.swap(doing_idx, new_idx);
        app.model.load_from_snapshot(snapshot);
        app.selection.active_board_id = Some(board_id);

        // Canonical index 2 is "New" (Doing was created first). Selecting
        // index 2 and opening rename must populate "New"'s name, not
        // "Doing"'s, regardless of the scrambled model order.
        app.focus.board_focus = BoardFocus::Columns;
        app.dialog_input.column_selection.set(Some(2));
        app.handle_rename_column_key();

        assert_eq!(app.input.as_str(), "New");
    }
}