Stop seeding 75% consensus on custom decision cards so wizard copy shows on the published rule.
Wire Back on the final-review chip editor to the same dismiss path as close, instead of a no-op. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -16,7 +16,10 @@ import {
|
||||
publishedMethodDisplayLabel,
|
||||
} from "./finalReviewChipPresets";
|
||||
import { isDocumentEntry } from "./documentEntryGuards";
|
||||
import { replaceMethodSectionsWithMethodSelections } from "./ruleSectionsFromMethodSelections";
|
||||
import {
|
||||
replaceMethodSectionsWithMethodSelections,
|
||||
withoutUnpublishedDecisionConsensus,
|
||||
} from "./ruleSectionsFromMethodSelections";
|
||||
import { templateCategoryToGroupKey } from "./templateReviewMapping";
|
||||
|
||||
export { isDocumentEntry } from "./documentEntryGuards";
|
||||
@@ -78,21 +81,25 @@ export type PublishedMethodSelections = {
|
||||
id: string;
|
||||
label: string;
|
||||
sections: CommunicationMethodDetailEntry;
|
||||
supportText?: string;
|
||||
}>;
|
||||
membership?: Array<{
|
||||
id: string;
|
||||
label: string;
|
||||
sections: MembershipMethodDetailEntry;
|
||||
supportText?: string;
|
||||
}>;
|
||||
decisionApproaches?: Array<{
|
||||
id: string;
|
||||
label: string;
|
||||
sections: DecisionApproachDetailEntry;
|
||||
supportText?: string;
|
||||
}>;
|
||||
conflictManagement?: Array<{
|
||||
id: string;
|
||||
label: string;
|
||||
sections: ConflictManagementDetailEntry;
|
||||
supportText?: string;
|
||||
}>;
|
||||
};
|
||||
|
||||
@@ -247,6 +254,14 @@ function pickMethodIds(
|
||||
return derived;
|
||||
}
|
||||
|
||||
function publishedRowSupportText(
|
||||
id: string,
|
||||
meta: CreateFlowState["customMethodCardMetaById"],
|
||||
): string | undefined {
|
||||
const t = meta?.[id]?.supportText?.trim();
|
||||
return t && t.length > 0 ? t : undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge `selected*MethodIds` with any saved `{group}MethodDetailsById`
|
||||
* overrides authored on the final-review screen. Preset defaults from the
|
||||
@@ -270,6 +285,10 @@ export function buildMethodSelectionsForDocument(
|
||||
out.communication = commIds.map((id) => {
|
||||
const preset = communicationPresetFor(id);
|
||||
const override = state.communicationMethodDetailsById?.[id];
|
||||
const supportText = publishedRowSupportText(
|
||||
id,
|
||||
state.customMethodCardMetaById,
|
||||
);
|
||||
return {
|
||||
id,
|
||||
label: publishedMethodDisplayLabel(
|
||||
@@ -278,6 +297,7 @@ export function buildMethodSelectionsForDocument(
|
||||
state.customMethodCardMetaById,
|
||||
),
|
||||
sections: override ? { ...preset, ...override } : preset,
|
||||
...(supportText ? { supportText } : {}),
|
||||
};
|
||||
});
|
||||
}
|
||||
@@ -290,6 +310,10 @@ export function buildMethodSelectionsForDocument(
|
||||
out.membership = memIds.map((id) => {
|
||||
const preset = membershipPresetFor(id);
|
||||
const override = state.membershipMethodDetailsById?.[id];
|
||||
const supportText = publishedRowSupportText(
|
||||
id,
|
||||
state.customMethodCardMetaById,
|
||||
);
|
||||
return {
|
||||
id,
|
||||
label: publishedMethodDisplayLabel(
|
||||
@@ -298,6 +322,7 @@ export function buildMethodSelectionsForDocument(
|
||||
state.customMethodCardMetaById,
|
||||
),
|
||||
sections: override ? { ...preset, ...override } : preset,
|
||||
...(supportText ? { supportText } : {}),
|
||||
};
|
||||
});
|
||||
}
|
||||
@@ -310,6 +335,11 @@ export function buildMethodSelectionsForDocument(
|
||||
out.decisionApproaches = daIds.map((id) => {
|
||||
const preset = decisionApproachPresetFor(id);
|
||||
const override = state.decisionApproachDetailsById?.[id];
|
||||
const supportText = publishedRowSupportText(
|
||||
id,
|
||||
state.customMethodCardMetaById,
|
||||
);
|
||||
const merged = override ? { ...preset, ...override } : preset;
|
||||
return {
|
||||
id,
|
||||
label: publishedMethodDisplayLabel(
|
||||
@@ -317,7 +347,11 @@ export function buildMethodSelectionsForDocument(
|
||||
id,
|
||||
state.customMethodCardMetaById,
|
||||
),
|
||||
sections: override ? { ...preset, ...override } : preset,
|
||||
sections: withoutUnpublishedDecisionConsensus(
|
||||
{ ...merged },
|
||||
state.customMethodCardFieldBlocksById?.[id],
|
||||
) as DecisionApproachDetailEntry,
|
||||
...(supportText ? { supportText } : {}),
|
||||
};
|
||||
});
|
||||
}
|
||||
@@ -330,6 +364,10 @@ export function buildMethodSelectionsForDocument(
|
||||
out.conflictManagement = cmIds.map((id) => {
|
||||
const preset = conflictManagementPresetFor(id);
|
||||
const override = state.conflictManagementDetailsById?.[id];
|
||||
const supportText = publishedRowSupportText(
|
||||
id,
|
||||
state.customMethodCardMetaById,
|
||||
);
|
||||
return {
|
||||
id,
|
||||
label: publishedMethodDisplayLabel(
|
||||
@@ -338,6 +376,7 @@ export function buildMethodSelectionsForDocument(
|
||||
state.customMethodCardMetaById,
|
||||
),
|
||||
sections: override ? { ...preset, ...override } : preset,
|
||||
...(supportText ? { supportText } : {}),
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user