From 2953f435531a6be4cdf3c255bf2637d5ffb60c5a Mon Sep 17 00:00:00 2001 From: mojatter Date: Fri, 10 Apr 2026 21:59:17 +0900 Subject: [PATCH] refactor(console): Replace custom modal overlay with HTML5 dialog element MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adopt the native 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. --- server/static/style.css | 22 ++++++++-------- server/templates/buckets/objects.html | 36 ++++++++++----------------- server/templates/buckets/preview.html | 2 +- server/templates/index.html | 4 +-- 4 files changed, 28 insertions(+), 36 deletions(-) diff --git a/server/static/style.css b/server/static/style.css index 8dd87e1..c2e66ac 100644 --- a/server/static/style.css +++ b/server/static/style.css @@ -500,20 +500,22 @@ tr:hover td { } /* Preview Modal */ -.modal-overlay { - display: none; - position: fixed; - inset: 0; - background-color: rgba(0, 0, 0, 0.7); - backdrop-filter: blur(4px); - z-index: 1000; +#preview-dialog { + background: transparent; + border: none; + padding: 2rem; + max-width: 100vw; + max-height: 100vh; + width: 100%; + height: 100%; + display: flex; align-items: center; justify-content: center; - padding: 2rem; } -.modal-overlay.active { - display: flex; +#preview-dialog::backdrop { + background-color: rgba(0, 0, 0, 0.7); + backdrop-filter: blur(4px); } .modal-content { diff --git a/server/templates/buckets/objects.html b/server/templates/buckets/objects.html index cead397..eece5ec 100644 --- a/server/templates/buckets/objects.html +++ b/server/templates/buckets/objects.html @@ -129,7 +129,9 @@

{{.BucketName}}

{{if isPreviewable .Name .Length}} - +
diff --git a/server/templates/index.html b/server/templates/index.html index cbbe138..55cb775 100644 --- a/server/templates/index.html +++ b/server/templates/index.html @@ -59,8 +59,8 @@

Buckets

- + +