feat: add clickable step count to toggle group collapse/expand

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Guilhem
2026-02-25 08:46:08 +00:00
parent 5b10e817f2
commit f8a53a817d
3 changed files with 11 additions and 1 deletions
@@ -19,6 +19,7 @@
showNote?: boolean
editMode?: boolean
modules?: FlowModule[]
onExpand?: () => void
onSummaryUpdate?: (text: string) => void
onNoteUpdate?: (text: string) => void
onHeightChange?: (height: number) => void
@@ -34,6 +35,7 @@
showNote = false,
editMode = false,
modules,
onExpand,
onSummaryUpdate,
onNoteUpdate,
onHeightChange
@@ -132,7 +134,13 @@
>
{/if}
{#if stepCount != null}
<span class="text-3xs opacity-60 ml-auto shrink-0 whitespace-nowrap"
<!-- svelte-ignore a11y_click_events_have_key_events -->
<!-- svelte-ignore a11y_no_static_element_interactions -->
<span
class="text-3xs opacity-60 ml-auto shrink-0 whitespace-nowrap {onExpand
? 'cursor-pointer hover:opacity-100 hover:text-blue-500 dark:hover:text-blue-400'
: ''}"
onclick={onExpand ? stopPropagation(preventDefault(onExpand)) : undefined}
>{stepCount} node{stepCount !== 1 ? 's' : ''}</span
>
{/if}
@@ -155,6 +155,7 @@
showNote={showNotes && group.note != null}
{editMode}
modules={getGroupModules(group)}
onExpand={() => toggleCollapse(group.id)}
onSummaryUpdate={(text) => groupEditorContext?.groupEditor.updateSummary(group.id, text)}
onNoteUpdate={(text) => groupEditorContext?.groupEditor.updateNote(group.id, text)}
onHeightChange={(h) => groupEditorContext?.groupEditor.setNoteHeight(group.id, h)}
@@ -47,6 +47,7 @@
showNote={data.showNotes && data.note != null}
editMode={data.editMode}
modules={data.modules}
onExpand={() => data.eventHandlers.expandGroup(data.groupId)}
onSummaryUpdate={(text) =>
groupEditorContext?.groupEditor.updateSummary(data.groupId, text)}
onNoteUpdate={(text) => groupEditorContext?.groupEditor.updateNote(data.groupId, text)}