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

@@ -2,9 +2,11 @@
import { useCallback, useMemo, useState } from "react";
import Rule, { type Category } from "../../../../components/cards/Rule";
import Alert from "../../../../components/modals/Alert";
import { TemplateChipDetailModal } from "../../../../components/cards/TemplateReviewCard/TemplateChipDetailModal";
import { useMessages, useTranslation } from "../../../../contexts/MessagesContext";
import { useCreateFlow } from "../../context/CreateFlowContext";
import type { CreateFlowState } from "../../types";
import { useCreateFlowMdUp } from "../../hooks/useCreateFlowMdUp";
import {
CREATE_FLOW_REVIEW_RULE_LAYOUT_CLASS,
@@ -39,6 +41,15 @@ import {
readDraftPreviewSurfaceColor,
} from "../../utils/resolvePreviewSurfaceFallback";
function bindingArbitrationNeedsSeparateYes(state: CreateFlowState): boolean {
const membership = state.selectedMembershipMethodIds ?? [];
const conflict = state.selectedConflictManagementIds ?? [];
const joinsWithoutAYes =
membership.includes("open-admission") ||
membership.includes("membership-by-token");
return joinsWithoutAYes && conflict.includes("binding-arbitration");
}
const FACET_FALLBACK_ORDER: readonly TemplateFacetGroupKey[] = [
"coreValues",
"communication",
@@ -284,6 +295,16 @@ export function FinalReviewScreen({
: t("description")
}
>
{bindingArbitrationNeedsSeparateYes(state) ? (
<Alert
type="banner"
status="warning"
size="m"
title={t("bindingArbitrationWarning.title")}
description={t("bindingArbitrationWarning.description")}
hasTrailingIcon={false}
/>
) : null}
<Rule
title={ruleCardTitle}
description={ruleCardDescription}
@@ -9,10 +9,10 @@ import { CreateFlowHeaderLockup } from "../../components/CreateFlowHeaderLockup"
import { CreateFlowTwoColumnSelectShell } from "../../components/CreateFlowTwoColumnSelectShell";
function chipRowsFromLabels(
rows: readonly { label: string }[],
rows: readonly { id?: string; label: string }[],
): ChipOption[] {
return rows.map((row, i) => ({
id: String(i + 1),
id: row.id ?? String(i + 1),
label: row.label,
state: "unselected" as const,
}));
@@ -47,10 +47,10 @@ function createListCustomHandlers(
}
function chipRowsFromLabels(
rows: readonly { label: string }[],
rows: readonly { id?: string; label: string }[],
): ChipOption[] {
return rows.map((row, i) => ({
id: String(i + 1),
id: row.id ?? String(i + 1),
label: row.label,
state: "unselected" as const,
}));
@@ -54,12 +54,16 @@ const MAX_CORE_VALUES = MAX_SELECTED_CORE_VALUES;
*/
type ModalSession = "pending" | "customPending" | "editing";
/** Row in `coreValues.json` `values` — string (legacy) or `{ label, meaning, signals }`. */
type CoreValuePresetJson =
| string
| { label: string; meaning?: string; signals?: string };
/** Row in `coreValues.json` `values`. */
type CoreValuePresetJson = {
id: string;
label: string;
meaning?: string;
signals?: string;
};
type CoreValuePreset = {
id: string;
label: string;
meaning: string;
signals: string;
@@ -68,16 +72,12 @@ type CoreValuePreset = {
function normalizeCoreValuePresets(
values: readonly CoreValuePresetJson[],
): CoreValuePreset[] {
return values.map((v) => {
if (typeof v === "string") {
return { label: v, meaning: "", signals: "" };
}
return {
label: v.label,
meaning: typeof v.meaning === "string" ? v.meaning : "",
signals: typeof v.signals === "string" ? v.signals : "",
};
});
return values.map((v) => ({
id: v.id,
label: v.label,
meaning: typeof v.meaning === "string" ? v.meaning : "",
signals: typeof v.signals === "string" ? v.signals : "",
}));
}
function selectedIdsFromOptions(options: ChipOption[]): string[] {
@@ -98,7 +98,7 @@ function chipOptionsToSnapshotRows(
const EMPTY_DETAIL: CoreValueDetailEntry = { meaning: "", signals: "" };
/** Create Custom — Core Values (Figma `20264:68378`). Up to five selections; preset list + custom chips. */
/** Create Custom — Core Values (Figma `20264:68378`). Up to six selections; preset list + custom chips. */
export function CoreValuesSelectScreen() {
const m = useMessages();
const cv = m.create.customRule.coreValues;