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
@@ -1,6 +1,7 @@
import { describe, expect, it } from "vitest";
import {
applyDecisionApproachKeyResources,
decisionApproachKeyResourceCheckboxIds,
decisionApproachKeyResourceIdsFromLabels,
decisionApproachScopeForPublish,
decisionApproachKeyResourceItems,
@@ -96,6 +97,37 @@ describe("decisionApproachKeyResources", () => {
).toEqual(["amend", "project"]);
});
it("derives sidebar checks from the open draft or selected approaches", () => {
const detailsById = {
"lazy-consensus": {
...emptyEntry(),
selectedApplicableScope: ["Steward finances"],
},
"do-ocracy": {
...emptyEntry(),
selectedApplicableScope: ["Project level decisions"],
},
};
expect(
decisionApproachKeyResourceCheckboxIds({
detailsById,
selectedApproachIds: ["lazy-consensus", "do-ocracy"],
reminderIds: ["discipline"],
}),
).toEqual(["finances", "project", "discipline"]);
expect(
decisionApproachKeyResourceCheckboxIds({
detailsById,
selectedApproachIds: ["lazy-consensus", "do-ocracy"],
reminderIds: ["discipline"],
openDraft: {
...emptyEntry(),
selectedApplicableScope: ["Amend your CommunityRule"],
},
}),
).toEqual(["amend"]);
});
it("syncs existing and selected approach details", () => {
const next = syncDecisionApproachKeyResourceDetails(
{ "lazy-consensus": emptyEntry() },