Skip to content

refactor(chores): one shared New Chore dialog for admin and widget - #382

Merged
jherforth merged 4 commits into
jherforth:mainfrom
adamecker:feature/chores-widget-full-dialog
Nov 6, 2026
Merged

jherforth merged 4 commits into
jherforth:mainfrom
adamecker:feature/chores-widget-full-dialog

Conversation

@adamecker

Copy link
Copy Markdown
Contributor

What this changes

The Chores widget's Add Chore button opened a create-only form, while Admin → New Chore opened the full schedule flow — two dialogs for the same chore, with the widget one unable to set follow-ups or assign multiple people.

  • One shared ChoreFormDialog component is now used by both the widget and Admin, so both open the identical dialog: title, description, clam value, icon, follow-ups, and Cancel/Create/Schedule.
  • The widget's Add Chore now opens the full schedule flow (who it's for, schedule, follow-ups) instead of the create-only form.
  • Editing a chore loads its saved follow-ups into the dialog.
  • New choreFollowups.js helper with tests; ChoreSchedulesTab.jsx and ChoreWidget.jsx use the shared dialog.

Testing

Tested end to end with demo data:

  • Widget Add Chore opens the shared dialog; filling it and choosing Schedule walks the full schedule flow, with multiple people picked.
  • Admin → New Chore opens the identical dialog.
  • Full client suite: 89 files, 977 tests pass; vite build passes.

Screenshots

Widget Add Chore opening the shared dialog:

Widget Add Chore opening the shared dialog

Schedule flow with multiple people picked:

Schedule flow with multiple people picked

Admin → New Chore, the identical dialog:

Admin New Chore, the identical dialog

Generated with Muse AI 🤖

adamecker added 2 commits November 5, 2026 17:29
The dashboard widget baked in one fixed schedule (one person, weekly
days or one-time, no due date, no duration). Add now creates the chore,
then opens ScheduleChoreDialog — the Admin → Chores flow — so it can
do every-N-days, monthly, any-day, repeat-after-completion,
keep-until-completed, several people, and joining an existing schedule,
all through the same schedulePayload save path. The widget's
usage=chart schedule list leaves out the sticky durations, so the
dialog gets the full list for its join-an-existing-schedule section.

Tests: schedulePayload cases pin the 2026-10-05 once-completed case
(null crontab + due date) and repeat-after-completion.
The widget's Add Chore opened its own lookalike identity dialog while
Admin → Chores' New Chore button opened the real one (title, description,
clam value, icon, follow-ups, Create and Schedule). The widget's copy had
no follow-ups section, no Create-only path, no follow-up validation or
save, and no error feedback on a failed save.

Extract the admin dialog into ChoreFormDialog.jsx, used by both entries,
with the follow-up row/rule helpers in utils/choreFollowups.js (pure, so
tested). The tab keeps only which chore is edited and whether to offer
Schedule; the widget passes its non-routine chores and users, refreshes
with fetchData, and opens ScheduleChoreDialog for a chore saved with
Schedule. No layout change, no behaviour change on either path.
@jherforth

Copy link
Copy Markdown
Owner

Good catch!

@jherforth jherforth added the bug Something isn't working label Nov 6, 2026
@jherforth jherforth added this to the 2.0 milestone Nov 6, 2026
jherforth and others added 2 commits November 6, 2026 12:36
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>
On the dashboard a chore with no schedule never shows, and the widget has
no toast, so Create (or Enter in the title) saved a chore that seemed to
vanish, and a parent would add it again. ChoreFormDialog takes
scheduleOnly: Create is hidden and Enter does what Schedule does. Admin's
dialog keeps Create and Schedule as before.

Also drops chores:add.* from both locales, the old widget form's strings,
no longer used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jherforth
jherforth merged commit 811c9b7 into jherforth:main Nov 6, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in HomeGlow Kanban Nov 6, 2026
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

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants