feat: centralize default constants and refactor overlay enter handling in TUI
This commit is contained in:
@@ -68,8 +68,9 @@ impl Tool for Todofinish {
|
||||
content = new_lines.join("\n") + "\n";
|
||||
let _ = std::fs::write(&todo_path, &content);
|
||||
if let Some(events) = &ctx.turn_events {
|
||||
let mut q = events.lock().unwrap();
|
||||
q.push_back(crate::TurnEvent::TodoUpdate(content));
|
||||
if let Ok(mut q) = events.lock() {
|
||||
q.push_back(crate::TurnEvent::TodoUpdate(content));
|
||||
}
|
||||
}
|
||||
info!(item, "TODO item completed and written back");
|
||||
} else {
|
||||
|
||||
@@ -62,8 +62,9 @@ impl Tool for Todowrite {
|
||||
let _ = std::fs::write(&todo_path, &content);
|
||||
|
||||
if let Some(events) = &ctx.turn_events {
|
||||
let mut q = events.lock().unwrap();
|
||||
q.push_back(crate::TurnEvent::TodoUpdate(content));
|
||||
if let Ok(mut q) = events.lock() {
|
||||
q.push_back(crate::TurnEvent::TodoUpdate(content));
|
||||
}
|
||||
}
|
||||
|
||||
info!(item, priority, "TODO item added");
|
||||
|
||||
Reference in New Issue
Block a user