Skip to content

feat(web): accept file drops into sidebar threads - #7892

Open
UtkarshUsername wants to merge 9 commits into
pingdotgg:mainfrom
UtkarshUsername:feat/sidebar-thread-file-drop
Open

feat(web): accept file drops into sidebar threads#7892
UtkarshUsername wants to merge 9 commits into
pingdotgg:mainfrom
UtkarshUsername:feat/sidebar-thread-file-drop

Conversation

@UtkarshUsername

@UtkarshUsername UtkarshUsername commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

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

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

ox-alpha via opencode

Note

[!NOTE]

Add file drop support to web sidebar thread rows

  • Adds sidebarPendingFileDropStore.ts to stage files dropped on a sidebar row until the target thread becomes active.
  • Sidebar.tsx updates SidebarThreadRow to highlight during drag-over and trigger handleThreadFileDrop, which stashes files and navigates to the target thread.
  • ChatView.tsx consumes the pending drop in ChatViewContent and forwards files to composerRef.current?.addDroppedFiles(files).
  • Clears pending drops in ChatThreadRouteView if the target thread resolves as missing.
  • Behavioral Change: Dropping files onto SidebarThreadRow now navigates to that thread and stages the files for attachment instead of ignoring the drop.

Macroscope summarized 8aefb76.


Note

Low Risk
UI-only drop/navigation handoff with a small Zustand stash; files still go through the existing composer attach path and are cleared if the thread is missing.

Overview
Lets users drag files from the OS onto any sidebar thread row. The thread opens and the files attach in its composer (same validation/compression/focus path as a workspace drop); nothing is sent automatically.

Rows reuse makeWorkspaceFileDropHandlers and highlight on hover. If the target thread is not already open, files are stashed in sidebarPendingFileDropStore until ChatView consumes them after navigation. Failed or missing-thread routes clear the stash so files cannot land on the wrong draft.

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

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)
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 729a4b64-a5ce-45c3-b122-30f62befe151

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 22, 2026
Comment thread apps/web/src/components/ChatView.tsx Outdated
Comment thread apps/web/src/components/Sidebar.tsx

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment thread apps/web/src/components/Sidebar.tsx Outdated
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)

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment thread apps/web/src/components/Sidebar.tsx Outdated
UtkarshUsername and others added 3 commits August 22, 2026 16:36
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)
@UtkarshUsername
UtkarshUsername marked this pull request as ready for review August 22, 2026 14:37
Comment thread apps/web/src/components/Sidebar.tsx
@macroscopeapp

macroscopeapp Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Skipped

Macroscope did not run approvability analysis for this PR. Macroscope could not determine whether this PR modifies its approvability configuration, so the PR was not approved automatically. A PR that may change the rules that govern approval is never approved automatically.

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)
Comment thread apps/web/src/routes/_chat.$environmentId.$threadId.tsx Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

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 using high effort 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 16be904. Configure here.

Comment thread apps/web/src/routes/_chat.$environmentId.$threadId.tsx
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)
@UtkarshUsername UtkarshUsername changed the title feat(web): sidebar thread rows accept file drops [WIP] feat(web): sidebar thread rows accept file drops Aug 22, 2026
@UtkarshUsername UtkarshUsername changed the title [WIP] feat(web): sidebar thread rows accept file drops feat(web): sidebar thread rows accept file drops Aug 22, 2026
@UtkarshUsername UtkarshUsername changed the title feat(web): sidebar thread rows accept file drops feat(web): accept file drops on sidebar thread rows Aug 22, 2026
@UtkarshUsername UtkarshUsername changed the title feat(web): accept file drops on sidebar thread rows feat(web): accept file drops into sidebar threads Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant