fix(block-name): updating block name should update downstream var refs#2592
Merged
icecrasher321 merged 2 commits intostagingfrom Dec 26, 2025
Merged
fix(block-name): updating block name should update downstream var refs#2592icecrasher321 merged 2 commits intostagingfrom
icecrasher321 merged 2 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Collaborator
Author
|
@greptile |
Contributor
Greptile SummaryFixed block name validation and downstream variable reference updates. The changes ensure duplicate names are rejected with error notifications, and variable references are properly updated when block names change.
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Editor
participant Hook as useCollaborativeWorkflow
participant Store as WorkflowStore
participant SubStore as SubBlockStore
participant Queue as OperationQueue
participant Socket
User->>Editor: Rename block (editedName)
Editor->>Editor: Trim name
alt Name unchanged
Editor->>Editor: Exit rename mode
else Name changed
Editor->>Hook: collaborativeUpdateBlockName(id, trimmedName)
Hook->>Hook: Trim and normalize name
alt Empty name
Hook->>Hook: Show error notification
Hook-->>Editor: {success: false, error}
Editor->>Editor: Keep rename mode open
else Duplicate name
Hook->>Hook: Check for conflicting blocks
Hook->>Hook: Show error notification
Hook-->>Editor: {success: false, error}
Editor->>Editor: Keep rename mode open
else Valid name
Hook->>Queue: executeQueuedOperation('update-name')
Queue->>Store: updateBlockName(id, trimmedName)
Store->>Store: Update block name
Store->>Store: Build regex for old block name
Store->>Store: Loop through all subblocks
Store->>Store: Update references recursively
Store->>SubStore: Update workflowValues
Store-->>Hook: {success: true, changedSubblocks: [...]}
alt Has changed subblocks
loop For each changed subblock
Hook->>Queue: addToQueue('subblock-update')
Queue->>Socket: Emit subblock-update
Socket-->>Queue: operation-confirmed
end
end
Hook-->>Editor: {success: true}
Editor->>Editor: Exit rename mode
end
end
|
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