From ad988e4557175952d1a2c86e3f764fe8fcba4c31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Fri, 4 Sep 2026 14:34:27 +0100 Subject: [PATCH] the first photograph leads, and nothing says so twice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A collection named its own main picture. A gallery is already ORDERED — somebody drags it into the sequence they want — so "which one leads" was being answered twice, in two screens, by two mechanisms that could disagree. Reordering a gallery and then wondering why the card had not changed was a bug waiting to be filed. So the grid here decides nothing at all. It is what the collection SHOWS, in the gallery's order, and the pictures are no longer buttons: making them look pressable would promise a control that lives in another screen. Adding, reordering and framing all belong to Galleries, and now so does this. The `cover` column is gone from both databases. Co-Authored-By: Claude Opus 5 (1M context) --- web/sections/CollectionsPanel.tsx | 50 ++++++++----------------------- web/sections/collections.ts | 2 -- 2 files changed, 13 insertions(+), 39 deletions(-) diff --git a/web/sections/CollectionsPanel.tsx b/web/sections/CollectionsPanel.tsx index 458409c..f2c0aed 100644 --- a/web/sections/CollectionsPanel.tsx +++ b/web/sections/CollectionsPanel.tsx @@ -1,6 +1,6 @@ import { useCallback, useEffect, useRef, useState } from 'react'; import { useSearchParams } from 'react-router'; -import { Boxes, Check, Images, Loader2, Plus, Trash2 } from 'lucide-react'; +import { Boxes, Images, Loader2, Plus, Trash2 } from 'lucide-react'; import { useClient } from 'hooks/useClient'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; @@ -176,14 +176,6 @@ export const CollectionsPanel = () => { await clientRef.current.patch(`/fofos-admin/collections/${selected.id}`, { gallery_id: galleryId }); }); - const chooseCover = (path: string) => - send(async () => { - if (!selected) return; - // Pressing the one already chosen clears it, which is how "no choice, use the first" is reachable - // again without a second control that only does that. - await clientRef.current.patch(`/fofos-admin/collections/${selected.id}`, { - cover: selected.cover === path ? null : path, - }); }); @@ -279,36 +271,20 @@ export const CollectionsPanel = () => { ) : ( <>

- {photos.length} photographs, in the gallery’s order. Click one to make it the main photo. + {photos.length} photographs, in the gallery’s order — the first one leads. Reorder + them in Galleries.

+ {/* Not buttons. Nothing here is a decision — the order is the gallery's and so is which one + leads. Making them look pressable would promise a control that lives elsewhere. */} )} diff --git a/web/sections/collections.ts b/web/sections/collections.ts index 7e42164..8d24426 100644 --- a/web/sections/collections.ts +++ b/web/sections/collections.ts @@ -5,8 +5,6 @@ export type Collection = { gallery_id: number | null; title: string; slug: string | null; - /** A media PATH, the same string a gallery item holds — see the site's schema. */ - cover: string | null; description: string | null; descriptive_text: string | null; measurement: string | null;