feat(ui): allow multiselect in resource tabs#4094
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
@BugBot review |
PR SummaryMedium Risk Overview Enables multi-drag of selected tabs by emitting Updates Reviewed by Cursor Bugbot for commit 14364e8. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Unhandled rejection aborts serialized multi-remove mutations
- I updated the serialized multi-remove loop to catch each
mutateAsyncrejection so failures no longer cause unhandled promise rejections or abort remaining removals.
- I updated the serialized multi-remove loop to catch each
Or push these changes by commenting:
@cursor push fb5008467e
Preview (fb5008467e)
diff --git a/apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-tabs/resource-tabs.tsx b/apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-tabs/resource-tabs.tsx
--- a/apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-tabs/resource-tabs.tsx
+++ b/apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-tabs/resource-tabs.tsx
@@ -272,11 +272,13 @@
if (persistable.length > 0) {
void (async () => {
for (const r of persistable) {
- await removeResource.mutateAsync({
- chatId,
- resourceType: r.type,
- resourceId: r.id,
- })
+ await removeResource
+ .mutateAsync({
+ chatId,
+ resourceType: r.type,
+ resourceId: r.id,
+ })
+ .catch(() => undefined)
}
})()
}This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
...ace/[workspaceId]/home/components/mothership-view/components/resource-tabs/resource-tabs.tsx
Show resolved
Hide resolved
|
@BugBot review |
Greptile SummaryThis PR adds multi-select to resource tabs — Shift+click for contiguous range selection and Cmd/Ctrl+click for individual toggle — along with multi-resource drag using a composite ghost image and bulk close. It also fixes folder/task entries appearing in the add-resource dropdown by introducing an Confidence Score: 5/5Safe to merge; the one finding is a minor UX edge case where shift+click silently degrades to a plain click after closing a singly-selected tab. All findings are P2. The stale selectedIds/anchorIdRef issue has no visible rendering impact and only mildly affects the next shift+click after a single-tab close. Core multi-select, drag, and bulk-close logic is sound. No files require special attention beyond the cleanup suggestion in resource-tabs.tsx. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Tab Click] --> B{Modifier key?}
B -->|Shift| C{Anchor exists?}
C -->|Yes| D[Select contiguous range\nanchorIdRef → anchorIdx]
C -->|No| E[Plain click\nSet anchor]
B -->|Cmd / Ctrl| F{Tab already selected?}
F -->|Yes| G[Deselect tab\nFallback onSelect if active]
F -->|No| H[Add tab to selection\nUpdate anchor if none]
B -->|None| E
A2[Close X or Middle-click] --> I{isMulti?\nselectedIds has tab AND size > 1}
I -->|Yes| J[Remove all selected tabs\nClear selectedIds + anchor]
I -->|No| K[Remove single tab\n⚠ selectedIds/anchor NOT cleared]
A3[Drag start] --> L{Multi-drag?\nselected > 1 AND tab in selection}
L -->|Yes| M[Set SIM_RESOURCES_DRAG_TYPE\nBuild composite ghost image\nDisable internal reorder]
L -->|No| N[Set SIM_RESOURCE_DRAG_TYPE\nEnable internal reorder]
Reviews (1): Last reviewed commit: "Try catch resource tab deletion independ..." | Re-trigger Greptile |
...ace/[workspaceId]/home/components/mothership-view/components/resource-tabs/resource-tabs.tsx
Show resolved
Hide resolved
...ace/[workspaceId]/home/components/mothership-view/components/resource-tabs/resource-tabs.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8cb4354. Configure here.


Summary
Allow multiselect of resource tabs using the shift modifier, and selecting individual resources using command modifier. After selection, you can drag to the mothership chat or click the x button/mouse 3 to close all tabs.
Fixed bug where motherhship tasks and folders showed up in the side bar. Added params to blacklist certain resource to the resource menu
Type of Change
Testing
Checklist
Screenshots/Videos