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

@@ -29,11 +29,19 @@ import {
type FinalReviewChipEditPatch,
type FinalReviewChipEditTarget,
} from "../../components/FinalReviewChipEditModal";
import { FinalReviewCommunityContextEditModal } from "../../components/FinalReviewCommunityContextEditModal";
import { FinalReviewTitleEditModal } from "../../components/FinalReviewTitleEditModal";
import {
FinalReviewCommunityContextEditModal,
COMMUNITY_CONTEXT_FIELD_MAX_LENGTH,
} from "../../components/FinalReviewCommunityContextEditModal";
import {
FinalReviewTitleEditModal,
COMMUNITY_TITLE_FIELD_MAX_LENGTH,
} from "../../components/FinalReviewTitleEditModal";
import { useCommunityAvatarDisplayUrl } from "../../hooks/useCommunityAvatarDisplayUrl";
import { usePreviewSurfaceColor } from "../../hooks/usePreviewSurfaceColor";
import { useCreateFlowNavigation } from "../../hooks/useCreateFlowNavigation";
import { useCommunityAvatarUpload } from "../../hooks/useCommunityAvatarUpload";
import { isTemplateCreatePath } from "../../../../../lib/create/templatePath";
import { createFlowStepForFacetGroup } from "../../utils/facetGroupToCreateFlowStep";
import { isPreviewSurfaceColor } from "../../../../../lib/create/previewSurfaceColor";
import {
@@ -225,7 +233,10 @@ export function FinalReviewScreen({
const descriptionEmptyHint = t("communityContextEditModal.emptyHint");
const avatarUrl = useCommunityAvatarDisplayUrl(state.communityAvatarUrl);
const templatePath = isTemplateCreatePath(state);
const avatarUpload = useCommunityAvatarUpload();
const serverAvatarUrl = useCommunityAvatarDisplayUrl(state.communityAvatarUrl);
const avatarUrl = avatarUpload.displaySrc ?? serverAvatarUrl;
const storedFallback =
typeof state.previewSurfaceColor === "string"
? state.previewSurfaceColor
@@ -275,23 +286,73 @@ export function FinalReviewScreen({
hasTrailingIcon={false}
/>
) : null}
{templatePath ? (
<input
ref={avatarUpload.fileInputRef}
type="file"
className="sr-only"
tabIndex={-1}
accept={avatarUpload.accept}
aria-label={m.create.community.communityUpload.title}
onChange={(event) => void avatarUpload.handleFileChange(event)}
/>
) : null}
<Rule
title={ruleCardTitle}
description={ruleCardDescription}
onTitleClick={() => setTitleModalOpen(true)}
description={
templatePath ? rawCommunityContextForModal : ruleCardDescription
}
interactive={!templatePath}
hasNameField={templatePath}
nameValue={rawTitleForModal}
nameLabel={m.create.community.communityName.inputLabel}
namePlaceholder={m.create.community.communityName.placeholder}
onNameChange={
templatePath
? (value) => {
markCreateFlowInteraction();
updateState({
title: value.slice(0, COMMUNITY_TITLE_FIELD_MAX_LENGTH),
});
}
: undefined
}
onTitleClick={
templatePath ? undefined : () => setTitleModalOpen(true)
}
titleEditAriaLabel={t("titleEditModal.ariaEditTitle")}
onDescriptionClick={() => setCommunityContextModalOpen(true)}
onDescriptionClick={
templatePath ? undefined : () => setCommunityContextModalOpen(true)
}
descriptionEmptyHint={descriptionEmptyHint}
descriptionEditAriaLabel={t("communityContextEditModal.ariaEditDescription")}
descriptionLabel={m.create.community.communityContext.title}
descriptionPlaceholder={m.create.community.communityContext.placeholder}
descriptionHelperText={m.create.community.communityContext.optional}
onDescriptionChange={
templatePath
? (value) => {
markCreateFlowInteraction();
const next = value.slice(0, COMMUNITY_CONTEXT_FIELD_MAX_LENGTH);
updateState({ communityContext: next, summary: next });
}
: undefined
}
onLogoClick={
templatePath ? avatarUpload.handlePickFile : undefined
}
logoUploadAriaLabel={m.create.community.communityUpload.title}
size={mdUp ? "L" : "M"}
expanded={true}
descriptionAtBottom
backgroundColor="bg-transparent"
surfaceColor={surfaceColor}
logoUrl={avatarUrl}
logoUrl={avatarUrl ?? undefined}
logoAlt={ruleCardTitle}
communityInitials={
avatarUrl ? undefined : communityInitialsFromTitle(ruleCardTitle)
avatarUrl || templatePath
? undefined
: communityInitialsFromTitle(ruleCardTitle)
}
categories={finalReviewCategories}
className={`${CREATE_FLOW_REVIEW_RULE_LAYOUT_CLASS}${surfaceColor ? "" : " invisible"}`}
@@ -312,24 +373,28 @@ export function FinalReviewScreen({
onClose={() => setActiveReadOnlyDetail(null)}
detail={activeReadOnlyDetail}
/>
<FinalReviewTitleEditModal
isOpen={titleModalOpen}
onClose={() => setTitleModalOpen(false)}
initialValue={rawTitleForModal}
onSave={(value) => {
markCreateFlowInteraction();
updateState({ title: value });
}}
/>
<FinalReviewCommunityContextEditModal
isOpen={communityContextModalOpen}
onClose={() => setCommunityContextModalOpen(false)}
initialValue={rawCommunityContextForModal}
onSave={(value) => {
markCreateFlowInteraction();
updateState({ communityContext: value, summary: value });
}}
/>
{templatePath ? null : (
<>
<FinalReviewTitleEditModal
isOpen={titleModalOpen}
onClose={() => setTitleModalOpen(false)}
initialValue={rawTitleForModal}
onSave={(value) => {
markCreateFlowInteraction();
updateState({ title: value });
}}
/>
<FinalReviewCommunityContextEditModal
isOpen={communityContextModalOpen}
onClose={() => setCommunityContextModalOpen(false)}
initialValue={rawCommunityContextForModal}
onSave={(value) => {
markCreateFlowInteraction();
updateState({ communityContext: value, summary: value });
}}
/>
</>
)}
</CreateFlowLockupCardStepShell>
);
}