Skip to content

fix(checklist): add loading and disabled states to delete task dialog - #286

Draft
dccakes wants to merge 1 commit into
mainfrom
claude/sharp-feynman-7bkwpt
Draft

dccakes wants to merge 1 commit into
mainfrom
claude/sharp-feynman-7bkwpt

Conversation

@dccakes

@dccakes dccakes commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Daily Product Improvement

📝 TLDR

Add disabled and loading states to the delete task confirmation dialog in the checklist, matching the pattern already used by budget and expense delete dialogs.

📝 Description

The delete task AlertDialog in ChecklistPageClient was missing disabled props on both the Cancel and Action buttons during the pending mutation state, and was not calling e.preventDefault() on the action click — inconsistent with the equivalent delete flows in the budget section (CategoryCard, expense delete dialogs).

This Change

  • Disable the Cancel button while deleteTask.isPending is true, preventing the user from dismissing the dialog mid-flight
  • Disable the Action button while deleteTask.isPending is true, preventing double-submits
  • Call e.preventDefault() in the action's onClick (consistent with the budget delete pattern)
  • Show "Deleting…" text on the action button during the pending state
  • Update the test mock to expose isPending: false and add a covering test asserting the button is enabled when not pending

🧪 Testing

  • Added/updated tests
    • Unit
  • Ran full test suite
  • Manually reviewed affected component

🧪 How to test as a user

  1. Go to /checklist
  2. Click Edit on any task
  3. Click Delete task in the task dialog
  4. In the confirmation dialog: verify "Cancel" and "Confirm delete" buttons render normally (not disabled) when the mutation is idle

🎨 Style and code quality

  • Ran npm run lint — no new errors (17 pre-existing Tailwind-class-ordering warnings, all unrelated)
  • TypeScript tsc --noEmit — clean

📦 Dependencies

  • No new dependencies

Recommendations Reviewed

Area: checklist-page-client.tsx
Issue: Delete task AlertDialog missing disabled states on Cancel and Action buttons during pending mutation; no e.preventDefault() call.
Recommendation: Mirror the budget dialog pattern — e.preventDefault(), disabled={mutation.isPending} on both buttons, loading text.
Type: UX/UI
Priority: Medium
Effort: Small
→ Selected for today


Area: planning-overview.tsx — VendorsCard
Issue: isLoading not extracted from the query, so the empty state "No vendors added yet" flashes while real data loads.
Type: UX/UI
Priority: High
Effort: Small
Reason not included: PR #256 is already open for this.
Should become GitHub issue: No


Area: event-card.tsx
Issue: event.startTime && event.endTime && condition means start time never renders without end time.
Type: UX/UI
Priority: Medium
Effort: Small
Reason not included: PR #260 is already open for this.
Should become GitHub issue: No


Area: checklist-page-client.tsx — bucket headers
Issue: Collapsible bucket header buttons have no chevron indicator, unlike CategoryCard.
Type: UX/UI
Priority: Low
Effort: Small
Reason not included: PR #261 is already open for this.
Should become GitHub issue: No


Area: budget-summary.tsx — BudgetSettingsDialog
Issue: Uses manual useState for form fields instead of react-hook-form + Zod as required by the project's own guidelines.
Type: Frontend cleanup
Priority: Low
Effort: Large
Reason not included: Large refactor; touches validation logic and currency change path.
Should become GitHub issue: No (low priority, no user-facing bug)

GitHub Issues Created or Proposed

None. All unimplemented recommendations are either already tracked by open PRs or too minor to warrant separate tracking.


🤖 Generated with Claude Code

https://claude.ai/code/session_01MaVJ5pk4NcfguJH1sJPo2e


Generated by Claude Code

The delete task confirmation dialog lacked disabled states on both
Cancel and Action buttons while the mutation was pending, and did not
call e.preventDefault() to prevent double-clicks — inconsistent with
how the budget category and expense delete dialogs handle the same
pattern.

- Disable Cancel while deletion is pending
- Disable Action while deletion is pending and call e.preventDefault()
- Show "Deleting..." text on the action button during pending state
- Update test mock to expose isPending and add a covering test

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MaVJ5pk4NcfguJH1sJPo2e
@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
scv Error Error Sep 3, 2026 2:16pm UTC

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Jest Test Coverage

Coverage Summary

Lines Statements Branches Functions
Coverage: 83%
83.12% (36266/43629) 82.11% (3812/4642) 69.43% (1072/1544)

This branch had an error being deployed

1 failed deployment
Preview — 02f655f7 Deployed Sep 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant