Close method-card Save like first add, keep key-resource chips on the approach they were chosen for, and leave expanded See-all stacks in catalog order.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -59,6 +59,34 @@ export function decisionApproachKeyResourceIdsFromLabels(
|
||||
.map((item) => item.id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sidebar checkboxes follow the open approach while its modal is up.
|
||||
* With no modal they show key resources assigned to any selected approach,
|
||||
* plus extra reminder checks that are not painted onto chips.
|
||||
*/
|
||||
export function decisionApproachKeyResourceCheckboxIds(params: {
|
||||
detailsById: Record<string, DecisionApproachDetailEntry> | undefined;
|
||||
selectedApproachIds: readonly string[];
|
||||
reminderIds?: readonly string[];
|
||||
openDraft?: DecisionApproachDetailEntry | null;
|
||||
}): string[] {
|
||||
if (params.openDraft) {
|
||||
return decisionApproachKeyResourceIdsFromLabels(
|
||||
params.openDraft.selectedApplicableScope,
|
||||
);
|
||||
}
|
||||
const assignedLabels: string[] = [];
|
||||
for (const id of params.selectedApproachIds) {
|
||||
const entry = params.detailsById?.[id];
|
||||
if (!entry) continue;
|
||||
assignedLabels.push(...entry.selectedApplicableScope);
|
||||
}
|
||||
return uniquePreserveOrder([
|
||||
...decisionApproachKeyResourceIdsFromLabels(assignedLabels),
|
||||
...(params.reminderIds ?? []),
|
||||
]);
|
||||
}
|
||||
|
||||
export function stringArraysEqual(
|
||||
a: readonly string[],
|
||||
b: readonly string[],
|
||||
|
||||
Reference in New Issue
Block a user