Pieces: the Gallery, as a section like Collections

The Gallery is a flat list of peças, each with a title, a gallery of mixed
media, and the specs from the client's sitemap — measurement, raw material,
colours, and NOTAS: production time and shipping conditions.

That is a collection one level flatter, so the panel is shared rather than
copied. SubjectPanel and SubjectFields take a section config (subjects.ts);
CollectionsPanel and PiecesPanel are one line each.

The five template blocks are renamed collection-* to subject-*. They never read
anything collection-specific, and copying them per section would have meant
twenty kinds by the time Drops and Collabs land.

Called Pieces in the nav, not Gallery — there is already a Galleries section
meaning a named set of media, and two rows called Gallery and Galleries is a
question somebody has to answer every time they look at it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-04 17:44:32 +01:00
co-authored by Claude Opus 5
parent 179507fb7b
commit 5e5c06e76e
10 changed files with 498 additions and 375 deletions
+25 -1
View File
@@ -1,5 +1,5 @@
import type { LucideIcon } from 'lucide-react';
import { Boxes, Cog, Files, FolderOpen, Images, Mail, PanelsTopLeft } from 'lucide-react';
import { Boxes, Cog, Files, FolderOpen, Images, Mail, PanelsTopLeft, Shapes } from 'lucide-react';
/**
* The sections of the fofos admin, in nav order.
@@ -39,6 +39,7 @@ import { Boxes, Cog, Files, FolderOpen, Images, Mail, PanelsTopLeft } from 'luci
export type SectionKey =
| 'administration'
| 'collections'
| 'pieces'
| 'galleries'
| 'media'
| 'messages'
@@ -147,6 +148,29 @@ export const SECTIONS: Section[] = [
requires: 'connection',
pinned: true,
},
{
/*
The Gallery's pieces.
Called Pieces, not Gallery. The section on the site is Gallery and its items are peças, and there
is already a `galleries` section here meaning something else entirely — a named set of media. Two
nav rows called Gallery and Galleries, meaning a list of objects and a list of photograph sets,
is a question somebody would have to answer every time they looked at it.
Below Collections because it is the same object one level flatter, and it shares its panel — see
sections/subjects.ts.
*/
key: 'pieces',
label: 'Pieces',
icon: Shapes,
hint: 'One object each, shown in the Gallery',
path: '/fofos-admin/pieces',
built: true,
// A piece is a ROW read through the site's admin API, so this is useless without the development
// server answering. Same as Collections above it.
requires: 'connection',
pinned: true,
},
{
key: 'galleries',
label: 'Galleries',