Skip to content

feat(chores): routine card button completes the whole routine while steps remain - #380

Merged
jherforth merged 2 commits into
jherforth:mainfrom
adamecker:feature/routine-complete-all
Nov 6, 2026
Merged

jherforth merged 2 commits into
jherforth:mainfrom
adamecker:feature/routine-complete-all

Conversation

@adamecker

Copy link
Copy Markdown
Contributor

feat(chores): routine card button completes the whole routine while steps remain

Summary

A routine's card used to show a faint up-chevron while steps were still to do, and that button did nothing until the routine was finished — it only folded the steps away and back. That was confusing at the top level of the card: a control that looks tappable but is inert.

Now the button always does something: while any step remains, it is a check button that marks the whole routine done; once finished, it goes back to folding the steps away and back.

What it includes:

  • Complete-all button. An unfinished routine shows a check button ("Mark all of {{name}} done"). Tapping it ticks each remaining step through the normal step-tick path, so the last tick completes the chore exactly as if each step had been tapped by hand — streak and on-time are computed the same way. There is no separate force-complete path.
  • Fold button once finished. A finished routine keeps the expand/collapse button as before: the card folds to just the streak and on-time chips, and a parent can open the steps to look them over. Unticking a step in the opened list reopens the routine with the other ticks kept.
  • Expired routines ask a parent once. Past a routine's end time plus its expiry, the complete-all button still works, but it ticks nothing until a parent approves — one "Too late… mark it done anyway?" approval for the whole routine, not one per step. That mirrors the existing single-step expired flow, so the parental gate is never bypassed.

Screenshots (demo data):

Unfinished routine shows the check button instead of the faint chevron:
Unfinished routine with the complete-all check button

Tapping it completes all steps; the card folds to the finished state with streak and on-time chips:
Finished routine after tapping complete-all

Unticking one step reopens the routine with the other ticks kept:
Routine reopened after unticking one step

The finished card's button still folds the steps away and back:
Finished routine with steps unfolded

Expired routine: complete-all asks a parent once before ticking anything:
Expired routine with the parent-approval prompt
Parent approval dialog for the expired routine

Verified with the client test suite green (routineSteps 8/8, full client suite 970 tests, i18n check passing) and an end-to-end pass covering: unfinished card shows the enabled check button; one tap completes all steps and folds the card to the finished chips; unticking a step reopens it with the other ticks kept; the finished button folds and unfolds the steps; an expired routine asks a parent once and completes only after approval.

Generated with Muse AI 🤖

…teps remain

The card's fold button was inert until a routine finished, showing a faint
chevron on an unfinished routine. It now completes the whole routine at once
(ticking each remaining step through the normal step path, so the last tick
completes the chore with the usual streak/on-time semantics), and folds the
steps once finished. Past expiry, one parent approval covers all remaining
steps (issue jherforth#279).
@jherforth

Copy link
Copy Markdown
Owner

This conflicts with @mrramam merged #374. A universal complete action for the entire routine was removed.

@mrramam

mrramam commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

I'm okay with it. I mostly didn't want to ruin the timestamp on a routine when expanding it to examine it.

@mrramam

mrramam commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

One small thing: the two approve callbacks in completeRoutine return quietly when tickRemainingSteps gives false or 'expired'. The approval dialog only shows approveFailed when the callback throws, so a failed approval closes as if it worked and the routine stays open. tickRoutineStep throws Not approved there; doing the same here would match it.

Nit: the celebration could check done.completed, as tickRoutineStep checks after?.completed.

Both approve callbacks in completeRoutine returned quietly when
tickRemainingSteps gave false or 'expired', so a failed approval
closed as if it worked and the routine stayed open. They now throw
'Not approved' (matching tickRoutineStep), so the dialog shows
approveFailed, and the celebration checks done.completed.

Addresses mrramam's review on jherforth#380.
@adamecker

Copy link
Copy Markdown
Contributor Author

@mrramam Good catch — fixed in ba46cf0. Both approve callbacks in completeRoutine now throw Not approved when tickRemainingSteps gives false or 'expired', so a failed approval shows approveFailed instead of closing as if it worked. The celebration now checks done.completed too, matching tickRoutineStep. Added tests covering the throw on both failure paths.

@jherforth jherforth added the enhancement New feature or request label Nov 6, 2026
@jherforth jherforth added this to the 2.0 milestone Nov 6, 2026
@jherforth
jherforth merged commit aff288f into jherforth:main Nov 6, 2026
3 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in HomeGlow Kanban Nov 6, 2026
jherforth added a commit to adamecker/HomeGlow that referenced this pull request Nov 6, 2026
ChoreWidget.jsx: keep jherforth#382's removal of the ChoreIconPicker import (the
picker is in ChoreFormDialog now) and jherforth#380's routine imports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adamecker pushed a commit to adamecker/HomeGlow that referenced this pull request Nov 7, 2026
…rforth#382, jherforth#384) and origin/test/all-combined into test/all-combined

Upstream: Stacks/display Modes/takeovers (jherforth#378), routine complete-all
(jherforth#380), mirror re-measure (jherforth#381), shared New Chore dialog (jherforth#382), admin
PIN chooses the mode helper (jherforth#384). Fork side: Open-Meteo provider,
precipitation probability, bonus-chore return to pool, Google Tasks
no-due-date fix, dock-hide-on-dialog, HA panel test seed.

Conflicts (fork's jherforth#380/jherforth#382 branches vs upstream's merged versions):
took upstream's refinements (scheduleOnly, tickRemainingStepsOrThrow);
app.jsx combines both (dock stays hidden while dragging is false and a
dialog is open).

Auto-seed now strips the HA mode-helper link from seeded settings, so a
new display never inherits another display's helper (jherforth#384: only the
admin PIN chooses it). The Stacks tests pre-create their devices in
before(), while no device has widgets yet, so auto-seed leaves them
empty.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants