From d44e1adba7a444b03511e9402cd39d25fe5acafe Mon Sep 17 00:00:00 2001 From: Paul Nothaft Date: Mon, 18 May 2026 21:13:03 +0200 Subject: [PATCH 1/5] fix(lightbox): hide comments toggle when allow_comments=false (#518) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Rekoo-PS reported the MessageSquare comment button stayed visible in the lightbox toolbar even when guest comments were disabled. Same class of bug as #513 (per-photo Like button missing the master gate) but on a different control. The Like and Rating buttons in the lightbox toolbar gate correctly: feedbackEnabled && feedbackSettings?.allow_likes feedbackEnabled && feedbackSettings?.allow_ratings The MessageSquare button only checked feedbackEnabled. Since likes and ratings already have their own inline buttons in the same toolbar, this third button is effectively the "open comments panel" affordance — its badge counts comments, its tooltip mentions comments. When comments are off it has nothing meaningful to do. Add allow_comments to the local feedbackSettings type (the backend already returns it via galleryFeedback.js:33) and gate the button on feedbackEnabled && feedbackSettings?.allow_comments. Refs: #518 --- frontend/src/components/gallery/PhotoLightbox.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/gallery/PhotoLightbox.tsx b/frontend/src/components/gallery/PhotoLightbox.tsx index 141c0244..1c3a5d6b 100644 --- a/frontend/src/components/gallery/PhotoLightbox.tsx +++ b/frontend/src/components/gallery/PhotoLightbox.tsx @@ -77,6 +77,7 @@ export const PhotoLightbox: React.FC = ({ feedback_enabled?: boolean; allow_likes?: boolean; allow_ratings?: boolean; + allow_comments?: boolean; require_name_email?: boolean; } | null>(null); const [myLiked, setMyLiked] = useState(false); @@ -684,8 +685,12 @@ export const PhotoLightbox: React.FC = ({ )} - {/* Feedback button with indicator */} - {feedbackEnabled && ( + {/* Feedback button with indicator. Gated on allow_comments + because likes/ratings already have their own dedicated + toolbar buttons above — this MessageSquare button only + opens the comments panel, so it has nothing to do when + comments are off (#518). */} + {feedbackEnabled && feedbackSettings?.allow_comments && (