fix(alerts): show a delete failure after its confirmation dialog is dismissed

Aperta
#369 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
62/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
nextjs, playwright, react, typescript
Ambito
frontend

Direzione di ricerca

Start in src/components/alerts/confirm-delete.tsx, around the DialogError render (line 87) and the DialogCloseButton cancel (line 93), and read the #367 fix in src/components/connections/connection-controls.tsx (ConfirmDialog, ConfirmForm) to see how the form reports through a ref whether it is still mounted in an open dialog. Then read e2e/connections.spec.ts for the page.route hold-dismiss-release pattern before editing e2e/alert-rules.spec.ts. Done looks like: failure shown beside the Delete button in an assertive live region after dismissal, shown in the reopened dialog when applicable, still in-dialog only while open, with the new e2e case passing under safe-e2e.sh plus typecheck and lint.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area: alerts bug priority: P2 size: XS

Context

The same defect as #367, in the alerts delete confirmation. ConfirmDeleteForm in src/components/alerts/confirm-delete.tsx shows a failure only through DialogError inside the dialog (line 87). Its Cancel button (DialogCloseButton, line 93) stays enabled while the confirm button reads "Deleting", and Escape closes the dialog as well. The form stays mounted, so the action finishes, and a failure that arrives after the dialog closed lands in the hidden dialog. Nothing is shown or announced.

Found by the Fable review of #368 (review round 1), which fixed the connections dialogs only.

Plan

  • Follow the #367 fix in src/components/connections/connection-controls.tsx (ConfirmDialog and ConfirmForm). The confirmation reports whether it is still mounted in an open dialog, read through a ref on its form. When it is not, ConfirmDelete shows the failure beside its button, and also passes it to the open dialog's DialogError when a reopen replaced the confirmation, because the page behind an open modal is inert.
  • Cover it in e2e/alert-rules.spec.ts the way e2e/connections.spec.ts covers #367: hold the server action with page.route, dismiss, release, and expect the failure beside the button. Include the reopened case.

Acceptance criteria

  • Dismissing an alert rule or budget delete dialog while it reads "Deleting", then the delete failing, shows the failure beside the Delete button in an assertive live region.
  • Reopening the dialog before the failure arrives shows it in the reopened dialog, focused and announced, and beside the button once the dialog closes.
  • A failure while the dialog is open still shows only inside it (expectFailureInDialog checks this).
  • Playwright e2e coverage added for the dismissed case.

Files and areas

  • src/components/alerts/confirm-delete.tsx
  • e2e/alert-rules.spec.ts
  • Non-goals: the connections dialogs (#367), projects and public metrics dialogs.

Verification

  • safe-e2e.sh on e2e/alert-rules.spec.ts
  • npm run typecheck, npm run lint

Model: anthropic/claude-opus-5-5 | Reasoning effort: high

Lingua principale
TypeScript
Stelle
1
Fork
1
Merge medio
6h 56m
PR unite (30g)
136

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di eddiejaoude/StackDash

Tutte le issue di eddiejaoude/StackDash

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.