Import the remade decks on stable ids and recommend one card per job, so a saved draft still loads after a chip is renamed.

The real-group profiles stay as a test, so a change that moves a pick fails.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
adilalloandCursor committed 2026-11-04 14:22:54 -07:00
1 parent 96ca15d8e3
commit bcbc6f30d9
89 files changed
+36555 -2828

No files matched your search

+20 -4
View File
@@ -1,5 +1,11 @@
import facetGroups from "../../data/create/customRule/_facetGroups.json";
import type { CreateFlowState } from "../../app/(app)/create/types";
import {
resolveMaturityChipId,
resolveOrgChipId,
resolveScaleChipId,
resolveSizeChipId,
} from "./communityChipIds";
const FACET_GROUPS = ["size", "orgType", "scale", "maturity"] as const;
type FacetGroupId = (typeof FACET_GROUPS)[number];
@@ -32,6 +38,13 @@ const STATE_KEY_BY_GROUP: Record<FacetGroupId, keyof CreateFlowState> = {
maturity: "selectedMaturityIds",
};
const RESOLVE_BY_GROUP: Record<FacetGroupId, (id: string) => string> = {
size: resolveSizeChipId,
orgType: resolveOrgChipId,
scale: resolveScaleChipId,
maturity: resolveMaturityChipId,
};
function readChipIds(
state: CreateFlowState,
group: FacetGroupId,
@@ -49,11 +62,14 @@ export function buildFacetQueryString(state: CreateFlowState): string {
const params = new URLSearchParams();
for (const group of FACET_GROUPS) {
const valuesById = CHIP_TO_VALUE_BY_GROUP[group];
const resolve = RESOLVE_BY_GROUP[group];
const seen = new Set<string>();
for (const chipId of readChipIds(state, group)) {
const valueId = valuesById[chipId];
if (valueId) {
params.append(`facet.${group}`, valueId);
}
const valueId = valuesById[resolve(chipId)] ?? valuesById[chipId];
if (valueId === "enterprise") continue;
if (!valueId || seen.has(valueId)) continue;
seen.add(valueId);
params.append(`facet.${group}`, valueId);
}
}
return params.toString();