fix(confirm-dialog): use native <dialog> + showModal for top-layer stacking (#1330)
the component used a CSS overlay with `z-index: 1000` and manual ESC /
focus-trap plumbing. while every other sheet / modal in the codebase
(AudioRevisionsSheet, LikersSheet, LogoutModal, SearchModal,
PdsMigrationModal, FeedbackModal, Toast, TermsOverlay) uses
`z-index: 9999`. opening a confirm from *inside* one of those sheets —
specifically "restore" inside the audio version-history sheet —
rendered the confirm behind the sheet, forcing the user to dismiss the
sheet before they could click confirm.
bumping the z-index to 10000 would have been whack-a-mole. using the
native <dialog> element with `.showModal()` puts the dialog in the
browser's top layer, which stacks above every other element on the
page regardless of z-index. by construction, nested modals work.
secondary benefits from switching to the platform primitive:
- focus trap, aria-modal, ESC handling all native — removed our
reimplementations
- ::backdrop pseudo-element for backdrop styling
- role="alertdialog" for semantic correctness on confirmation prompts
- oncancel handler blocks ESC-dismiss while an async confirm is in
flight (pending=true), so the user can't dismiss a pending operation
mid-run and leave parent state inconsistent with UI state
public API of the component is unchanged — both existing callsites
(replace-audio confirm + restore-revision confirm in portal/+page.svelte)
continue to pass `open={...}` one-way and manage close via `onCancel`.
Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>
authored by