Skip setup questions on the template path and collect name, photo, and description without recommendations.

Customize opens a dialog then walks the template decks; Use without changes lands on final review with Has Name Field. Template cards stay first, the engine is not called, and the catalog no longer shows a recommended tag.
This commit is contained in:
adilallo committed 2026-11-09 17:34:33 -07:00
1 parent 53d236d0d5
commit 6498d52541
37 files changed
+1450 -733

No files matched your search

@@ -19,7 +19,6 @@ import {
getAssetPath,
vectorMarkPath,
} from "../../../../../lib/assetUtils";
import { methodSectionsPinsForHydratedSelections } from "../../../../../lib/create/publishedDocumentToCreateFlowState";
import { CREATE_ROUTES, createFlowStepPath } from "../../utils/createFlowPaths";
import { CREATE_FLOW_REVIEW_RETURN_QUERY_KEY } from "../../utils/flowSteps";
import type { CreateFlowStep } from "../../types";
@@ -83,7 +82,7 @@ export function CommunityReviewScreen() {
const lgUp = useCreateFlowLgUp();
const messages = useMessages();
const t = useTranslation("create.community.review");
const { state, updateState } = useCreateFlow();
const { state } = useCreateFlow();
/**
* Server layout has an empty context; the client layout may already hold a
* named draft. Defer empty-vs-congrats until after mount so the first paint
@@ -95,11 +94,9 @@ export function CommunityReviewScreen() {
}, []);
/**
* If the user picked **Customize** from a template before finishing community
* stage, we pinned `pendingTemplateAction` so this screen can skip itself
* and `replace` to `core-values`. **Use without changes** does not skip
* identity: if they land here with that pin, send them to `community-name`
* and leave the pin so name → description → photo stay in the skip list.
* Leftover pin from an older draft: bounce off community review onto the
* template path. Customize walks the decks; Use without changes lands on
* final review. The pin stays so decks skip the engine.
*
* Ref guard covers React 18 StrictMode's double-mount in dev so we don't
* fire `router.replace` twice on the same transition.
@@ -109,31 +106,13 @@ export function CommunityReviewScreen() {
if (firedRedirectRef.current) return;
const pending = state.pendingTemplateAction;
if (!pending) return;
if (pending.mode !== "customize") {
firedRedirectRef.current = true;
router.replace(createFlowStepPath("community-name"));
return;
}
const target = createFlowStepPath("core-values");
firedRedirectRef.current = true;
const pinMerge = {
methodSectionsPinCommitted: {
...state.methodSectionsPinCommitted,
...methodSectionsPinsForHydratedSelections(state),
},
};
updateState({ pendingTemplateAction: undefined, ...pinMerge });
router.replace(target);
}, [
router,
state.pendingTemplateAction,
state.methodSectionsPinCommitted,
state.selectedCommunicationMethodIds,
state.selectedMembershipMethodIds,
state.selectedDecisionApproachIds,
state.selectedConflictManagementIds,
updateState,
]);
router.replace(
createFlowStepPath(
pending.mode === "customize" ? "core-values" : "final-review",
),
);
}, [router, state.pendingTemplateAction]);
const cardTitle =
typeof state.title === "string" && state.title.trim().length > 0