-
Notifications
You must be signed in to change notification settings - Fork 3.3k
v0.4.2: autolayout improvements, variable resolution, CI/CD, deployed chat, router block fixes #1517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* make trigger select uuid consistent with sidebar selection * add trigger allowed flag for core triggers * fix autolayout with new triggers
* Fix trigger workflow ci * Update trigger location
…ut to prevent overlaps (#1505) * improvement(autolayout): use live block heights / widths for autolayout to prevent overlaps * improve layering algo for multiple trigger setting * remove console logs * add type annotation
* Capture correct deployment version output * Add trigger access token to each step * Use correct arn
* Revert trigger promotion * Move trigger * Fix ci
…uing (#1508) * fix(deployed-version-check): check deployed version existence pre-queuing * fix tests * fix edge case
…and consolidate code (#1469) * improvement(var-resolution): resolve variables with block name check and consolidate code * fix tests * fix type error * fix var highlighting in kb tags * fix kb tags
* fix(router): use getBaseUrl() helper * add existence check
… min to match sync API executions (#1504) * improvement(trigger): increase maxDuration for background tasks to 10 min to match sync API executions * add trigger proj id
… of auth status (#1516)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Overview
Summary
This PR delivers significant improvements across multiple core systems in Sim's workflow platform. The main enhancement is a comprehensive autolayout system that prevents block overlaps by using live DOM measurements instead of static dimensions. The system now tracks real-time block width and height through `ResizeObserver` and uses this data in sophisticated positioning algorithms with proper topological sorting and layer assignment.The variable resolution system has been completely overhauled with a new accessibility-aware approach. Previously, all block references like <function1.result> were highlighted and validated regardless of connectivity, causing errors for unconnected blocks. Now, only references to blocks that are actually reachable through the workflow graph (via connections, loops, or parallel nodes) are highlighted in blue and resolved - invalid references remain as literal strings, preventing execution failures.
The PR introduces comprehensive multi-architecture CI/CD improvements, adding parallel ARM64 and AMD64 Docker builds with proper tagging strategies for both ECR and GitHub Container Registry. The deployment pipeline has been restructured to support different architectures while maintaining compatibility with existing staging and production environments.
Trigger system improvements include standardization with triggerAllowed: true flags across all trigger blocks, UUID-based ID generation replacing timestamp-based IDs, and deployment validation that prevents webhook execution when trigger blocks don't exist in active deployments.
The codebase now uses centralized URL generation through the getBaseUrl() helper instead of direct environment variable access, improving consistency across different deployment scenarios. Database migrations have been made idempotent with proper conditional handling, and Trigger.dev configuration has been enhanced with environment-based project IDs and extended timeouts to match synchronous execution limits.
Extensive documentation updates were made across multiple languages (German, French, Spanish, Chinese, Japanese) through automated translation processes, removing redundant YAML examples and improving content consistency.
Important Files Changed
Changed Files
| Filename | Score | Overview |
|---|---|---|
| apps/sim/stores/workflows/workflow/types.ts | 5/5 | Added BlockLayoutState interface to track measured block dimensions for autolayout improvements |
| apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/workflow-block.tsx | 4/5 | Updated ResizeObserver to track both width and height dimensions, replacing height-only tracking |
| apps/sim/app/workspace/[workspaceId]/w/[workflowId]/utils/auto-layout.ts | 4/5 | Modified autolayout API to send live block measurements instead of static layout options |
| apps/sim/app/api/workflows/[id]/autolayout/route.ts | 4/5 | Enhanced API to accept optional live block data from UI for more accurate positioning calculations |
| apps/sim/lib/workflows/autolayout/positioning.ts | 4/5 | Updated positioning algorithm to use live block metrics instead of static dimensions |
| apps/sim/lib/workflows/autolayout/types.ts | 5/5 | Replaced BlockDimensions with comprehensive BlockMetrics interface including padding and constraints |
| apps/sim/lib/workflows/autolayout/utils.ts | 4/5 | Refactored to use BlockMetrics system with measured dimensions and improved starter block detection |
| apps/sim/lib/workflows/autolayout/layering.ts | 5/5 | Implemented proper topological sorting for dependency-based layer assignment |
| apps/sim/executor/resolver/resolver.ts | 4/5 | Major overhaul of variable resolution with accessibility validation and consolidated reference processing |
| apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-accessible-reference-prefixes.ts | 4/5 | New hook to determine which block references are accessible based on workflow connectivity |
| apps/sim/lib/workflows/references.ts | 4/5 | New consolidated system for extracting and validating block references with pattern matching |
| apps/sim/components/ui/formatted-text.tsx | 4/5 | Added sophisticated variable resolution logic with accessibility-based highlighting |
| .github/workflows/ci.yml | 3/5 | Major refactor introducing multi-architecture builds with potential complexity and failure points |
| apps/sim/middleware.ts | 4/5 | Added /chat/ route bypass for unauthenticated access to deployed chat functionality |
| apps/sim/app/api/webhooks/trigger/[path]/route.ts | 5/5 | Added deployment validation to prevent webhook execution for non-existent trigger blocks |
| apps/sim/lib/workflows/db-helpers.ts | 5/5 | Added blockExistsInDeployment function to validate block presence in active deployments |
| apps/sim/executor/handlers/router/router-handler.ts | 5/5 | Replaced direct environment access with centralized getBaseUrl() helper for consistency |
| apps/sim/lib/urls/utils.ts | 5/5 | Enhanced browser environment detection with optional chaining for edge case safety |
| packages/db/migrations/0095_cheerful_albert_cleary.sql | 5/5 | Made SSO migration idempotent with conditional DDL operations |
| apps/sim/trigger.config.ts | 4/5 | Updated to use environment-based project ID and increased timeout to 600 seconds |
| apps/sim/blocks/blocks/schedule.ts | 5/5 | Added triggerAllowed flag for system consistency with other trigger blocks |
| apps/sim/blocks/blocks/input_trigger.ts | 5/5 | Added triggerAllowed property consistent with trigger block standardization |
| apps/sim/blocks/blocks/manual_trigger.ts | 5/5 | Added triggerAllowed flag for copilot context and autolayout compatibility |
| apps/sim/blocks/blocks/api_trigger.ts | 5/5 | Added triggerAllowed property to align with trigger system improvements |
| apps/sim/blocks/blocks/chat_trigger.ts | 5/5 | Added triggerAllowed property for trigger block standardization |
Confidence score: 4/5
- This PR contains substantial improvements with comprehensive testing coverage but involves complex system changes that require careful validation
- Score reflects the high-quality implementation of autolayout and variable resolution improvements offset by the complexity of multi-architecture CI changes
- Pay close attention to the CI/CD workflow changes, autolayout algorithm modifications, and variable resolution system overhaul
Additional Comments (1)
-
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/utils/auto-layout.ts, line 207 (link)style: Complex edge sanitization logic - consider extracting to separate function for better maintainability
Context Used: Context - If a switch statement is large and handles multiple cases, extract each case into separate functions for better maintainability. (link)
60 files reviewed, 6 comments
| ## 输入和输出 | ||
|
|
||
| <Tabs items={['配置', '变量', '结果']}> | ||
| <Tabs items={['Configuration', 'Variables', 'Results']}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Tab labels are in English while the rest of the content is in Chinese - consider localizing these labels for consistency
| <Tabs items={['Configuration', 'Variables', 'Results']}> | |
| <Tabs items={['配置', '变量', '结果']}> |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/docs/content/docs/zh/blocks/agent.mdx
Line: 179:179
Comment:
style: Tab labels are in English while the rest of the content is in Chinese - consider localizing these labels for consistency
```suggestion
<Tabs items={['配置', '变量', '结果']}>
```
How can I resolve this? If you propose a fix, please make it concise.| simple-loop: | ||
| type: loop | ||
| name: "Simple Loop" | ||
| # No inputs section - defaults to loopType: 'for', iterations: 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: English comment in French documentation should be translated
| # No inputs section - defaults to loopType: 'for', iterations: 5 | |
| # Aucune section inputs - utilise par défaut loopType: 'for', iterations: 5 |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/docs/content/docs/fr/yaml/blocks/loop.mdx
Line: 308:308
Comment:
style: English comment in French documentation should be translated
```suggestion
# Aucune section inputs - utilise par défaut loopType: 'for', iterations: 5
```
How can I resolve this? If you propose a fix, please make it concise.| type: string | string[] | ||
| description: Target block ID to execute inside the loop (direct format) | ||
| loop-end-source: | ||
| type: string | string[] | ||
| description: Target block ID for loop completion (direct format, optional) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: Type definition string | string[] may not be valid YAML schema syntax - should be oneOf structure
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/docs/content/docs/ja/yaml/blocks/loop.mdx
Line: 62:66
Comment:
syntax: Type definition `string | string[]` may not be valid YAML schema syntax - should be `oneOf` structure
How can I resolve this? If you propose a fix, please make it concise.| error: | ||
| type: string | ||
| description: Target block ID for error handling | ||
| note: Use either the nested 'loop' format OR the direct 'loop-start-source' format, not both |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Using note field in YAML schema is non-standard - consider using description or comments
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/docs/content/docs/ja/yaml/blocks/loop.mdx
Line: 70:70
Comment:
style: Using `note` field in YAML schema is non-standard - consider using `description` or comments
How can I resolve this? If you propose a fix, please make it concise.| measuredWidth ?? 0, | ||
| resolveNumeric(block.data?.width, DEFAULT_CONTAINER_WIDTH) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Using nullish coalescing with 0 fallback could mask legitimate 0 values. Consider if 0 is a valid measured dimension.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/lib/workflows/autolayout/utils.ts
Line: 25:26
Comment:
style: Using nullish coalescing with 0 fallback could mask legitimate 0 values. Consider if 0 is a valid measured dimension.
How can I resolve this? If you propose a fix, please make it concise.…aging & for prod as well (#1518)
… DB connection config (#1519) * improvement(db): remove vercel, remove railway, remove crons, improve DB connection config * remove NEXT_PUBLIC_VERCEL_URL * remove db url fallbacks * remove railway & more vercel stuff --------- Co-authored-by: waleed <waleed>
Summary
feat(i18n): update translations (#1496)
Remove migrations ci (#1501)
fix(migrations): make sso migration idempotent
improvement(triggers): uuid, autolayout, copilot context (#1503)
improvement(ci): trigger.dev pushes (#1506)
improvement(autolayout): use live block heights / widths for autolayout to prevent overlaps (#1505)
fix(ci): add skip promotion to trigger ci
fix(ci): trigger permissions
Fix trigger ci creds (#1510)
fix(ci): fix trigger version capture
fix(ci): capture correct deployment version output (#1512)
Fix/remove trigger promotion (#1513)
fix(deployed-version-check): check deployed version existence pre-queuing (#1508)
improvement(var-resolution): resolve variables with block name check and consolidate code (#1469)
fix(router): use getBaseUrl() helper (#1515)
improvement(trigger): increase maxDuration for background tasks to 10 min to match sync API executions (#1504)