summaryrefslogtreecommitdiff
path: root/internal/models
diff options
context:
space:
mode:
Diffstat (limited to 'internal/models')
-rw-r--r--internal/models/atom.go16
-rw-r--r--internal/models/types.go11
2 files changed, 21 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,
}
}
-
diff --git a/internal/models/types.go b/internal/models/types.go
index aa65e18..846ce50 100644
--- a/internal/models/types.go
+++ b/internal/models/types.go
@@ -51,6 +51,17 @@ type Chain struct {
CreatedAt time.Time `json:"created_at"`
}
+// ChainSummary is a chain plus enough denormalized context (project name,
+// the currently-unlocked task, position/total) to render a single Tasks-tab
+// card without the template needing its own store access.
+type ChainSummary struct {
+ Chain Chain
+ ProjectName string
+ CurrentTask *Task // nil if the chain has no unlocked task right now
+ Position int // 1-indexed
+ Total int
+}
+
// ChainTaskInput seeds one position of a chain at creation time. Priority
// of 0 (the zero value, JSON field omitted) defaults to 1, matching
// CreateNativeTask's default.