Reload tasks from storage, sort for display, and update the TUI.
(app: &mut TuiApp, storage: &TaskStorage)
| 176 | |
| 177 | /// Reload tasks from storage, sort for display, and update the TUI. |
| 178 | async fn refresh_task_list(app: &mut TuiApp, storage: &TaskStorage) { |
| 179 | if let Ok(tasks) = storage.list_tasks().await { |
| 180 | let mut tasks: Vec<_> = tasks.into_iter().rev().collect(); |
| 181 | sort_tasks_for_display(&mut tasks); |
| 182 | app.update_tasks(tasks); |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | /// Process a server event, updating app state accordingly. |
| 187 | async fn process_server_event(app: &mut TuiApp, event: &ServerEvent, storage: &TaskStorage) { |
no test coverage detected