mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
Fix copilot diff (#1485)
This commit is contained in:
committed by
GitHub
parent
67c993d743
commit
333442909b
@@ -1837,7 +1837,7 @@ const WorkflowContent = React.memo(() => {
|
||||
}, [collaborativeSetSubblockValue])
|
||||
|
||||
// Show skeleton UI while loading until the workflow store is hydrated
|
||||
const showSkeletonUI = !isWorkflowReady || typeof lastSaved !== 'number'
|
||||
const showSkeletonUI = !isWorkflowReady
|
||||
|
||||
if (showSkeletonUI) {
|
||||
return (
|
||||
@@ -1942,10 +1942,9 @@ const WorkflowContent = React.memo(() => {
|
||||
/>
|
||||
|
||||
{/* Trigger list for empty workflows - only show after workflow has loaded and hydrated */}
|
||||
{isWorkflowReady &&
|
||||
typeof lastSaved === 'number' &&
|
||||
isWorkflowEmpty &&
|
||||
effectivePermissions.canEdit && <TriggerList onSelect={handleTriggerSelect} />}
|
||||
{isWorkflowReady && isWorkflowEmpty && effectivePermissions.canEdit && (
|
||||
<TriggerList onSelect={handleTriggerSelect} />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -96,44 +96,6 @@ export const buildWorkflowServerTool: BaseServerTool<
|
||||
// Use sanitized state if available
|
||||
const finalWorkflowState = validation.sanitizedState || workflowState
|
||||
|
||||
// Apply positions using smart layout
|
||||
const positionResponse = await fetch(`${SIM_AGENT_API_URL}/api/yaml/apply-layout`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
workflowState: finalWorkflowState,
|
||||
options: {
|
||||
strategy: 'smart',
|
||||
direction: 'auto',
|
||||
spacing: {
|
||||
horizontal: 500,
|
||||
vertical: 400,
|
||||
layer: 700,
|
||||
},
|
||||
alignment: 'center',
|
||||
padding: {
|
||||
x: 250,
|
||||
y: 250,
|
||||
},
|
||||
},
|
||||
}),
|
||||
})
|
||||
|
||||
if (!positionResponse.ok) {
|
||||
const errorText = await positionResponse.text().catch(() => '')
|
||||
logger.warn('Failed to apply layout to workflow', {
|
||||
status: positionResponse.status,
|
||||
error: errorText,
|
||||
})
|
||||
// Non-critical error - continue with unpositioned workflow
|
||||
} else {
|
||||
const layoutResult = await positionResponse.json()
|
||||
if (layoutResult.success && layoutResult.workflowState) {
|
||||
// Update the workflow state with positioned blocks
|
||||
Object.assign(finalWorkflowState, layoutResult.workflowState)
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
workflowState: finalWorkflowState,
|
||||
|
||||
Reference in New Issue
Block a user