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:
adilallo
2026-08-25 09:21:07 -06:00
co-authored by Cursor
parent b1ca1a748e
commit 963fa03c5c
12 changed files with 437 additions and 167 deletions
@@ -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[],