improvement: auto-focus canvas on newly added nodes#392
Merged
breaking-brake merged 1 commit intomainbreaking-brake/cc-wf-studio:mainfrom Jan 6, 2026
improvement/auto-focus-on-added-nodebreaking-brake/cc-wf-studio:improvement/auto-focus-on-added-nodeCopy head branch name to clipboard
Merged
improvement: auto-focus canvas on newly added nodes#392breaking-brake merged 1 commit intomainbreaking-brake/cc-wf-studio:mainfrom improvement/auto-focus-on-added-nodebreaking-brake/cc-wf-studio:improvement/auto-focus-on-added-nodeCopy head branch name to clipboard
breaking-brake merged 1 commit intomainbreaking-brake/cc-wf-studio:mainfrom
improvement/auto-focus-on-added-nodebreaking-brake/cc-wf-studio:improvement/auto-focus-on-added-nodeCopy head branch name to clipboard
Conversation
- Add ReactFlowProvider wrapper in main.tsx - Track lastAddedNodeId in workflow-store - Create useAutoFocusNode hook with setCenter animation - Apply to both WorkflowEditor and SubAgentFlowDialog 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Merged
braking-brake-semantic-release Bot
pushed a commit
that referenced
this pull request
Jan 6, 2026
## [3.12.8](v3.12.7...v3.12.8) (2026-01-06) ### Bug Fixes * handle multiple JSON blocks in AI response parsing ([#393](#393)) ([29c01bf](29c01bf)) ### Improvements * add node name constraint to AI refinement prompts ([#394](#394)) ([055d254](055d254)) * auto-focus canvas on newly added nodes ([#392](#392)) ([7c1856c](7c1856c))
|
🎉 This PR is included in version 3.12.8 🎉 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 adding a node to the canvas, users cannot easily locate the newly added node, especially when:
Current Behavior
Expected Behavior
Solution
Implement auto-focus functionality using React Flow's
setCenter()method with smooth animation.Changes
New File:
src/webview/src/hooks/useAutoFocusNode.tslastAddedNodeIdstatesetCenter()with 300ms animationFile:
src/webview/src/main.tsxReactFlowProviderto enableuseReactFlow()hookFile:
src/webview/src/stores/workflow-store.tslastAddedNodeIdstate trackingaddNode()to setlastAddedNodeId, auto-select node, and open property panelclearLastAddedNodeId()actionFile:
src/webview/src/components/WorkflowEditor.tsxuseAutoFocusNodehookFile:
src/webview/src/components/dialogs/SubAgentFlowDialog.tsxuseAutoFocusNodehook for SubAgentFlow editingImpact
Testing
npm run format && npm run lint && npm run check)npm run build)🤖 Generated with Claude Code