Changed
Context
The new dashboard (#338) is driven by scheduling: a chore shows on Today only on the day it is due or scheduled, and otherwise in Upcoming or Backlog. Today the only date is field_next_due_date, which is derived (last log date + frequency) by the process_chorenextdue ECA, so there is no way to pick a day for a chore.
Pinning (sticky, toggled by the node_sticky_toggle views field and StickyToggleController in inventory_custom) currently means "needs doing" and is cleared when a log arrives. It overlaps with scheduling.
Decisions
- Add a chore date field
field_scheduled_datethat stores only a chosen day. Logging does not clear it: whether a schedule was met is derived (last log date >= scheduled date), so deleting a log (undo) reverts cleanly and no cron job is needed. This follows the "one authoritative value, derive the rest" rule indocs/sites/inventory.md. - A missed scheduled day goes back to the backlog. It does not roll over to Today.
- Pin becomes Add to Today: the same button sets
field_scheduled_dateto today (and clears it again when it is today). The 2 chores pinned now get converted to today's schedule. - No snooze.
Buckets, all derived:
- Today: scheduled = today, or next due = today, or last logged today (shown as done).
- Backlog: (next due < today or no next due) and not scheduled >= today. A Once chore that has been logged is excluded. Chores with no due date (never logged, As needed, Once not done yet) live here until they are scheduled or logged.
- Upcoming: next due > today or scheduled > today.
- Overdue: next due < today. This overlaps Backlog on purpose; it is a count and a tab.
TODO
- [ ] Add
field_scheduled_date(date only) tochore. Add it to thecontentSearch API index too, if/chores/searchshould filter on it. - [ ] Rework
NodeStickyToggle/StickyToggleControllerinto an Add to Today / Remove from Today toggle onfield_scheduled_date. Keep the CSRF token, the AJAX view refresh and the redirect when JS is off. - [ ] Update hook: set
field_scheduled_date= today on chores withsticky= 1, then clearsticky. - [ ] Remove the unpin step from
process_chorenextdueonce nothing readssticky. - [ ] Document the buckets and the new field in
docs/sites/inventory.md.
Done when
- Add to Today on a backlog chore puts it on Today, and pressing it again takes it off.
- A chore scheduled for yesterday and not logged shows in Backlog, not on Today, with no cron run in between.
- Logging a chore scheduled for today, then deleting that log, leaves it scheduled and not done for today.
stickyis 0 on every chore, and the 2 previously pinned chores are scheduled.