Keep every picked card on the finished Rule, and wait for its words before Continue.

This commit is contained in:
adilallo committed 2026-11-22 17:56:38 -07:00
1 parent a846169960
commit a2815ae05f
16 files changed
+417 -114

No files matched your search

@@ -18,7 +18,10 @@ import {
type FinalReviewCategoryRowDetailed,
} from "../../../../../lib/create/buildFinalReviewCategories";
import { communityInitialsFromTitle } from "../../../../../lib/create/communityInitials";
import { finalReviewChipHasWarning } from "../../../../../lib/create/finalReviewChipWarnings";
import {
finalReviewChipHasWarning,
finalReviewMissingWordsLabels,
} from "../../../../../lib/create/finalReviewChipWarnings";
import { applyFinalReviewChipEditPatch } from "../../../../../lib/create/applyFinalReviewChipEditPatch";
import type {
TemplateChipDetail,
@@ -234,6 +237,11 @@ export function FinalReviewScreen({
const descriptionEmptyHint = t("communityContextEditModal.emptyHint");
const missingWordsLabels = useMemo(
() => finalReviewMissingWordsLabels(state),
[state],
);
const templatePath = isTemplateCreatePath(state);
const avatarUpload = useCommunityAvatarUpload();
const serverAvatarUrl = useCommunityAvatarDisplayUrl(state.communityAvatarUrl);
@@ -277,6 +285,19 @@ export function FinalReviewScreen({
: t("description")
}
>
{missingWordsLabels.length > 0 ? (
<Alert
type="banner"
status="warning"
size="m"
title={t("missingWordsWarning.title")}
description={t("missingWordsWarning.description").replace(
"{labels}",
missingWordsLabels.join(", "),
)}
hasTrailingIcon={false}
/>
) : null}
{bindingArbitrationNeedsSeparateYes(state) ? (
<Alert
type="banner"
@@ -3,6 +3,7 @@ import {
buildFinalReviewCategoryRowsDetailed,
type FinalReviewCategoryNames,
} from "../../../../lib/create/buildFinalReviewCategories";
import { finalReviewChipBlocksContinue } from "../../../../lib/create/finalReviewChipWarnings";
import type { TemplateFacetGroupKey } from "../../../../lib/create/templateReviewMapping";
import type { CreateFlowState, CreateFlowStep } from "../types";
@@ -75,8 +76,9 @@ const FINAL_REVIEW_REQUIRED_GROUPS: readonly TemplateFacetGroupKey[] = [
] as const;
/**
* Continue on final review waits for a community name and at least one card
* on each of the four questions. Skipped values do not block.
* Continue on final review waits for a community name, at least one card on
* each of the four questions, every picked card's words, and every picked
* value's meaning. Skipped values and missing signals do not block.
*/
export function isFinalReviewContinueBlocked(state: CreateFlowState): boolean {
const title = typeof state.title === "string" ? state.title.trim() : "";
@@ -85,10 +87,16 @@ export function isFinalReviewContinueBlocked(state: CreateFlowState): boolean {
state,
FINAL_REVIEW_BLOCK_NAMES,
);
return FINAL_REVIEW_REQUIRED_GROUPS.some((groupKey) => {
const missingRequiredCard = FINAL_REVIEW_REQUIRED_GROUPS.some((groupKey) => {
const row = rows.find((candidate) => candidate.groupKey === groupKey);
return !row || row.entries.length === 0;
});
if (missingRequiredCard) return true;
return rows.some((row) =>
row.entries.some((entry) =>
finalReviewChipBlocksContinue(state, entry.groupKey, entry.overrideKey),
),
);
}
/**