fix(ui): resource tab fixes, add search to workspace modal#4166
fix(ui): resource tab fixes, add search to workspace modal#4166TheodoreSpeaks merged 5 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Makes resource removal more atomic and robust: the Enhances the workspace switcher dropdown for large accounts with search + keyboard navigation (autofocus, arrow-key highlight, enter-to-switch), and adds cmd/ctrl-click or middle-click to open a workspace in a new tab. Reviewed by Cursor Bugbot for commit 7e8833a. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThis PR adds a workspace search bar with keyboard navigation to the workspace switcher dropdown, fixes resource tab auto-switching behavior on send/abort, implements multi-select delete for resource tabs with optimistic client-side removal, and adds auto-scroll to bring the active resource tab into view. The changes are well-structured and follow the existing patterns. All findings are minor P2 suggestions. Confidence Score: 5/5Safe to merge — all findings are P2 style/UX suggestions with no correctness or data-integrity issues. The core logic for multi-select delete, workspace search, keyboard navigation, and tab auto-scroll is sound. PostgreSQL row locking makes concurrent resource deletions safe server-side, and TanStack Query's workspace-header.tsx has two minor UX polish items (magic number threshold, highlight state leaking). Important Files Changed
Sequence DiagramsequenceDiagram
participant U as User
participant RT as ResourceTabs
participant UC as useChat
participant RQ as React Query Cache
participant API as /api/mothership/chat/resources
Note over U,API: Multi-select tab delete
U->>RT: Click × on selected tab (N tabs selected)
RT->>UC: onRemoveResource(type, id) × N (loop)
UC->>UC: setResources batched → single render
RT->>RT: setSelectedIds(remove deleted)
loop for each non-ephemeral target
RT->>RQ: removeResource.mutate({chatId, type, id})
RQ->>RQ: onMutate → optimistic remove from cache
RQ->>API: DELETE /resources {chatId, type, id}
API->>API: SQL UPDATE JSONB (row-locked, atomic)
API-->>RQ: {success, resources}
RQ->>RQ: onSettled → invalidateQueries(detail)
end
Note over U,API: Workspace search + keyboard nav
U->>RT: Opens workspace dropdown
RT->>RT: setHighlightedIndex(0) + rAF focus
U->>RT: Types search query
RT->>RT: filter workspaces by name
U->>RT: ArrowDown / ArrowUp
RT->>RT: setHighlightedIndex(±1 mod len)
U->>RT: Enter key
RT->>RT: onWorkspaceSwitch(filteredWorkspaces[highlightedIndex])
Reviews (1): Last reviewed commit: "Add search bar to workspace modal" | Re-trigger Greptile |
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 b95c255. Configure here.

Summary
Added search to workspace modal. Allows users with tons of workspaces to easily query by name.
Also added resource tab improvements:
Type of Change
Testing
Checklist
Screenshots/Videos