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[],
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
* Reorders facet-ranked method presets so explicitly confirmed selections pin
|
||||
* to the top while the remainder keeps score-based ranking (recommended before
|
||||
* default).
|
||||
* Compact CardStack slots pin confirmed selections to the front while the
|
||||
* remainder keeps score-based ranking. Expanded order stays the ranked catalog.
|
||||
*/
|
||||
|
||||
/** Selected ids first (selection array order); then tail in `ranked` order. */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Canonical ordering for method-card facet `selected*Ids` when the user adds a card:
|
||||
* most recently confirmed id is index 0 so stack / compact layouts stay consistent
|
||||
* with {@link orderRankedMethodsWithPinnedSelection}.
|
||||
* most recently confirmed id is index 0 so compact layouts stay consistent
|
||||
* with {@link mergeCompactCardIdsWithPinnedSelected}.
|
||||
*/
|
||||
export function moveFacetSelectionIdToFront(
|
||||
prev: readonly string[],
|
||||
|
||||
Reference in New Issue
Block a user