fix(allocations): expand grouped rows by default

This commit is contained in:
2026-04-01 15:13:24 +02:00
parent 34067f1576
commit b841cc9127
3 changed files with 84 additions and 15 deletions
@@ -0,0 +1,33 @@
export type CollapsedAllocationGroups = Set<string> | "all";
export function createInitialCollapsedAllocationGroups(): CollapsedAllocationGroups {
return new Set<string>();
}
export function toggleCollapsedAllocationGroup(
previous: CollapsedAllocationGroups,
groupIds: string[],
resourceId: string,
): CollapsedAllocationGroups {
if (previous === "all") {
const next = new Set(groupIds);
next.delete(resourceId);
return next;
}
const next = new Set(previous);
if (next.has(resourceId)) {
next.delete(resourceId);
} else {
next.add(resourceId);
}
return next;
}
export function collapseAllAllocationGroups(): CollapsedAllocationGroups {
return "all";
}
export function expandAllAllocationGroups(): CollapsedAllocationGroups {
return new Set<string>();
}