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:
@@ -162,7 +162,7 @@ export const PageBuilderPanel = () => {
|
||||
const [choosing, setChoosing] = useState<{ sectionId: number; column: number } | null>(null);
|
||||
/** The component being written, and where a new one would go. Null when the dialog is shut. */
|
||||
/*
|
||||
Which gallery a block shows, while it is being chosen.
|
||||
Which carousel a block shows, while it is being chosen.
|
||||
|
||||
The same shape as `picking` and for the same reason: choosing a set is one act with one outcome, so
|
||||
there is nothing to draft and nothing to cancel out of afterwards. `carouselId` rides along so
|
||||
@@ -274,7 +274,7 @@ export const PageBuilderPanel = () => {
|
||||
|
||||
The effect below cannot do that job: bumping `rendered` runs it immediately, while `frameDoc` still
|
||||
points at the outgoing document — so it scrolled the page that was about to be replaced, and the
|
||||
new one arrived at the top. Every write from the editor did that: reorder a gallery, lose your
|
||||
new one arrived at the top. Every write from the editor did that: reorder a carousel, lose your
|
||||
place.
|
||||
*/
|
||||
const partRef = useRef<string | null>(part);
|
||||
@@ -474,7 +474,7 @@ export const PageBuilderPanel = () => {
|
||||
with one outcome, so there is nothing to draft and nothing to cancel out of afterwards.
|
||||
|
||||
Photograph or video is not asked. The file already knows, and the site reads it off the extension
|
||||
the way a gallery item always has — a kind stored here would be a second answer able to disagree.
|
||||
the way a carousel item always has — a kind stored here would be a second answer able to disagree.
|
||||
*/
|
||||
const saveVideo = async (url: string) => {
|
||||
if (!page || !picking) return;
|
||||
@@ -494,7 +494,7 @@ export const PageBuilderPanel = () => {
|
||||
};
|
||||
|
||||
/*
|
||||
A gallery block is a REFERENCE, saved as soon as the set is chosen — see CarouselPicker.
|
||||
A carousel block is a REFERENCE, saved as soon as the set is chosen — see CarouselPicker.
|
||||
|
||||
Identical in shape to saveVideo because it is the same interaction: pick one thing, store one
|
||||
value. The two are left as two functions rather than one generic saver, because what they store
|
||||
@@ -589,7 +589,7 @@ export const PageBuilderPanel = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (component.kind === 'gallery') {
|
||||
if (component.kind === 'carousel') {
|
||||
const held = owner.components.find((one) => one.id === component.id)?.content?.carouselId;
|
||||
setChoosingCarousel({
|
||||
id: component.id,
|
||||
@@ -793,7 +793,7 @@ export const PageBuilderPanel = () => {
|
||||
*/}
|
||||
{block.kind === 'partners' && <PartnersEditor onChanged={() => setRendered((n) => n + 1)} />}
|
||||
|
||||
{block.kind === 'gallery' && (
|
||||
{block.kind === 'carousel' && (
|
||||
<div className="flex flex-col gap-3">
|
||||
<Button
|
||||
size="sm"
|
||||
@@ -801,13 +801,13 @@ export const PageBuilderPanel = () => {
|
||||
className="h-8 self-start text-xs"
|
||||
onClick={() => handlersRef.current.editComponent(block)}
|
||||
>
|
||||
Choose gallery…
|
||||
Choose carousel…
|
||||
</Button>
|
||||
|
||||
{/*
|
||||
The gallery's own contents, here rather than a link to the Carousels section.
|
||||
The carousel's own contents, here rather than a link to the Carousels section.
|
||||
|
||||
A gallery block on a page IS a gallery, and being sent elsewhere to reorder it means
|
||||
A carousel block on a page IS a carousel, and being sent elsewhere to reorder it means
|
||||
losing the page you were arranging it for. `onChanged` reloads the frame, because the
|
||||
page draws this set and has just been given a different one.
|
||||
*/}
|
||||
|
||||
Reference in New Issue
Block a user