feat: add todo management feature; implement todo content tracking and display in the UI
This commit is contained in:
@@ -303,6 +303,20 @@ pub fn apply_action(state: &mut AppStateRest, action: Action) {
|
||||
state.misc.tick_count = state.misc.tick_count.wrapping_add(1);
|
||||
let now_ms = chrono::Utc::now().timestamp_millis();
|
||||
state.misc.drain_expired_toasts(now_ms);
|
||||
|
||||
if state.misc.tick_count.is_multiple_of(10) {
|
||||
let todo_path = state.session_dir.join("todo.md");
|
||||
if let Ok(content) = std::fs::read_to_string(&todo_path) {
|
||||
if content != state.misc.todo_content {
|
||||
state.misc.todo_content = content;
|
||||
state.dirty = true;
|
||||
}
|
||||
} else if !state.misc.todo_content.is_empty() {
|
||||
state.misc.todo_content.clear();
|
||||
state.dirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Background API connectivity check — runs on a background thread
|
||||
// every ~1s while disconnected, every ~30s while connected, so the
|
||||
// status bar reflects real API availability without user input.
|
||||
|
||||
Reference in New Issue
Block a user