chore: refactor graphStack to be simpler

This commit is contained in:
2026-05-05 18:45:54 +02:00
parent 8ad62cfc8e
commit ed11195327
8 changed files with 243 additions and 192 deletions
@@ -12,16 +12,16 @@
const { manager, node = $bindable() }: Props = $props();
const activeGroup = $derived.by(() => {
if (node?.type === '__internal/group/instance') {
return manager.getGroup(node.props?.groupId as number);
}
if (manager?.isInsideGroup) {
const activeGroupId = manager.graphStack?.at(-1)?.groupId;
const activeGroupId = manager.parentStack?.at(-1)?.id;
if (activeGroupId !== undefined) {
return manager.getGroup(activeGroupId);
}
}
if (node?.type === '__internal/group/instance') {
return manager.getGroup(node.props?.groupId as number);
}
});
const groupName = $derived(activeGroup?.name ?? '');