a block that lists every collection

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) <noreply@anthropic.com>
This commit is contained in:
2026-09-04 13:27:49 +01:00
co-authored by Claude Opus 5
parent 5da573b219
commit dde7de67aa
2 changed files with 10 additions and 4 deletions
+8 -3
View File
@@ -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'; 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. * 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 = { type Choice = {
kind: ComponentKind | null; 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: '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 }, { 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 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 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. 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: '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: '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 = ({ export const AddComponentDialog = ({
+2 -1
View File
@@ -22,6 +22,7 @@ const LABELS: Record<string, string> = {
gallery: 'Gallery', gallery: 'Gallery',
'contact-form': 'Contact form', 'contact-form': 'Contact form',
partners: 'Partners', partners: 'Partners',
collections: 'Collections',
}; };
/* /*
@@ -30,7 +31,7 @@ const LABELS: Record<string, string> = {
Both the picker and the canvas ask the same question — one to decide whether to open an editor, the 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. 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 { AddSectionDialog, type SectionLayout } from './AddSectionDialog';
import { FreeTextEditor } from './FreeTextEditor'; import { FreeTextEditor } from './FreeTextEditor';
import { SpacingEditor, type Padding } from './SpacingEditor'; import { SpacingEditor, type Padding } from './SpacingEditor';