Skip to content

feat(ui): allow multiselect in resource tabs#4094

Merged
TheodoreSpeaks merged 5 commits intostagingfrom
feat/shift-select-resource-tabs
Apr 10, 2026
Merged

feat(ui): allow multiselect in resource tabs#4094
TheodoreSpeaks merged 5 commits intostagingfrom
feat/shift-select-resource-tabs

Conversation

@TheodoreSpeaks
Copy link
Copy Markdown
Collaborator

@TheodoreSpeaks TheodoreSpeaks commented Apr 10, 2026

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

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

  • Local dev tested multiselect, persistence of closed tabs, etc.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Apr 10, 2026 7:07pm

Request Review

@TheodoreSpeaks
Copy link
Copy Markdown
Collaborator Author

@BugBot review

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 10, 2026

PR Summary

Medium Risk
Touches interactive tab selection/removal/drag-and-drop behavior and adds serialized bulk mutations, which could cause subtle UI state or persistence edge cases (selection reset, active tab fallback, partial failures). Scope is limited to client-side mothership resource tab/dropdown components.

Overview
Adds multi-select to resource-tabs (shift for ranges; cmd/ctrl to toggle) with visual highlighting, selection reset on chat switch, and smarter active-tab fallback when deselecting.

Enables multi-drag of selected tabs by emitting SIM_RESOURCES_DRAG_TYPE payloads (with a custom combined drag image) and bulk close of selected tabs via the close button or middle-click, persisting removals sequentially.

Updates AddResourceDropdown to support an excludeTypes blacklist and uses it to hide folder/task entries from the add-resource menu in mothership tabs.

Reviewed by Cursor Bugbot for commit 14364e8. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown

@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.

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 mutateAsync rejection so failures no longer cause unhandled promise rejections or abort remaining removals.

Create PR

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.

@TheodoreSpeaks TheodoreSpeaks marked this pull request as ready for review April 10, 2026 18:27
@TheodoreSpeaks
Copy link
Copy Markdown
Collaborator Author

@BugBot review

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 10, 2026

Greptile Summary

This 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 excludeTypes filter prop.

Confidence Score: 5/5

Safe 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

Filename Overview
apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-tabs/resource-tabs.tsx Adds multi-select (Shift+click range, Cmd/Ctrl+click toggle), multi-resource drag with a custom ghost image, and multi-close; stale selectedIds/anchorIdRef after single-tab removal is a minor cleanup gap.
apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/add-resource-dropdown/add-resource-dropdown.tsx Adds optional excludeTypes prop to filter resource groups from the dropdown; implementation is clean with a stable module-level constant passed from the caller to avoid memo churn.

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]
Loading

Reviews (1): Last reviewed commit: "Try catch resource tab deletion independ..." | Re-trigger Greptile

Copy link
Copy Markdown

@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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

@TheodoreSpeaks TheodoreSpeaks merged commit 266bc21 into staging Apr 10, 2026
12 checks passed
@TheodoreSpeaks TheodoreSpeaks deleted the feat/shift-select-resource-tabs branch April 10, 2026 19:20
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.

1 participant