finish the carousel rename in the panels
Two of these were live: PageBuilderPanel still compared kind === 'gallery' in two places, so a carousel block's editor and its Choose button were both dead branches. The type checker could not see them — both compare against string. The rest is copy somebody reads: "Change gallery", "Name a new gallery", "Reading the gallery", "Add to this gallery", Home's Gallery heading, and the "Create Gallery" file action, now "Carousel from folder". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -25,7 +25,7 @@ import type { SubjectPhoto, SubjectRecord, SubjectSection } from './subjects';
|
||||
*
|
||||
* ── The grid is READ-ONLY ──
|
||||
*
|
||||
* The photographs belong to the gallery, and so does their order — including which one leads, which
|
||||
* The photographs belong to the carousel, and so does their order — including which one leads, which
|
||||
* is simply the first. Making them look pressable here would promise a control that lives in
|
||||
* Carousels.
|
||||
*/
|
||||
@@ -85,7 +85,7 @@ export const SubjectPanel = <T extends SubjectRecord>({ section }: { section: Su
|
||||
);
|
||||
}, [records, selectedId, setParams, section.param]);
|
||||
|
||||
// The gallery's photographs, re-read when the selection moves. Null while nothing is chosen, so the
|
||||
// The carousel's photographs, re-read when the selection moves. Null while nothing is chosen, so the
|
||||
// empty state and "still loading" are not the same thing.
|
||||
useEffect(() => {
|
||||
if (!selectedId || !selected) {
|
||||
@@ -230,10 +230,10 @@ export const SubjectPanel = <T extends SubjectRecord>({ section }: { section: Su
|
||||
<div className="mb-4 flex flex-wrap items-center gap-2 border-b border-border pb-3">
|
||||
<Button size="sm" variant="outline" className="h-8 gap-1.5 text-xs" onClick={() => setPicking(true)}>
|
||||
<Images className="size-3.5" />
|
||||
{selected.carousel_id ? 'Change gallery' : 'Choose a gallery'}
|
||||
{selected.carousel_id ? 'Change carousel' : 'Choose a carousel'}
|
||||
</Button>
|
||||
<span className="min-w-0 flex-1" />
|
||||
{/* Deleting removes the ROW, never the photographs — they belong to a gallery, which
|
||||
{/* Deleting removes the ROW, never the photographs — they belong to a carousel, which
|
||||
belongs to Carousels. Said on the button so nobody has to find out. */}
|
||||
<Button
|
||||
size="sm"
|
||||
@@ -241,7 +241,7 @@ export const SubjectPanel = <T extends SubjectRecord>({ section }: { section: Su
|
||||
className="h-8 gap-1.5 text-xs hover:text-destructive"
|
||||
disabled={busy}
|
||||
onClick={() => void remove()}
|
||||
title={`Delete this ${section.noun}. The gallery and its photographs stay.`}
|
||||
title={`Delete this ${section.noun}. The carousel and its photographs stay.`}
|
||||
>
|
||||
<Trash2 className="size-3.5" />
|
||||
Delete
|
||||
@@ -253,20 +253,20 @@ export const SubjectPanel = <T extends SubjectRecord>({ section }: { section: Su
|
||||
<p className="text-xs text-muted-foreground">Choose a {section.noun}, or make one.</p>
|
||||
) : !selected.carousel_id ? (
|
||||
<p className="text-xs text-muted-foreground">
|
||||
No gallery yet. Choose one and its photographs appear here.
|
||||
No carousel yet. Choose one and its photographs appear here.
|
||||
</p>
|
||||
) : photos === null ? (
|
||||
<p className="flex items-center gap-2 text-xs text-muted-foreground">
|
||||
<Loader2 className="size-3 animate-spin" /> Reading the gallery…
|
||||
<Loader2 className="size-3 animate-spin" /> Reading the carousel…
|
||||
</p>
|
||||
) : photos.length === 0 ? (
|
||||
<p className="text-xs text-muted-foreground">
|
||||
That gallery is empty. Add photographs to it in Carousels.
|
||||
That carousel is empty. Add photographs to it in Carousels.
|
||||
</p>
|
||||
) : (
|
||||
<>
|
||||
<p className="mb-3 text-xs text-muted-foreground">
|
||||
{photos.length} photographs, in the gallery’s order — the first one leads.
|
||||
{photos.length} photographs, in the carousel’s order — the first one leads.
|
||||
Reorder them in Carousels.
|
||||
</p>
|
||||
<ul className="grid grid-cols-[repeat(auto-fill,minmax(9rem,1fr))] gap-3">
|
||||
|
||||
Reference in New Issue
Block a user