From 18f4b4922b2859faae39728edb13024f6e180bbd Mon Sep 17 00:00:00 2001 From: Amolith Date: Fri, 19 Dec 2025 15:15:41 -0700 Subject: [PATCH] feat(types): add MotivationUnknown, doc defaults Add MotivationUnknown constant for clearing/unsetting motivation. Document default values for StatusLater, RelationshipCasualFriend, and MotivationUnknown. Clarify Eisenhower quadrant meanings and task duplicate detection constraints. Assisted-by: Claude Opus 4.5 via Crush --- tasks.go | 10 ++++++---- types.go | 10 +++++++--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/tasks.go b/tasks.go index 2b40b15a651177fdbe89e07fdcc261340e91069c..c1aea94b93816f617fa9b093b9b23d7ff7ad24b0 100644 --- a/tasks.go +++ b/tasks.go @@ -173,7 +173,8 @@ func (b *TaskBuilder) WithPriority(priority int) *TaskBuilder { return b } -// WithEisenhower sets the matrix quadrant (0–4). +// WithEisenhower sets the Eisenhower matrix quadrant: +// 0=uncategorized, 1=urgent+important, 2=urgent, 3=important, 4=neither. func (b *TaskBuilder) WithEisenhower(eisenhower int) *TaskBuilder { b.req.Eisenhower = &eisenhower @@ -203,8 +204,8 @@ func (b *TaskBuilder) FromSource(source, sourceID string) *TaskBuilder { return b } -// Create sends the task to Lunatask. Returns (nil, nil) if a duplicate exists -// with matching source/source_id. +// Create sends the task to Lunatask. Returns (nil, nil) if a not-completed +// task already exists in the same area with matching source/source_id. func (b *TaskBuilder) Create(ctx context.Context, c *Client) (*Task, error) { if b.req.Name == "" { return nil, fmt.Errorf("%w: name is required", ErrBadRequest) @@ -288,7 +289,8 @@ func (b *TaskUpdateBuilder) WithPriority(priority int) *TaskUpdateBuilder { return b } -// WithEisenhower sets the matrix quadrant (0–4). +// WithEisenhower sets the Eisenhower matrix quadrant: +// 0=uncategorized, 1=urgent+important, 2=urgent, 3=important, 4=neither. func (b *TaskUpdateBuilder) WithEisenhower(eisenhower int) *TaskUpdateBuilder { b.req.Eisenhower = &eisenhower diff --git a/types.go b/types.go index 6aaf82aa20aad13df9b94a5eb3e5277a46f309c3..e84adbeb98585180dfe91f041217f56b602fcea0 100644 --- a/types.go +++ b/types.go @@ -96,6 +96,7 @@ const ( RelationshipFamily RelationshipStrength = "family" RelationshipIntimateFriend RelationshipStrength = "intimate-friends" RelationshipCloseFriend RelationshipStrength = "close-friends" + // RelationshipCasualFriend is the default if not specified. RelationshipCasualFriend RelationshipStrength = "casual-friends" RelationshipAcquaintance RelationshipStrength = "acquaintances" RelationshipBusiness RelationshipStrength = "business-contacts" @@ -107,6 +108,7 @@ type TaskStatus string // Valid task status values. const ( + // StatusLater is the default status for new tasks. StatusLater TaskStatus = "later" StatusNext TaskStatus = "next" StatusStarted TaskStatus = "started" @@ -119,7 +121,9 @@ type Motivation string // Valid motivation values. const ( - MotivationMust Motivation = "must" - MotivationShould Motivation = "should" - MotivationWant Motivation = "want" + // MotivationUnknown clears/unsets the motivation (default). + MotivationUnknown Motivation = "unknown" + MotivationMust Motivation = "must" + MotivationShould Motivation = "should" + MotivationWant Motivation = "want" )