feat: add ComponentTree devtools for DX improvement#675
feat: add ComponentTree devtools for DX improvement#675Sourojitbanerjee wants to merge 1 commit intostudiometa:developfrom
Conversation
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| this.components.delete(id); | ||
| console.log(`➖ Component removed: ${component.name}`, { id }); | ||
| } | ||
| } |
There was a problem hiding this comment.
Bug: Incomplete Component Removal Causes Tree Inconsistency
The removeComponent method only deletes components from the components Map. It doesn't remove root components from this.tree or child components from their parent's children array. This leaves stale references, causing an inconsistent tree state, potential memory leaks, and incorrect tree visualization.
| if (!parentData.children) parentData.children = []; | ||
| parentData.children.push(componentData); | ||
| } | ||
| } |
There was a problem hiding this comment.
Bug: Redundant Tree Object Causes Inconsistent Data Model
The this.tree object is populated for root components but remains unused throughout the ComponentTree class. The actual component hierarchy, including root and child relationships, is managed and traversed via the this.components Map, making this.tree redundant and creating an inconsistent data model.
|
Thanks for the PR, a similar feature is already in the work in #654. |
🔗 Linked issue
❓ Type of change
📚 Description
📝 Checklist