From dde7de67aa4129aa2d0019df2ad1edb15b811e63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Fri, 4 Sep 2026 13:27:49 +0100 Subject: [PATCH] a block that lists every collection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The first block whose content is a QUERY rather than something somebody typed. It stores nothing at all: a page holding "the collections" must not also hold a copy of which collections there were, or adding one tomorrow would mean remembering to edit every page that lists them. That makes it a places-only kind alongside the contact form and the partner row — one click to add, no editor behind it. The hint says "every collection" rather than naming a picker, because there is nothing to pick. Gallery, Drops and Collabs all want the same shape. This is the one that decides it. Co-Authored-By: Claude Opus 5 (1M context) --- web/sections/AddComponentDialog.tsx | 11 ++++++++--- web/sections/PageBuilderPanel.tsx | 3 ++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/web/sections/AddComponentDialog.tsx b/web/sections/AddComponentDialog.tsx index ce3f4c2..5e21398 100644 --- a/web/sections/AddComponentDialog.tsx +++ b/web/sections/AddComponentDialog.tsx @@ -1,4 +1,4 @@ -import { Handshake, Image, Images, Mail, Type, type LucideIcon } from 'lucide-react'; +import { Handshake, Image, Images, LayoutGrid, Mail, Type, type LucideIcon } from 'lucide-react'; import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog'; /** @@ -23,7 +23,7 @@ import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/u * A kind the server would accept and this has never heard of is not creatable anyway. */ -export type ComponentKind = 'free-text' | 'media' | 'gallery' | 'contact-form' | 'partners'; +export type ComponentKind = 'free-text' | 'media' | 'gallery' | 'contact-form' | 'partners' | 'collections'; type Choice = { kind: ComponentKind | null; @@ -53,14 +53,19 @@ export const CHOICES: Choice[] = [ { kind: 'media', label: 'Media', hint: 'A photograph or a video, from the media store', Icon: Image }, { kind: 'gallery', label: 'Gallery', hint: 'A named set of media', Icon: Images }, /* - Two that place something the site already draws. + Three that place something the site already draws. Nothing to choose and nothing to type, so adding one is a single click and there is no editor behind it. They are here rather than hidden because a page is built by picking blocks, and a block somebody cannot find is a block that does not exist. + + `collections` is the first whose content is a QUERY rather than a shared list somebody maintains — + it holds nothing at all, so a collection added tomorrow appears wherever one of these sits without + anybody opening a page. The hint says "every" for that reason: it is not a selection. */ { kind: 'contact-form', label: 'Contact form', hint: 'The site\'s form, as it is', Icon: Mail }, { kind: 'partners', label: 'Partners', hint: 'The partner logos, from Site', Icon: Handshake }, + { kind: 'collections', label: 'Collections', hint: 'Every collection, as a grid', Icon: LayoutGrid }, ]; export const AddComponentDialog = ({ diff --git a/web/sections/PageBuilderPanel.tsx b/web/sections/PageBuilderPanel.tsx index 7f1718a..6d556d5 100644 --- a/web/sections/PageBuilderPanel.tsx +++ b/web/sections/PageBuilderPanel.tsx @@ -22,6 +22,7 @@ const LABELS: Record = { gallery: 'Gallery', 'contact-form': 'Contact form', partners: 'Partners', + collections: 'Collections', }; /* @@ -30,7 +31,7 @@ const LABELS: Record = { Both the picker and the canvas ask the same question — one to decide whether to open an editor, the other whether to draw an Edit button — and two lists would drift into a button that opens nothing. */ -const PLACES_ONLY: string[] = ['contact-form', 'partners']; +const PLACES_ONLY: string[] = ['contact-form', 'partners', 'collections']; import { AddSectionDialog, type SectionLayout } from './AddSectionDialog'; import { FreeTextEditor } from './FreeTextEditor'; import { SpacingEditor, type Padding } from './SpacingEditor';