fix: sync activeWorkflow with canvas changes for AI refinement#390
Merged
breaking-brake merged 1 commit intomainbreaking-brake/cc-wf-studio:mainfrom Jan 6, 2026
fix/388-sync-activeWorkflow-with-canvasbreaking-brake/cc-wf-studio:fix/388-sync-activeWorkflow-with-canvasCopy head branch name to clipboard
Merged
fix: sync activeWorkflow with canvas changes for AI refinement#390breaking-brake merged 1 commit intomainbreaking-brake/cc-wf-studio:mainfrom fix/388-sync-activeWorkflow-with-canvasbreaking-brake/cc-wf-studio:fix/388-sync-activeWorkflow-with-canvasCopy head branch name to clipboard
breaking-brake merged 1 commit intomainbreaking-brake/cc-wf-studio:mainfrom
fix/388-sync-activeWorkflow-with-canvasbreaking-brake/cc-wf-studio:fix/388-sync-activeWorkflow-with-canvasCopy head branch name to clipboard
Conversation
- Added useEffect to update activeWorkflow when nodes/edges change - Ensures AI refinement always sees current canvas state - Uses updateActiveWorkflowMetadata to avoid infinite loop Fixes #388
Merged
|
🎉 This PR is included in version 3.12.7 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Problem
When the AI Refinement panel is open and users modify the canvas (add/remove/edit nodes), the AI receives stale workflow information from when the panel was opened.
Current Behavior
Expected Behavior
Root Cause
nodes/edgesandactiveWorkfloware two independent state sources. Canvas modifications updatenodes/edges, butactiveWorkflowremains stale. The AI refinement feature reads fromactiveWorkflow, not directly fromnodes/edges.Solution
Add a
useEffectinApp.tsxthat synchronizesactiveWorkflowwhenevernodesoredgeschange. This follows the same pattern as #384 (conversation history sync).Key Implementation Details
useRefto track previousnodes/edgesreferences to prevent unnecessary updatesupdateActiveWorkflowMetadatainstead ofsetActiveWorkflowto avoid infinite loops (the latter also updatesnodes/edges, which would trigger the effect again)Changes
File:
src/webview/src/App.tsxserializeWorkflowimportnodes,edges,workflowName,workflowDescription,subAgentFlowsto store destructuringuseEffecthook to sync canvas changes toactiveWorkflowImpact
Testing
npm run format && npm run lint && npm run check)npm run build)Related
🤖 Generated with Claude Code