Skip to content

feat(web): confirm a scan delete and trap focus in modals - #677

Merged
haksungjang merged 1 commit into
mainfrom
feat/ui-destructive-confirm
Aug 14, 2026
Merged

feat(web): confirm a scan delete and trap focus in modals#677
haksungjang merged 1 commit into
mainfrom
feat/ui-destructive-confirm

Conversation

@haksungjang

@haksungjang haksungjang commented Aug 14, 2026

Copy link
Copy Markdown
Member

What changed

Deleting a scan asks for confirmation first. Both delete controls, the row
button in the scan table and the one in the top bar's scan menu, now park the
scan id and let the dialog make the call. The prompt names the scan, opens
focus on Cancel, and a confirmed delete raises a toast.

A shared Modal (components/ui/dialog.tsx) owns the focus contract: focus enters
the panel on open, Tab cycles inside it, Escape and a backdrop click close it,
and focus returns to the control that opened it. FileViewer documented a focus
trap but only handled Escape; it now uses the shared component. The wrap
arithmetic sits in lib/focus.ts as a pure function with unit tests.

There is no undo to offer: the server removes the output folder and keeps no
copy, which is why the guard goes in front of the action.

Verification

  • typecheck, token:lint, i18n:check (716 keys, en = ko), build
  • test:unit 323 passed (6 new in focus.test.ts), test:lib-gate, coverage thresholds
  • test:ui 95 passed including 5 new in dialog.spec.ts, axe run on the open dialog
  • Doc gates: coverage, links, ko-style
  • No visual baseline change expected; the snapshot job is the check

shell.spec.ts's existing delete test was updated to click through the new
confirm step.

Deleting a scan removed its output folder on a single click, from both the
scan table and the top-bar menu, and the files leave the disk with no copy
kept. Both paths now go through a confirm dialog that names the scan, opens
focus on Cancel, and reports the delete once it happens.

The prompt comes from a shared Modal that owns the focus contract: focus
enters the panel on open, Tab cycles inside it, Escape and a backdrop click
close it, and focus returns to the control that opened it. FileViewer
declared a focus trap in a comment but only handled Escape; it now uses the
shared one.
@haksungjang
haksungjang merged commit d625fef into main Aug 14, 2026
64 of 66 checks passed
@haksungjang
haksungjang deleted the feat/ui-destructive-confirm branch August 14, 2026 08:23
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