Cleanup pass

This commit is contained in:
adilallo
2026-04-29 21:18:36 -06:00
parent 7fde82a94c
commit a31a36c926
9 changed files with 103 additions and 121 deletions
+8 -2
View File
@@ -135,8 +135,14 @@ function CreateFlowLayoutContent({
} = useCreateFlowNavigation(
skipCommunitySave ? { skipCommunitySave: true } : undefined,
);
const { state, clearState, updateState, resetCustomRuleSelections, setMethodSectionsPinCommitted, replaceState } =
useCreateFlow();
const {
state,
clearState,
updateState,
resetCustomRuleSelections,
setMethodSectionsPinCommitted,
replaceState,
} = useCreateFlow();
const { draftSaveBannerMessage, setDraftSaveBannerMessage } =
useCreateFlowDraftSaveBanner();
const [communitySaveMagicLinkSubmitting, setCommunitySaveMagicLinkSubmitting] =
@@ -5,13 +5,14 @@ import { buildTemplateCustomizePrefill } from "../../../../lib/create/applyTempl
import { loadTemplateReviewBySlug } from "../../../../lib/create/loadTemplateReviewBySlug";
import { stripCustomRuleSelectionFields } from "../../../../lib/create/stripCustomRuleSelectionFields";
import messages from "../../../../messages/en/index";
import type { CreateFlowState } from "../types";
import type {
CreateFlowContextValue,
CreateFlowState,
} from "../types";
type AppRouterLike = { push: (_href: string) => void };
type UpdateState = (_patch: Partial<CreateFlowState>) => void;
type ReplaceStateFn = (
_next: CreateFlowState | ((_prev: CreateFlowState) => CreateFlowState),
) => void;
type UpdateState = CreateFlowContextValue["updateState"];
type ReplaceStateFn = CreateFlowContextValue["replaceState"];
export type UseTemplateReviewActionsResult = {
/** True iff the current pathname is a template-review route (locale/basePath tolerant). */
@@ -123,7 +123,7 @@ export function FinalReviewScreen({
[markCreateFlowInteraction, updateState, state],
);
const { categories: finalReviewCategories, chipLookup } = useMemo(() => {
const { categories: finalReviewCategories } = useMemo(() => {
const { names, rows: fallbackRows } = readFallbackCategoryRows(
m.create.reviewAndComplete.finalReview.categories,
);
@@ -196,7 +196,7 @@ export function FinalReviewScreen({
: undefined,
};
});
return { categories: cats, chipLookup: lookup };
return { categories: cats };
}, [
m.create.reviewAndComplete.finalReview.categories,
state,
@@ -204,7 +204,6 @@ export function FinalReviewScreen({
goToStep,
variant,
]);
void chipLookup;
const ruleCardTitle = useMemo(() => {
const raw = typeof state.title === "string" ? state.title.trim() : "";
+3 -2
View File
@@ -9,8 +9,9 @@ import { parseRequestedFacetsFromSearchParams } from "../../../lib/server/valida
*
* No params → curated ordering (`featured` desc, `sortOrder` asc, `title`
* asc). With `facet.<group>=<value>` query params (repeatable per group),
* templates are re-ranked by composed-method match count; ties fall back to
* the curated order, score-0 templates remain at the end.
* templates are re-ranked by `TemplateFacet` matrix match when seeded for
* that slug, else by composed-method × `MethodFacet` match count; ties fall
* back to the curated order, score-0 templates remain at the end.
*
* See `docs/guides/template-recommendation-matrix.md` §9.1.
*/