Repository navigation
feat(tasks): ask who did a task worth points, and give the points to them - #418
Merged
Merged
Conversation
…them A task's points went to its assignee or to whoever's turn it was, so a child who took a sibling's turn earned the sibling the points. Ticking a task worth points on the tasks page or the Tasks widget now asks who did it. - migration_zzzzzzzzzzzzz_todo_done_by.sql: todos.done_by is an argument sent with a tick. A trigger that runs after todos_schedule_update reads it, records it in todos.last_completed_by, todo_occurrences.completed_by and the task log, and clears it, so a later tick from Home Assistant or an assistant never inherits it. record_todo_points pays whoever did it, else the assignee or turn as before; children only, as before. - DoneByPicker (lib/done-by.ts): asked only for a tick worth points in a family of more than one; whoever the task is for comes first. Un-ticking never asks. - The cheering creature is the doer's. A repeating task shows who last did it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01STyQ3UYK3VBFvcZ3Je5jCr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A task's points always went to its assignee, or to whoever's turn it was. When Jonas takes Mira's turn at the dishes, Mira gets the points and her creature cheers. Ticking a task worth points on the tasks page or the Tasks widget now asks "Who did it?", and the person picked gets the points. The idea comes from Yuvomi's wall-display picker.
Database (
migration_zzzzzzzzzzzzz_todo_done_by.sql). Every client ticks through PostgREST, so this lives in the triggers, like points and turns do.todos.done_byis an argument sent with the tick. A new BEFORE UPDATE trigger,todos_zz_done_by, reads it and then clears it, so it is NULL again after every update. That means a later tick from Home Assistant or an assistant never inherits the previous answer.todos_schedule_update, so it only records ticks that actually took. A second tick on a day that is already done changes nothing.todos.last_completed_by, which only the trigger sets; an edit can't change it.todo_occurrences.completed_by, next toperson_id(whose turn it was).detail.done_byon the task-log entry.record_todo_pointsis replaced. It now pays the person who did it, or the assignee or turn person as before. Only children get points, as before, so a parent doing the chore earns nobody points.done_by.UI
DoneByPicker(lib/done-by.ts) only appears for a tick worth points, in a family with more than one person. Order: whoever the task is for, then the other children, then adults. One tap ticks the task; closing the dialog leaves it unticked. Un-ticking never asks.detectTaskTick).Not in this PR: a
done_byfield on the Integration API and MCP tools, so assistants can say "Jonas did the dishes"; and showing who did each day in the history strip. Both would build on these columns.Type of change
Test plan
e2e/todo-done-by.spec.ts: when the picker asks, the order, un-ticking never asks, which creature cheers, and the migration's invariantse2e/todo-done-by-db.spec.ts(live database, added toe2e.yml):todo-turns-db.spec.tsre-applies the older function it replaces.todo-done-by-db: 4/4todo-turns-db: 13/13 still greenpoint-adjustments-dbandfamily-delete-db: greendocker execthat forwards to the local database, since there was no Docker daemon.npm run lint,npx tsc --noEmitand the changelog check pass.Screenshots
None. The dialog reuses the existing
DialogandPersonAvatarcomponents: a grid of large name buttons, 96px tall.Checklist
npm run lintpassesmessages/en.jsonandmessages/de.json(and fr)webapp/docker/migration*.sqlfile (idempotent:IF NOT EXISTS,CREATE OR REPLACE)CHANGELOG.mdupdated under[Unreleased](Added)Generated by Claude Code