Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -736,20 +736,18 @@ export function ControlBar({ hasValidationErrors = false }: ControlBarProps) {

setIsAutoLayouting(true)
try {
// Use the shared auto layout utility for immediate frontend updates
const { applyAutoLayoutAndUpdateStore } = await import('../../utils/auto-layout')
// Use the LOCAL auto layout implementation for immediate frontend updates
const { applyLocalAutoLayoutAndUpdateStore } = await import('../../utils/local-auto-layout')

const result = await applyAutoLayoutAndUpdateStore(activeWorkflowId!)
const result = await applyLocalAutoLayoutAndUpdateStore(activeWorkflowId!)

if (result.success) {
logger.info('Auto layout completed successfully')
} else {
logger.error('Auto layout failed:', result.error)
// You could add a toast notification here if available
}
} catch (error) {
logger.error('Auto layout error:', error)
// You could add a toast notification here if available
} finally {
setIsAutoLayouting(false)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@ import { createLogger } from '@/lib/logs/console/logger'

const logger = createLogger('AutoLayoutUtils')

/**
* Default auto layout options
*/
export const DEFAULT_AUTO_LAYOUT_OPTIONS: AutoLayoutOptions = {
strategy: 'smart',
direction: 'auto',
spacing: {
horizontal: 250,
vertical: 200,
layer: 350,
},
alignment: 'center',
padding: {
x: 125,
y: 125,
},
}

/**
* Auto layout options interface
*/
Expand All @@ -20,24 +38,6 @@ export interface AutoLayoutOptions {
}
}

/**
* Default auto layout options
*/
const DEFAULT_AUTO_LAYOUT_OPTIONS: AutoLayoutOptions = {
strategy: 'smart',
direction: 'auto',
spacing: {
horizontal: 500,
vertical: 400,
layer: 700,
},
alignment: 'center',
padding: {
x: 250,
y: 250,
},
}

/**
* Apply auto layout to workflow blocks and update the store
*/
Expand Down
Loading