Repository navigation
feat(web): accept file drops into sidebar threads - #7892
Conversation
Dropping files from the OS onto a sidebar thread row now opens that thread and attaches the files in its composer, without sending. Rows reuse the workspace drop handlers (Files-type gate only), so pinned reordering and mention drags are unaffected. Files dropped on a row that is not the open thread are stashed and handed to the composer once the navigation lands; if the route bounces the stash is cleared. Ends with model/harness info: ox-alpha (opencode)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughSidebar thread rows now accept dropped files, queue them by thread, navigate to the target thread, and attach them to the composer after loading. Missing-thread cleanup removes stale drops. Tests and documentation cover the flow. ChangesSidebar file drop integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to Dropping files onto sidebar and search-result thread rows opens the target thread and attaches the files to its composer without sending them. Repeated drops and failed navigation cleanup preserve the intended files, with no remaining merge-readiness risk identified. Sequence Diagram(s)sequenceDiagram
participant User
participant SidebarThreadRow
participant Sidebar
participant Router
participant ChatView
participant Composer
User->>SidebarThreadRow: Drop files
SidebarThreadRow->>Sidebar: Forward thread ref and files
Sidebar->>Sidebar: Queue pending file drop
Sidebar->>Router: Navigate to thread
Router-->>ChatView: Activate thread
ChatView->>ChatView: Consume matching pending drop
ChatView->>Composer: Add dropped files
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
left a comment
There was a problem hiding this comment.
One finding: the new sidebar drag-over highlight uses a Tailwind color token that does not exist, so the ring falls back to currentColor and changes appearance per row state. Details inline.
Posted via Macroscope — UI Consistency
Move the pending-drop hooks above ChatView's no-active-thread early return so hook order cannot change when a thread opens or closes. Only clear the pending stash when it still belongs to the drop that missed its landing, so a newer drop is never wiped by an older navigation. Use the existing ring-ring token for the row highlight instead of the nonexistent ring-sidebar-ring. Ends with: ox-alpha (opencode)
left a comment
There was a problem hiding this comment.
One finding on the new drag-over highlight for sidebar thread rows: the outer ring is clipped by the row container's paint containment, leaving the drop target visually identical to hover. Details inline.
Posted via Macroscope — UI Consistency
The row li's content-visibility paint containment clips outer rings, so the drag-over affordance read as plain hover. Use an inset ring, the sidebar's own ring convention, tinted with primary to match the other file-drop surfaces instead of the focus-ring token. Ends with: ox-alpha (opencode)
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR adds a new file-drop workflow across sidebar rows, navigation, shared pending state, route handling, and composer attachment processing. Its cross-component runtime behavior and lifecycle coordination are broader than a small isolated UI change, so human review is appropriate. You can add or adjust custom eligibility rules. Learn more. |
The missing-thread redirect fires in an effect after navigation resolves, so the drop's landing check had already passed and the stash was never consumed or cleared. Clear it here, scoped to the dead thread, before navigating home. Ends with: ox-alpha (opencode)
An environment with no threads left leaves the route parked on the missing thread instead of redirecting home, so the stash survived. Move the release out of the redirect condition. Ends with: ox-alpha (opencode)
left a comment
There was a problem hiding this comment.
One finding on the new sidebar drop-target styling. The ring token/inset issues from the previous rounds look resolved (ring-1 ring-inset ring-primary/70 matches the composer's drop-target treatment and the inset ring is no longer clipped by the row's content-visibility: auto ancestor).
Posted via Macroscope — UI Consistency
The drag tint overrode an active/selected row's own background via twMerge, dimming the route cue on the most common drop target; apply it only to rows without a state surface. A rejected navigation also orphaned the stash with an unhandled rejection; clear it in a catch. Ends with: ox-alpha (opencode)
commented
Sep 8, 2026
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
commented
Sep 8, 2026
|
Note: GPT-6 on behalf of shivam (@shivamhwp). Two sidebar paths still ignore file drops:
Please connect search-result rows to the same attachment and navigation handler. For the legacy sidebar, either support the same behavior or explicitly document the limitation; the current docs promise drops onto "any thread row." |
commented
Sep 8, 2026
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
commented
Sep 8, 2026
|
Implemented the feature in the two sidebar paths. |
Closes #7396
What Changed
Each sidebar thread row (pinned, active, snoozed, settled) is now a drop target for files dragged from the OS. Dropping on a row opens that thread and attaches the files in its composer, ready to send; nothing is ever sent automatically. The row highlights while a file drag hovers over it.
Why
The chat workspace already accepts dropped files, but getting files into an older or background thread meant opening it first, then dragging again. Now one drag does it. Drop on the row, the thread opens, and the files ride the exact same composer path as a workspace drop, so validation, image compression, and focus behave identically.
Rows reuse the existing workspace drop handlers and only react to drags carrying real Files, so pinned-thread reordering and file-tree mention drags are untouched. When the dropped-on thread is not already open, the files are stashed briefly and handed to the composer once navigation lands; if the route bounces (thread gone), the stash is cleared instead of surprising the user later.
Video Demo
drag.mp4
Checklist
ox-alpha via opencode
Note
Add file drop support to sidebar threads in web app
SidebarThreadRowin Sidebar.tsx to accept files, highlight the row, and navigate to the target thread if needed.isSameSidebarThreadRefnow comparesenvironmentIdandthreadIdindependently to avoid colon-joined key collisions when matching thread references.Macroscope summarized 26ccad5.
Note
Medium Risk
Cross-component handoff depends on navigation timing and draft-promotion edge cases; a failed composer mount could leave files unstaged, but impact is limited to attachment UX.
Overview
Sidebar thread rows can now receive OS file drags: rows highlight during drag-over, and a drop opens that thread and attaches files in its composer (same validation/compression path as workspace drops—nothing auto-sends).
When the target thread is not already open, files are staged in a new
sidebarPendingFileDropStoreuntil navigation finishes;ChatViewthen callsaddDroppedFileson the composer once the active thread matches and the ref is ready (withrequestAnimationFrameretry and guards so draft-promotion / wrong-thread composers do not consume the stash).Sidebarclears the stash if navigation fails or the route does not land on the intended thread; the thread route also clears pending drops when the thread resolves as missing.User docs note the sidebar file-drop behavior; unit tests cover the pending-drop store.
Reviewed by Cursor Bugbot for commit f4a8be9. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
New Features
Documentation