fix(goals): Start Cycle stayed disabled with every task committed #15
No reviewers
Labels
No labels
area/auth
area/backend
area/ci
area/deploy
area/e2e
area/frontend
area/shared
blocked
good-first-issue
needs-info
priority/high
priority/low
priority/medium
type/bug
type/chore
type/docs
type/feature
type/tech-debt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
celilo/lunacycle!15
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/start-cycle-disabled"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Reported on production: every task on /goals shows committed, but Start Cycle stays greyed out.
Root cause
readyToStartCyclecompared list lengths —totalTasksCount === committedTasks.length. A single duplicate entry incommittedTasksinflates the length, so the equality never holds again, while every card still renders as committed (a card's committed state is afind-by-id, which a duplicate satisfies). All green, button dead.Duplicates were easy to produce.
handleToggleCommitteddecided add-vs-remove from the render-timecommittedTasksbut wrote through a functional updater, so two toggles inside one render both saw "not committed yet" and both appended — a double-click on Commit all, or Commit all over a template task thatgetStatisticslists under two categories (possible once a task's category changes between months).handleCommitAllcompounded it by toggling task-by-task, which also un-committed anything already committed.Changes
prev, not a stale render-time copygetTaskIdsreturns record keys, which is what the cards actually toggle withbootstrap.spec.tsclicks Commit all twice and still expects Start Cycle enabled — that second click is the regression guardVerified locally:
tsc -b --noEmitclean, 52 unit tests pass. Patch changeset included.🤖 Generated with Claude Code