Skip to content

feat: add ComponentTree devtools for DX improvement#675

Closed
Sourojitbanerjee wants to merge 1 commit intostudiometa:developfrom
Sourojitbanerjee:feat/component-tree-devtools
Closed

feat: add ComponentTree devtools for DX improvement#675
Sourojitbanerjee wants to merge 1 commit intostudiometa:developfrom
Sourojitbanerjee:feat/component-tree-devtools

Conversation

@Sourojitbanerjee
Copy link

🔗 Linked issue

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

📝 Checklist

  • I have linked an issue or discussion.
  • I have added tests (if possible).
  • I have updated the documentation accordingly.
  • I have updated the changelog.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 });
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

if (!parentData.children) parentData.children = [];
parentData.children.push(componentData);
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

@titouanmathis
Copy link
Contributor

Thanks for the PR, a similar feature is already in the work in #654.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments