feat: lay out PARALLEL branches as vertical columns
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -252,8 +252,9 @@ export const useDesignerStore = defineStore('designer', () => {
|
||||
publishedVersion.value = params.version ?? null
|
||||
loadedFromDraft.value = Boolean(params.fromDraft)
|
||||
const expanded = expandLegacyParallel(params.nodes, params.edges)
|
||||
nodes.value = fitParallelFrames(expanded.nodes)
|
||||
edges.value = assignEdgeHandles(expanded.nodes, expanded.edges)
|
||||
const parallels = expanded.nodes.filter((node) => node.data?.kind === 'PARALLEL').map((node) => node.id)
|
||||
nodes.value = parallels.reduce((current, id) => reflowLanes(current, id), expanded.nodes)
|
||||
edges.value = assignEdgeHandles(nodes.value, expanded.edges)
|
||||
syncStartFlags()
|
||||
clearSelection()
|
||||
resetHistory()
|
||||
@@ -707,10 +708,10 @@ export const useDesignerStore = defineStore('designer', () => {
|
||||
pushHistory()
|
||||
const laneIndex = parent.data.lanes.indexOf(lane)
|
||||
const stepIndex = nodes.value.filter((node) => node.parentNode === parallelId && laneOf(node.data) === lane).length
|
||||
nodes.value = fitParallelFrames([
|
||||
...nodes.value,
|
||||
spawnLaneStep(parallelId, lane, laneIndex, stepIndex, nextId(lane), kind),
|
||||
])
|
||||
nodes.value = reflowLanes(
|
||||
[...nodes.value, spawnLaneStep(parallelId, lane, laneIndex, stepIndex, nextId(lane), kind)],
|
||||
parallelId,
|
||||
)
|
||||
}
|
||||
|
||||
function renameLane(parallelId: string, from: string, to: string): boolean {
|
||||
|
||||
Reference in New Issue
Block a user