Skip to content

Commit 92b2e34

Browse files
authored
feat(autolayout): add fitToView on autolayout and reduce horizontal spacing between blocks (#2575)
* feat(autolayout): add fitToView on autolayout and reduce horizontal spacing between blocks * remove additional yaml code
1 parent 77521a3 commit 92b2e34

File tree

20 files changed

+68
-1872
lines changed

20 files changed

+68
-1872
lines changed

apps/sim/app/api/copilot/chat/route.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,6 @@ export async function GET(req: NextRequest) {
10661066
model: chat.model,
10671067
messages: Array.isArray(chat.messages) ? chat.messages : [],
10681068
messageCount: Array.isArray(chat.messages) ? chat.messages.length : 0,
1069-
previewYaml: null, // Not needed for chat list
10701069
planArtifact: chat.planArtifact || null,
10711070
config: chat.config || null,
10721071
createdAt: chat.createdAt,

apps/sim/app/api/workflows/yaml/convert/route.ts

Lines changed: 0 additions & 117 deletions
This file was deleted.

apps/sim/app/api/workflows/yaml/export/route.ts

Lines changed: 0 additions & 210 deletions
This file was deleted.

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/diff-controls/diff-controls.tsx

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const logger = createLogger('DiffControls')
1414

1515
export const DiffControls = memo(function DiffControls() {
1616
const isTerminalResizing = useTerminalStore((state) => state.isResizing)
17-
// Optimized: Single diff store subscription
1817
const {
1918
isShowingDiff,
2019
isDiffReady,
@@ -38,12 +37,10 @@ export const DiffControls = memo(function DiffControls() {
3837
)
3938
)
4039

41-
// Optimized: Single copilot store subscription for needed values
42-
const { updatePreviewToolCallState, clearPreviewYaml, currentChat, messages } = useCopilotStore(
40+
const { updatePreviewToolCallState, currentChat, messages } = useCopilotStore(
4341
useCallback(
4442
(state) => ({
4543
updatePreviewToolCallState: state.updatePreviewToolCallState,
46-
clearPreviewYaml: state.clearPreviewYaml,
4744
currentChat: state.currentChat,
4845
messages: state.messages,
4946
}),
@@ -222,11 +219,6 @@ export const DiffControls = memo(function DiffControls() {
222219
logger.warn('Failed to create checkpoint before accept:', error)
223220
})
224221

225-
// Clear preview YAML immediately
226-
await clearPreviewYaml().catch((error) => {
227-
logger.warn('Failed to clear preview YAML:', error)
228-
})
229-
230222
// Resolve target toolCallId for build/edit and update to terminal success state in the copilot store
231223
try {
232224
const { toolCallsById, messages } = useCopilotStore.getState()
@@ -266,16 +258,11 @@ export const DiffControls = memo(function DiffControls() {
266258
logger.error('Workflow update failed:', errorMessage)
267259
alert(`Failed to save workflow changes: ${errorMessage}`)
268260
}
269-
}, [createCheckpoint, clearPreviewYaml, updatePreviewToolCallState, acceptChanges])
261+
}, [createCheckpoint, updatePreviewToolCallState, acceptChanges])
270262

271263
const handleReject = useCallback(() => {
272264
logger.info('Rejecting proposed changes (optimistic)')
273265

274-
// Clear preview YAML immediately
275-
clearPreviewYaml().catch((error) => {
276-
logger.warn('Failed to clear preview YAML:', error)
277-
})
278-
279266
// Resolve target toolCallId for build/edit and update to terminal rejected state in the copilot store
280267
try {
281268
const { toolCallsById, messages } = useCopilotStore.getState()
@@ -306,7 +293,7 @@ export const DiffControls = memo(function DiffControls() {
306293
rejectChanges().catch((error) => {
307294
logger.error('Failed to reject changes (background):', error)
308295
})
309-
}, [clearPreviewYaml, updatePreviewToolCallState, rejectChanges])
296+
}, [updatePreviewToolCallState, rejectChanges])
310297

311298
// Don't show anything if no diff is available or diff is not ready
312299
if (!hasActiveDiff || !isDiffReady) {

0 commit comments

Comments
 (0)