From 27676c5b695ed46d5b0675a8331abd80c129f3e4 Mon Sep 17 00:00:00 2001 From: developist Date: Wed, 15 Apr 2026 08:31:21 -0700 Subject: [PATCH] Fix mobile lightbox sidebar overlap and add collapse setting - Fix sidebar width calculation for mobile/tablet devices to prevent image overlap - Add 'Collapse Sidebar by Default' setting in Display Settings - Fix arrow direction to be intuitive (right when open, left when closed) - Make sidebar fully slide off-screen when collapsed instead of partial visibility --- web/gallery.html | 4 +++ web/js/gallery.js | 23 +++++++++++++- web/lib/tailwind/comfyui-theme.css | 48 +++++++++++++++++++++++++++--- 3 files changed, 70 insertions(+), 5 deletions(-) diff --git a/web/gallery.html b/web/gallery.html index f33f104..4b02c1a 100644 --- a/web/gallery.html +++ b/web/gallery.html @@ -253,6 +253,10 @@

Display Settings

+
+ + +
diff --git a/web/js/gallery.js b/web/js/gallery.js index 49c927b..f1810c2 100644 --- a/web/js/gallery.js +++ b/web/js/gallery.js @@ -425,6 +425,11 @@ document.body.appendChild(sidebar); + // Apply default collapsed state from settings + if (this.getSettings().sidebarCollapsedByDefault) { + sidebar.classList.add('collapsed'); + } + // Load metadata for the current image (ALWAYS use original for metadata) const originalImageUrl = originalImage.dataset.original || originalImage.src; console.log('Loading metadata from original image:', originalImageUrl); @@ -509,9 +514,10 @@ // Create a modal that matches the screenshot design const modal = document.createElement('div'); modal.className = 'fixed inset-0 bg-black z-50 flex'; + modal.id = 'image-viewer-modal'; modal.innerHTML = ` -
+