Changed
Context
Logging a chore today means pressing Log chore (a views_add_button field), which opens the chore log form in a dialog. On a phone, during a cleaning session, that is too slow. #199 asked "How to create a log chore button that creates one without bringing up a dialog?"; this answers it.
inventory_custom already has the pattern: StickyToggleController is a GET route with a CSRF token that changes the node, then re-renders the view it was clicked in through core AJAX (or redirects back without JS).
Decisions
- Ticking a chore's checkbox creates a chore log for it, dated today, with state
done. No dialog. - Unticking it (or an Undo message) deletes that chore's log for today.
- The full log form stays available from the chore page for photos, snapshots and back-dating.
Ideas
- The new log goes through the normal storage hooks, so
ChoreLogTree::attach()joins it to a same-day log of an ancestor chore, andprocess_azwntkf/process_chorenextdueupdate the chore's last log and next due date as they do now. - Undo deletes the log the way any non-form delete does: logs beneath it are kept and move up (
ChoreLogTree::releaseChildren()), andprocess_azwntkfre-queries the latest log, so the due date reverts. - If a chore has more than one log today, untick deletes the newest.
TODO
- [ ] Route and controller in
inventory_custom(modeled onStickyToggleController): log and unlog a chore for today; access = may create / deletechore_logstorage entities. - [ ] Views field plugin rendering the checkbox (checked when the chore was logged today) with the AJAX link, usable on every dashboard list.
- [ ] Undo after a tick: either untick, or a status message with an undo link.
Done when
- On a phone, ticking a chore on the dashboard logs it without a dialog and the list refreshes in place showing it done.
- Unticking removes today's log; the chore's last log date and next due date go back to what they were.
- Ticking a sub chore after its parent was logged today attaches it under that parent's log.
- Without JavaScript the link still works and returns to the same page.