summaryrefslogtreecommitdiff
path: root/internal/models/atom.go
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-07-18 00:14:45 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-07-18 00:14:45 +0000
commitf08f06bef47aac2c9effb4cec650d99c2deb2dd7 (patch)
treeae06bd2e140c678e67f2879f21b07a4114a41f73 /internal/models/atom.go
parentbe4d606e9a1f5b068abcc21bbac58d1e4705ea1f (diff)
Rework Tasks tab: Chains section, checklist modal, project visibility
The flat Tasks-tab atom list was silently dumping every chain step (locked and unlocked) and dormant bucket-pool items in as ordinary undated cards, with no chain/project context and no protection against completing a locked step out of order. - CompleteNativeTask now rejects completing a locked chain task (ErrChainTaskLocked), mapped to 400 in both the widget and web complete-atom handlers. - Chain tasks and dormant bucket items are excluded from the flat atom list; a new "Chains" section shows one card per active/paused chain with the current step and N/M progress. - New chain checklist modal (GET /chains/{id}) lists every position in order with pause/resume/abandon -- the web view originally deferred as Android-only. - Fixed a real bug this surfaced: resuming a paused chain only flipped the status flag, never unlocking the deferred successor, so a chain paused right after a completion stayed stuck forever. SetChainStatus now catches up the deferred advancement on resume, idempotently. - Atom cards gained a project-name chip for general visibility. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EZ7ikw2ukGJFTHE3bJS7zL
Diffstat (limited to 'internal/models/atom.go')
-rw-r--r--internal/models/atom.go16
1 files changed, 10 insertions, 6 deletions
diff --git a/internal/models/atom.go b/internal/models/atom.go
index bcf3c78..824faaf 100644
--- a/internal/models/atom.go
+++ b/internal/models/atom.go
@@ -36,12 +36,16 @@ type Atom struct {
Priority int // Normalized: 1 (Low) to 4 (Urgent)
+ // ProjectName is set for doot-native tasks with a project assigned
+ // (empty for every other source, and for unassigned native tasks).
+ ProjectName string
+
// UI Helpers (to be populated by mappers)
- SourceIcon string // e.g., "trello-icon.svg" or emoji
- ColorClass string // e.g., "border-blue-500"
- IsOverdue bool // True if due date is before today
- IsFuture bool // True if due date is after today
- HasSetTime bool // True if due time is not midnight (has specific time)
+ SourceIcon string // e.g., "trello-icon.svg" or emoji
+ ColorClass string // e.g., "border-blue-500"
+ IsOverdue bool // True if due date is before today
+ IsFuture bool // True if due date is after today
+ HasSetTime bool // True if due time is not midnight (has specific time)
// Original Data (for write operations)
Raw interface{}
@@ -89,6 +93,7 @@ func NativeTaskToAtom(t Task) Atom {
DueDate: t.DueDate,
CreatedAt: t.CreatedAt,
Priority: priority,
+ ProjectName: t.ProjectName,
SourceIcon: "✅",
ColorClass: "border-green-500",
Raw: t,
@@ -153,4 +158,3 @@ func GoogleTaskToAtom(t GoogleTask) Atom {
Raw: t,
}
}
-