fix: make implicit groups (forloop, branches) expanded by default

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Guilhem Lemouel
2026-03-11 16:39:29 +01:00
parent 756fdf50bc
commit 2f794c45ec
2 changed files with 7 additions and 7 deletions
@@ -251,8 +251,8 @@
movingIds = undefined
}: Props = $props()
// Runtime state for expanded containers (collapsed by default)
let expandedContainers = $state<Set<string>>(new Set())
// Runtime state for collapsed containers (expanded by default)
let collapsedContainers = $state<Set<string>>(new Set())
// Initialize note manager with fine-grained reactivity
const noteManager = new NoteManager(
@@ -438,10 +438,10 @@
groupEditorContext?.groupEditor.expandGroup(groupId)
},
expandContainer: (moduleId: string) => {
expandedContainers = new Set([...expandedContainers, moduleId])
collapsedContainers = new Set([...collapsedContainers].filter((id) => id !== moduleId))
},
collapseContainer: (moduleId: string) => {
expandedContainers = new Set([...expandedContainers].filter((id) => id !== moduleId))
collapsedContainers = new Set([...collapsedContainers, moduleId])
},
updateMock: (detail) => {
onUpdateMock?.(detail)
@@ -852,7 +852,7 @@
triggerNode ? path : undefined,
expandedSubflows,
collapsedGroups,
expandedContainers,
collapsedContainers,
showNotes
)
})
@@ -412,7 +412,7 @@ export function graphBuilder(
collapsed?: boolean
module_ids: string[]
}>,
expandedContainers: Set<string>,
collapsedContainers: Set<string>,
showNotes: boolean
// triggerProps?: {
// path?: string
@@ -738,7 +738,7 @@ export function graphBuilder(
module.value.type === 'branchone' ||
module.value.type === 'forloopflow' ||
module.value.type === 'whileloopflow'
if (isContainer && !expandedContainers.has(module.id)) {
if (isContainer && collapsedContainers.has(module.id)) {
const containerModules = getContainerModules(module)
addNode(module, { isCollapsedContainer: true, containerModules })