From 4532403c95ad49e356bcfe3fda23a27302431c2e Mon Sep 17 00:00:00 2001 From: Valentin ROBIN Date: Tue, 25 Aug 2026 17:46:19 +0200 Subject: [PATCH] Rend les photos du Mur de la Honte cliquables pour les agrandir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ajoute une visionneuse plein écran (mur du jour, sa propre note, et l'historique complet côté Archontes). Corrige au passage un bug introduit avec l'ouverture du Mur aux Archontes (V14) : leur propre note du jour ne se rafraîchissait jamais après le chargement initial, le refetch la filtrait encore par rôle. Co-Authored-By: Claude Sonnet 5 --- src/app/mur/mur-view.tsx | 94 ++++++++++++++++++++++++++++------------ 1 file changed, 66 insertions(+), 28 deletions(-) diff --git a/src/app/mur/mur-view.tsx b/src/app/mur/mur-view.tsx index 786123f..65c2992 100644 --- a/src/app/mur/mur-view.tsx +++ b/src/app/mur/mur-view.tsx @@ -105,26 +105,31 @@ function NoteCard({ reactionCounts, myReactions, onToggleReaction, + onImageClick, }: { note: WallNoteRow; reactionCounts: Record; myReactions: Set; onToggleReaction: (emoji: string) => void; + onImageClick: (url: string) => void; }) { + const imageUrl = note.image_url; + return (
- {note.image_url && ( - + {imageUrl && ( + )}

{note.text}

@@ -165,18 +170,20 @@ export function MurView({ const [posting, setPosting] = useState(false); const [error, setError] = useState(null); const [historyDateFilter, setHistoryDateFilter] = useState("all"); + const [zoomedImage, setZoomedImage] = useState(null); const refetch = useCallback(async () => { const supabase = createClient(); const [{ data: todayNotes }, { data: myNotes }, { data: hist }, { data: counts }, { data: mine }] = await Promise.all([ supabase.rpc("wall_notes_today"), - isJudge - ? Promise.resolve({ data: null }) - : supabase - .from("wall_notes") - .select("id, text, image_url, created_at") - .order("created_at", { ascending: false }), + // Depuis V14, les Archontes peuvent aussi publier — plus de + // filtre par rôle ici non plus (sinon leur note du jour ne se + // mettait jamais à jour après le chargement initial). + supabase + .from("wall_notes") + .select("id, text, image_url, created_at") + .order("created_at", { ascending: false }), isJudge ? supabase .from("wall_notes") @@ -360,6 +367,7 @@ export function MurView({ reactionCounts={reactionCounts[note.id] ?? {}} myReactions={myReactions[note.id] ?? new Set()} onToggleReaction={(emoji) => handleToggleReaction(note.id, emoji)} + onImageClick={setZoomedImage} /> ))}
@@ -371,13 +379,20 @@ export function MurView({

Ta note d'aujourd'hui est publiée.

{myNoteToday.image_url && ( - + )}

{myNoteToday.text} @@ -482,13 +497,20 @@ export function MurView({

{note.text}

{note.image_url && ( - + )}
@@ -497,6 +519,22 @@ export function MurView({ )} )} + + {zoomedImage && ( +
+ +
+ +
+
+ )} ); }