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:
1 parent
96ca15d8e3
commit
bcbc6f30d9
89 files changed
+36555
-2828
No files matched your search
@@ -113,9 +113,6 @@ export function emptyMembershipDetails(): MembershipMethodDetailEntry {
|
||||
return { eligibility: "", joiningProcess: "", expectations: "" };
|
||||
}
|
||||
|
||||
/** Default consensus level used when a **catalog** preset omits a value. */
|
||||
export const DECISION_CONSENSUS_LEVEL_DEFAULT = 75;
|
||||
|
||||
export function decisionApproachPresetFor(
|
||||
id: string,
|
||||
): DecisionApproachDetailEntry {
|
||||
@@ -128,13 +125,8 @@ export function decisionApproachPresetFor(
|
||||
stepByStepInstructions: asString(s.stepByStepInstructions),
|
||||
objectionsDeadlocks: asString(s.objectionsDeadlocks),
|
||||
};
|
||||
if (method) {
|
||||
entry.consensusLevel = asNumberClamped(
|
||||
s.consensusLevel,
|
||||
0,
|
||||
100,
|
||||
DECISION_CONSENSUS_LEVEL_DEFAULT,
|
||||
);
|
||||
if (method && typeof s.consensusLevel === "number" && Number.isFinite(s.consensusLevel)) {
|
||||
entry.consensusLevel = asNumberClamped(s.consensusLevel, 0, 100, 0);
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
@@ -189,35 +181,29 @@ export function emptyConflictManagementDetails(): ConflictManagementDetailEntry
|
||||
export function coreValuePresetFor(chipId: string): CoreValueDetailEntry {
|
||||
const values = (coreValuesMessages as { values?: unknown }).values;
|
||||
if (!Array.isArray(values)) return { meaning: "", signals: "" };
|
||||
const idx = Number.parseInt(chipId, 10);
|
||||
if (!Number.isInteger(idx) || idx < 1 || idx > values.length) {
|
||||
return { meaning: "", signals: "" };
|
||||
for (const row of values) {
|
||||
if (!row || typeof row !== "object") continue;
|
||||
const o = row as Record<string, unknown>;
|
||||
if (o.id !== chipId) continue;
|
||||
return {
|
||||
meaning: asString(o.meaning),
|
||||
signals: asString(o.signals),
|
||||
};
|
||||
}
|
||||
const row = values[idx - 1];
|
||||
if (!row || typeof row !== "object") return { meaning: "", signals: "" };
|
||||
const o = row as Record<string, unknown>;
|
||||
return {
|
||||
meaning: asString(o.meaning),
|
||||
signals: asString(o.signals),
|
||||
};
|
||||
return { meaning: "", signals: "" };
|
||||
}
|
||||
|
||||
/**
|
||||
* Preset chip id for a core value label (`"1"` … `"n"` from
|
||||
* `CoreValuesSelectScreen`), or `null` when the label is bespoke.
|
||||
*/
|
||||
/** Preset chip id for a core value label, or `null` when the label is bespoke. */
|
||||
export function resolveCoreValueChipIdFromLabel(label: string): string | null {
|
||||
const t = label.trim();
|
||||
if (!t) return null;
|
||||
const values = (coreValuesMessages as { values?: unknown }).values;
|
||||
if (!Array.isArray(values)) return null;
|
||||
for (let i = 0; i < values.length; i++) {
|
||||
const row = values[i];
|
||||
if (typeof row === "string" && row.trim() === t) return String(i + 1);
|
||||
for (const row of values) {
|
||||
if (!row || typeof row !== "object") continue;
|
||||
const o = row as Record<string, unknown>;
|
||||
if (typeof o.label === "string" && o.label.trim() === t) {
|
||||
return String(i + 1);
|
||||
if (typeof o.label === "string" && o.label.trim() === t && typeof o.id === "string") {
|
||||
return o.id;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in new issue
Block a user