Skip to content

fix(sql-workbench): use ConfirmDialog for Drop instead of window.confirm#32

Merged
samutpra merged 1 commit into
mainfrom
fix/sql-workbench-drop-confirm-dialog
Jul 15, 2026
Merged

fix(sql-workbench): use ConfirmDialog for Drop instead of window.confirm#32
samutpra merged 1 commit into
mainfrom
fix/sql-workbench-drop-confirm-dialog

Conversation

@samutpra

Copy link
Copy Markdown
Contributor

Summary

Fast-follow จาก PR #31 — แทน window.confirm() ใน Drop flow ด้วย <ConfirmDialog> ตาม CLAUDE.md rule #3 (ห้าม window.confirm).

  • ลบ window.confirm · rename handleDropdoDrop (drop logic ล้วน)
  • Drop button เปิด dialog (setDropConfirm(true)); drop รันเมื่อ confirm ผ่าน doDrop
  • confirmVariant="destructive", confirmText "Drop"; description โชว์ schema.name + tenant + "cannot be undone"
  • discard pending drop confirm เมื่อสลับ BU (ตรงกับ destructive-run confirm ที่มีอยู่)
  • ไม่เหลือ window.confirm ใน src/pages/sqlWorkbench/

Test plan

  • เพิ่ม test: โหลด view → คลิก Drop เปิด ConfirmDialog (ยังไม่ dropObject) → confirm ใน dialog → dropObject('T02', {view public.v_test}) ถูกเรียก
  • Full suite: 453 passing · tsc --noEmit clean

🤖 Generated with Claude Code

Replaces the window.confirm() gate in the Drop flow with the shared
<ConfirmDialog> (CLAUDE.md rule #3). The Drop button opens a dialog;
the drop runs on confirm via doDrop(). A pending drop confirm is also
discarded on a BU switch, matching the destructive-run confirm.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@samutpra
samutpra merged commit 5f9fd17 into main Jul 15, 2026
5 checks passed
@samutpra
samutpra deleted the fix/sql-workbench-drop-confirm-dialog branch July 15, 2026 01:53
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