fix: taskpanel savetask fix #256
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
track:api
track:auto
track:core
track:deploy
track:infra
track:ui
v0.1.0
v0.1.1
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
barrettruth/delta!256
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "savetask-bug"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Root cause:
In task-panel.tsx's saveTask, the due field is always
re-sent on every save — including the implicit save that fires on
popover close (the cleanup effect at useEffect(... if (!isOpen)
return; return () => void saveTask(id) ...)).
The due value in the form starts as t.due.slice(0, 16) — a string
like "2026-04-20T00:00" with no timezone suffix. On save it
round-trips through:
due: f.due ? new Date(f.due).toISOString() : null
Fix:
(src/components/task-panel.tsx)
• Snapshot the initial due string in initialDueRef when the form
loads (both edit and create modes).
• In saveTask, only include due in the update payload if the form
value actually differs from that snapshot.
Explanation:
This way, opening and closing the popover without touching the date
field is a no-op for due, so the event stays put. Real user edits to
due still go through normally.