Unify attention cards

This commit is contained in:
Ian Gulliver
2026-10-21 07:20:16 -07:00
parent 0d3ed1fdd3
commit e05165723d
5 changed files with 256 additions and 269 deletions
+9 -1
View File
@@ -152,7 +152,7 @@ final class Drafts {
comments[taskId] = nil
changed = true
}
for id in Set(checked.keys).union(texts.keys) where !store.inbox.contains(where: { $0.id == id }) {
for id in Set(checked.keys).union(texts.keys) where !keepsAnswer(store, id) {
checked[id] = nil
texts[id] = nil
changed = true
@@ -162,6 +162,14 @@ final class Drafts {
}
}
private func keepsAnswer(_ store: Store, _ id: String) -> Bool {
let parts = id.split(separator: ":")
if parts.first == "ready" && parts.count > 1 {
return store.findTask(String(parts[1]))?.status == .active
}
return store.inbox.contains { $0.id == id }
}
private func save() {
dirty = true
timer?.cancel()