From 575a1b2a80f68d095faf769cc4a620e2e80fefd4 Mon Sep 17 00:00:00 2001 From: Roland Date: Wed, 15 Apr 2026 13:18:45 -0600 Subject: [PATCH] Reworking file preview buttons to be consistent across screens. --- app/src/App.css | 36 ++++++++++- app/src/Tags.js | 3 +- app/src/components/CbzViewer.js | 2 +- app/src/components/FilePreview.js | 100 +++++++++++++++--------------- app/src/components/Zim.js | 4 +- 5 files changed, 89 insertions(+), 56 deletions(-) diff --git a/app/src/App.css b/app/src/App.css index f6ee8494..4955af5e 100644 --- a/app/src/App.css +++ b/app/src/App.css @@ -122,10 +122,42 @@ input:checked + .slider:before { color: rgba(0, 0, 0, 0.85) !important; } -div.full-height { +/* File preview Modal.Actions toolbar. + Single layout that works at every viewport — buttons keep their order at any width. + On narrow screens, the tags selector wraps to its own line while the button groups stay together. */ +.preview-toolbar { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 0.5em; +} + +.preview-toolbar-group { + display: flex; + align-items: center; + gap: 0.25em; + flex: 0 0 auto; +} + +.preview-toolbar-tags { + flex: 1 1 200px; + min-width: 0; +} + +/* Caps preview content to fit inside the file-preview Modal. + 300px reserves room for pathContent
, Modal.Header, Modal.Actions row,
+   inner content (e.g. STL dimensions banner), and modal padding.
+   Use 100dvh so mobile browser chrome (URL bar) is accounted for. */
+.preview-fit {
+    width: 100%;
+    height: calc(100dvh - 300px);
+    max-height: calc(100dvh - 300px);
+    min-height: 240px;
     overflow: hidden;
-    padding-top: 100%;
     position: relative;
+    display: flex;
+    align-items: center;
+    justify-content: center;
 }
 
 td.file-path {
diff --git a/app/src/Tags.js b/app/src/Tags.js
index ffa18498..6e6fbc41 100644
--- a/app/src/Tags.js
+++ b/app/src/Tags.js
@@ -405,6 +405,7 @@ export function AddTagsButton({
                                   limit = null,
                                   disabled = false,
                                   filterByOverlap = false,
+                                  color = 'violet',
                               }) {
     // A button which displays a modal in which the user can add or remove tags.
 
@@ -556,7 +557,7 @@ export function AddTagsButton({
     return <>