Skip to content

Conversation

@icecrasher321
Copy link
Collaborator

Summary

Reduce horizontal spacing in autolayout

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Dec 8, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Dec 8, 2025 6:36am

@icecrasher321 icecrasher321 merged commit 434d129 into staging Dec 8, 2025
4 checks passed
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 8, 2025

Greptile Overview

Greptile Summary

Reduced horizontal spacing constants for autolayout from 550→350 and container spacing from 400→250. However, the container spacing change is ineffective due to a duplicate constant definition in containers.ts:18 that shadows the export from constants.ts.

  • Root-level horizontal spacing successfully reduced from 550 to 350
  • Container horizontal spacing change (400→250) has no effect due to duplicate constant in containers.ts
  • The duplicate in containers.ts needs to be removed and the constant should be imported from constants.ts instead

Confidence Score: 2/5

  • This PR is only partially effective due to a duplicate constant that prevents container spacing from being updated
  • Score reflects that while the root-level spacing change works correctly, the container spacing change is completely ineffective due to a shadowing duplicate constant in containers.ts:18. This means only half of the intended spacing reduction is actually applied, which could lead to inconsistent layout behavior
  • containers.ts needs attention to remove the duplicate constant and import from constants.ts instead

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/lib/workflows/autolayout/constants.ts 2/5 Reduced horizontal spacing constants, but container spacing change is ineffective due to duplicate constant in containers.ts:18

Sequence Diagram

sequenceDiagram
    participant User
    participant applyAutoLayout
    participant constants.ts
    participant containers.ts
    participant layoutBlocksCore
    
    User->>applyAutoLayout: Call with blocks, edges, options
    applyAutoLayout->>constants.ts: Import DEFAULT_HORIZONTAL_SPACING (350)
    applyAutoLayout->>layoutBlocksCore: Layout root blocks with spacing=350
    layoutBlocksCore-->>applyAutoLayout: Root blocks positioned
    
    applyAutoLayout->>containers.ts: Call layoutContainers(blocks, edges, options)
    Note over containers.ts: Has duplicate constant<br/>DEFAULT_CONTAINER_HORIZONTAL_SPACING = 400
    containers.ts->>containers.ts: Use local constant (400)<br/>NOT from constants.ts (250)
    containers.ts->>layoutBlocksCore: Layout container children with spacing=400
    layoutBlocksCore-->>containers.ts: Container children positioned
    containers.ts-->>applyAutoLayout: Containers updated
    
    applyAutoLayout-->>User: Return layout result
    
    Note over constants.ts,containers.ts: BUG: Container spacing change<br/>from 400→250 has no effect!
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

* Default horizontal spacing for containers (tighter than root level)
*/
export const DEFAULT_CONTAINER_HORIZONTAL_SPACING = 400
export const DEFAULT_CONTAINER_HORIZONTAL_SPACING = 250
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: changing this constant has no effect because containers.ts:18 has a duplicate definition that shadows this export

Suggested change
export const DEFAULT_CONTAINER_HORIZONTAL_SPACING = 250
export const DEFAULT_CONTAINER_HORIZONTAL_SPACING = 250

The duplicate constant in containers.ts should import this value instead:

import { DEFAULT_CONTAINER_HORIZONTAL_SPACING } from '@/lib/workflows/autolayout/constants'
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/lib/workflows/autolayout/constants.ts
Line: 84:84

Comment:
**logic:** changing this constant has no effect because `containers.ts:18` has a duplicate definition that shadows this export

```suggestion
export const DEFAULT_CONTAINER_HORIZONTAL_SPACING = 250
```

The duplicate constant in `containers.ts` should import this value instead:
```typescript
import { DEFAULT_CONTAINER_HORIZONTAL_SPACING } from '@/lib/workflows/autolayout/constants'
```

How can I resolve this? If you propose a fix, please make it concise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants