Refine task editor layout and personal reminder defaults
Build and publish container images / images (push) Successful in 11m12s
Release container images / release (push) Successful in 17s

This commit is contained in:
Anya Tokugawa committed 2026-11-04 10:12:25 +09:00
1 parent 8fd0b6ec8b
commit a6bf3dfe41
14 files changed
+263 -26

No files matched your search

+13
View File
@@ -34,9 +34,21 @@ func defaultTask(p store.TaskPreferences, now time.Time) store.TaskRecord {
*date.target = now.AddDate(0, 0, *date.offset).Format("2006-01-02")
}
}
applyTaskReminderDefaults(&item, p)
return item
}
// Undated captures must remain possible, even when reminder defaults are on.
// Apply after date overrides, and never apply to updates of existing tasks.
func applyTaskReminderDefaults(item *store.TaskRecord, p store.TaskPreferences) {
item.NotifyDue = p.NotifyDue && item.DueOn != ""
item.NotifyPlanned = p.NotifyPlanned && item.PlannedOn != ""
item.ReminderTime = p.ReminderTime
if item.ReminderTime == "" {
item.ReminderTime = "09:00"
}
}
type taskCaptureInput struct {
RequestID string `json:"request_id"`
Title string `json:"title"`
@@ -198,6 +210,7 @@ func (s *Server) handleTaskProductivity(w http.ResponseWriter, r *http.Request,
if input.Complexity != nil {
item.Complexity = *input.Complexity
}
applyTaskReminderDefaults(&item, p)
raw, _ := json.Marshal(input)
hash := sha256.Sum256(raw)
item, err = s.store.CaptureTask(r.Context(), domain, actor, input.RequestID, hex.EncodeToString(hash[:]), item)