Skip to content

frontend: replace alert() with Toast (#1718)#1722

Merged
sohni-tagirisa merged 1 commit into
epic/frontend-ui-polishfrom
fix/1718-toast
Jun 23, 2026
Merged

frontend: replace alert() with Toast (#1718)#1722
sohni-tagirisa merged 1 commit into
epic/frontend-ui-polishfrom
fix/1718-toast

Conversation

@sohni-tagirisa

Copy link
Copy Markdown
Collaborator

What

Replace all 7 native alert() calls in pdd/frontend/App.tsx with the existing addToast() API. Sub-PR of EPIC #1720targets epic/frontend-ui-polish, not main.

Why

alert() is an unbranded, page-blocking OS dialog. The app already has a Toast system (useToast / addToast, destructured at App.tsx:82 and used ~20 times nearby). These 7 sites were the last hold-outs.

Mapping

All 7 are blocking error/validation conditions, so each becomes addToast(msg, 'error', 5000) — consistent with the existing addToast('Error: …', 'error', 5000) pattern:

  • "Server not connected…" guard — 4 sites (run / bug / fix / change handlers)
  • "Please enter a GitHub issue URL" — bug + change handlers
  • "Please enter a GitHub PR URL" — fix handler

Out of scope (intentionally untouched)

The 4 window.confirm() stale-session dialogs stay — they need a yes/no return value a toast can't provide.

Verification

  • 0 alert() calls remain in App.tsx
  • 4 window.confirm() dialogs preserved
  • npm test (vitest) — 54 passed / 12 files

Closes #1718

🤖 Generated with Claude Code

Swap all 7 native alert() calls in App.tsx for the existing addToast()
API (type 'error', 5000ms), matching the surrounding toast usage. Covers
the 'Server not connected' guard (4x) and the missing-URL validations in
the bug/fix/change handlers. window.confirm() stale-session dialogs are
left as-is since they require a yes/no return a toast cannot provide.

Closes #1718

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@sohni-tagirisa sohni-tagirisa self-assigned this Jun 23, 2026
@sohni-tagirisa sohni-tagirisa merged commit c275490 into epic/frontend-ui-polish Jun 23, 2026
0 of 2 checks passed
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