feat(settings): added snap to grid slider to settings#2504
Merged
waleedlatif1 merged 3 commits intostagingfrom Dec 21, 2025
Merged
feat(settings): added snap to grid slider to settings#2504waleedlatif1 merged 3 commits intostagingfrom
waleedlatif1 merged 3 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
217b816 to
b860077
Compare
Contributor
Greptile SummaryThis PR adds a configurable snap-to-grid feature for the workflow canvas, allowing users to set grid snapping from 0px (off) to 50px through a slider control in settings. Key changes:
Minor issues:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant SettingsUI as Settings Modal
participant Slider as Slider Component
participant Hook as useUpdateGeneralSetting
participant API as Settings API
participant DB as Database
participant Store as Zustand Store
participant Workflow as Workflow Component
User->>SettingsUI: Opens settings modal
SettingsUI->>Hook: useGeneralSettings()
Hook->>API: GET request
API->>DB: SELECT from settings table
DB-->>API: Return user settings
API-->>Hook: Return settings data
Hook->>Store: syncSettingsToZustand()
Store-->>SettingsUI: Display current value
User->>Slider: Drags slider to 20px
Slider->>SettingsUI: onValueChange([20])
SettingsUI->>SettingsUI: setLocalSnapValue(20)
Note over SettingsUI,Slider: Optimistic UI update
User->>Slider: Releases slider
Slider->>SettingsUI: onValueCommit([20])
SettingsUI->>Hook: mutateAsync with new value
Hook->>API: PATCH request
API->>API: Validate with Zod
API->>DB: INSERT or UPDATE settings
DB-->>API: Confirmation
API-->>Hook: Response
Hook->>Store: syncSettingsToZustand()
Store->>Store: Update snapToGridSize
SettingsUI->>SettingsUI: setLocalSnapValue(null)
Store-->>Workflow: snapToGridSize updated
Workflow->>Workflow: useMemo recalculates snapGrid
Workflow->>Workflow: snapToGrid enabled
Note over Workflow: ReactFlow now snaps nodes to grid
|
.../[workspaceId]/w/components/sidebar/components/settings-modal/components/general/general.tsx
Show resolved
Hide resolved
Collaborator
Author
|
@greptile |
Collaborator
Author
|
@greptile |
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
Type of Change
Testing
Tested manually
Checklist