From 528b7004e320f0332b533da518741e827bbece20 Mon Sep 17 00:00:00 2001 From: Masahiko AMANO Date: Mon, 6 Jul 2026 22:36:16 +0300 Subject: [PATCH] fix(frontend): open original only when tapping the preview image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The preview area was one big link, so a click anywhere in it — including the black letterbox margins — opened the original. Make the link pointer-events:none and re-enable pointer-events on the image itself, so "open original" fires only on the image, not the surrounding margins. Co-Authored-By: Claude Opus 4.8 --- frontend/src/lib/components/file/FileViewer.svelte | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/file/FileViewer.svelte b/frontend/src/lib/components/file/FileViewer.svelte index d49eec3..7bfbcfa 100644 --- a/frontend/src/lib/components/file/FileViewer.svelte +++ b/frontend/src/lib/components/file/FileViewer.svelte @@ -760,15 +760,17 @@ overflow: hidden; } - /* Whole preview area is a link: click opens the original in a new tab. */ + /* The link fills the area for centring, but only the image itself is + clickable (pointer-events below) — tapping the black margins does nothing, + so "open original" fires only on the preview. */ .preview-link { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; - cursor: zoom-in; text-decoration: none; + pointer-events: none; } .preview-img { @@ -776,6 +778,8 @@ max-height: 100%; object-fit: contain; display: block; + cursor: zoom-in; + pointer-events: auto; /* only the image opens the original */ } .preview-busy {