Conversation
Contributor
There was a problem hiding this comment.
Greptile Overview
Summary
This PR fixes the copilot diff store loading issue by simplifying workflow loading conditions and removing automatic layout positioning.
Key Changes:
- Simplified loading logic: Removed
lastSaveddependency from skeleton UI display conditions - now only relies onisWorkflowReady - Streamlined TriggerList rendering: Removed
lastSavedcheck from empty workflow trigger display logic - Removed auto-layout: Eliminated automatic layout positioning API call from workflow building process
The changes address a specific bug where the diff store wasn't loading properly, likely due to complex loading conditions that were preventing proper state hydration. The removal of lastSaved checks suggests this property was causing timing issues in the loading sequence.
Confidence Score: 4/5
- This PR is safe to merge with minimal risk - contains targeted bug fixes
- The changes are well-scoped bug fixes that simplify loading logic and remove potentially problematic auto-layout functionality. No breaking changes or complex logic introduced.
- No files require special attention - changes are straightforward simplifications
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx | 4/5 | Simplified loading conditions by removing lastSaved dependency in skeleton UI and TriggerList rendering |
| apps/sim/lib/copilot/tools/server/workflow/build-workflow.ts | 4/5 | Removed automatic layout positioning logic that fetches smart layout from external API |
Sequence Diagram
sequenceDiagram
participant User as User
participant WF as WorkflowContent
participant Store as WorkflowStore
participant Copilot as BuildWorkflowTool
participant API as SIM_AGENT_API
Note over WF,Store: Before Fix: Complex Loading Logic
User->>WF: Load Workflow Page
WF->>Store: Check isWorkflowReady
WF->>Store: Check lastSaved !== 'number'
Note over WF: showSkeletonUI = !isWorkflowReady || typeof lastSaved !== 'number'
alt lastSaved not a number
WF->>User: Show Skeleton UI
else Both conditions met
WF->>User: Show TriggerList
end
Note over WF,API: After Fix: Simplified Logic
User->>WF: Load Workflow Page
WF->>Store: Check isWorkflowReady only
Note over WF: showSkeletonUI = !isWorkflowReady
alt Workflow not ready
WF->>User: Show Skeleton UI
else Workflow ready
WF->>User: Show TriggerList (when empty)
end
Note over Copilot,API: Copilot Workflow Building
User->>Copilot: Build Workflow Request
Copilot->>Copilot: Validate workflow state
Note over Copilot,API: Removed: Auto-layout positioning
Note over API: X Layout API call removed
Copilot->>User: Return workflow state (without positioning)
2 files reviewed, no comments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes copilot diff store not loading diff
Type of Change
Testing
Manual
Checklist