Skip to content

refactor(console): Replace custom modal with HTML5 dialog element#53

Merged
mojatter merged 1 commit intomainfrom
refactor/dialog-preview
Apr 10, 2026
Merged

refactor(console): Replace custom modal with HTML5 dialog element#53
mojatter merged 1 commit intomainfrom
refactor/dialog-preview

Conversation

@mojatter
Copy link
Copy Markdown
Owner

@mojatter mojatter commented Apr 10, 2026

Summary

  • Replace the custom div.modal-overlay with the native <dialog> element for the preview modal.
  • Eliminate openPreview, closePreview, and previewKeyHandler JS functions — Escape-to-close and backdrop overlay are now handled natively by the browser.
  • Preview buttons switch from onclick to hx-get with hx-target="#preview-dialog", and htmx:afterSettle calls showModal() after the swap completes.

Test plan

  • go test ./... passes
  • golangci-lint run ./... clean
  • Manual: click preview button in list view opens modal
  • Manual: click preview in gallery view opens modal
  • Manual: Escape key closes modal
  • Manual: clicking backdrop closes modal
  • Manual: close button (x) closes modal

…ment

Adopt the native <dialog> element for the preview modal, replacing
the div.modal-overlay with JS-driven show/hide. This eliminates
openPreview, closePreview, and previewKeyHandler functions entirely
— Escape-to-close is now handled by the browser natively, and the
backdrop uses the ::backdrop pseudo-element.

Preview buttons switch from onclick to hx-get with hx-target, and
htmx:afterSettle calls showModal() after the swap completes.
@mojatter mojatter merged commit 12a5916 into main Apr 10, 2026
2 checks passed
@mojatter mojatter deleted the refactor/dialog-preview branch April 10, 2026 14:43
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