393b7a144a
API handlers were populating SetAttributes directly without appending to AttributeOrder. Since Apply() only iterates AttributeOrder, all updates via PUT/POST were silently dropped — causing edits to revert and tasks to disappear on reload. Adds Modifier.Set() helper, safety net in Apply()/ApplyToNew(), adds description and status to applyNonDateAttribute, and fixes the recurrence->recur key mismatch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
32 lines
909 B
Go
32 lines
909 B
Go
package engine
|
|
|
|
// ValidAttributeKeys are the recognized key:value attribute names.
|
|
// Used by parseAddArgs (cmd/add.go), ParseFilter, and ParseModifier
|
|
// to distinguish modifiers from description text.
|
|
var ValidAttributeKeys = map[string]bool{
|
|
"description": true,
|
|
"due": true,
|
|
"priority": true,
|
|
"project": true,
|
|
"recur": true,
|
|
"status": true,
|
|
"wait": true,
|
|
"scheduled": true,
|
|
"until": true,
|
|
}
|
|
|
|
// DateKeys is the subset of ValidAttributeKeys that hold date values.
|
|
// Used by Modifier.Apply and Modifier.ApplyToNew for date parsing.
|
|
var DateKeys = map[string]bool{
|
|
"due": true,
|
|
"scheduled": true,
|
|
"wait": true,
|
|
"until": true,
|
|
}
|
|
|
|
// FilterOnlyKeys are additional keys valid in filter context but not as
|
|
// modifiers (e.g., uuid is a filter target, not something you set via modify).
|
|
var FilterOnlyKeys = map[string]bool{
|
|
"uuid": true,
|
|
}
|