Skip to content

Conversation

@neelasha-writer
Copy link
Collaborator

@neelasha-writer neelasha-writer commented Jan 26, 2026

Previously merged PR had no functionality to actually delete the component subtree of blueprints. I added a listener in the BuilderSidebarComponentTree for a delete event in BuilderSidebarComponentTreeBranch which calls the function to delete the subtree, this mimics the pattern in BuilderCodeSidePanel to delete python files

Summary by CodeRabbit

  • New Features

    • Right-click delete option added to builder sidebar tree, enabling users to remove a component and its nested subtree.
    • UI now exposes a delete action that can be triggered from branch context menus.
  • Bug Fixes / Improvements

    • Delete actions reliably propagate through nested tree items; parent/child removals behave predictably.
    • Deletion is now gated by permissions to prevent unauthorized removals.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 26, 2026

📝 Walkthrough

Walkthrough

Branches in the component tree now expose a right-click dropdown with a Delete action that emits a delete(componentId) event; delete events are forwarded up the tree and handled by BuilderSidebarComponentTree.vue, which calls removeComponentSubtree from useComponentActions.

Changes

Cohort / File(s) Summary
Component tree root
src/ui/src/builder/sidebar/BuilderSidebarComponentTree.vue
Added @delete="handleComponentDelete" bindings, destructured removeComponentSubtree from useComponentActions, and implemented handleComponentDelete(componentId) to call removeComponentSubtree.
Component tree branches & UI
src/ui/src/builder/sidebar/BuilderSidebarComponentTreeBranch.vue
Added right-click dropdown options (Delete), import/type for WdsDropdownMenuOption, new rightClickDropdownOptions constant, handleDropdownSelect to emit delete when allowed, and forwarding of child delete events to parent.
Composable API (usage)
src/ui/src/builder/composables/... (useComponentActions)
useComponentActions return value consumed by the tree now includes removeComponentSubtree (call-site updated; underlying composable return was extended).

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Branch as BuilderSidebarComponentTreeBranch
    participant Tree as BuilderSidebarComponentTree
    participant Actions as useComponentActions

    User->>Branch: right-click → select "Delete" (componentId)
    Branch->>Branch: handleDropdownSelect -> emit delete(componentId)
    Branch-->>Tree: forward delete(componentId)
    Tree->>Actions: handleComponentDelete(componentId)
    Actions-->>Tree: removeComponentSubtree(componentId)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • madeindjs

Poem

🐰 I peered at branches, three-dots in sight,
A hop, a click — the subtree takes flight.
I nudge the menu, send delete on its way,
Roots rearranged for a brighter day.
Hooray — tidy trees, I bound and play! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat-AB-939 improve delete bp visibility' directly addresses the main change: adding delete visibility for blueprints in the component tree.
Linked Issues check ✅ Passed The PR implements the proposed solution from AB-939 by adding a delete action via dropdown menu in the component tree for blueprints.
Out of Scope Changes check ✅ Passed All changes are focused on implementing blueprint deletion visibility via the component tree, directly aligned with AB-939 requirements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/ui/src/builder/sidebar/BuilderSidebarComponentTreeBranch.vue`:
- Around line 218-221: The delete emission in handleDropdownSelect isn't guarded
so a delete action could remove protected components; update
handleDropdownSelect to first check the deletion permission (use the existing
isDeleteAllowed flag/function) and only call emits("delete", props.componentId)
when isDeleteAllowed returns true (or is truthy), otherwise ignore the action or
emit a safe fallback; ensure you reference handleDropdownSelect,
isDeleteAllowed, emits and props.componentId when adding the conditional check.

@UladzislauK-Writer UladzislauK-Writer force-pushed the feat-AB-939-improve-delete-bp-visibility branch from 7f4c688 to 0e139d8 Compare January 27, 2026 07:18
@neelasha-writer neelasha-writer merged commit 85f5230 into dev Jan 28, 2026
17 checks passed
@neelasha-writer neelasha-writer deleted the feat-AB-939-improve-delete-bp-visibility branch January 28, 2026 15:25
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.

4 participants