fix(web): Working threads can be dragged into chat as references again#19697
With Working section (beta) on, you could not drag a thread from the Working section into a composer to reference it. The drag never started. Rows in every other section worked. Fixes #16137.
The Working section follows live status, so its rows must not move between sidebar sections. That rule was enforced by turning off drag for the whole row, which also killed the reference gesture.
Fix
Working rows can be picked up again and use the existing drag-to-composer path. Sidebar movement stays off: the drop planner returns no move for a thread lifted from Working, and no reorder preview or section target shows while one is dragged. Mobile has no drag-to-composer gesture, so it is not affected.
Credit
This is a takeover of #15269 by @NikitaMGrimm, rebased onto current main. The commit keeps Nikita as the author. If squashed, please keep:
Co-authored-by: Nikita Maximilian Grimm <github@nikitagrimm.de>
Verification
vp test run apps/web/src/components/Sidebar.logic.test.ts apps/web/src/components/Sidebar.pointer.test.ts: 180 passed. The 3 new tests (Working thread dropped on a pinned, active, and settled row) fail when the planner guard is removed.apps/webtypecheck clean. Lint and format clean on changed lines.- Recordings below are from the original PR's browser run (Working status simulated). I did not re-run it in a live client.
Reference dragging:
https://github.com/user-attachments/assets/76cb3db3-c295-4388-a4c5-58e4035b7936
Sidebar movement remains disabled:
https://github.com/user-attachments/assets/c7606525-6a94-4ff0-a50c-7a85288ba47d
Reviewed with sol-loop: 1 round with GPT-6.1 Sol. Sol verdict: approved
Note
🤖 Original change by @NikitaMGrimm with GPT-6.1 Sol in Codex. Takeover with Claude Opus 5.5 in Claude Code (T3 Code).
🤖 Generated with Claude Code
Checks
Approvability
Verdict: Approved at 4c306b7
Macroscope's review found this PR approvable — This is a focused web bug fix that restores Working-thread reference dragging through the existing context-drag path while keeping sidebar reordering disabled. The production behavior change is isolated to sidebar drag handling and is covered by targeted tests, with no schema, deployment, security, billing, or configuration impact.
You can add or adjust custom eligibility rules. Learn more.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Team
- Run ID:
f56d6cd0-e740-4222-8f5d-69a5734298d6
📥 Commits
Reviewing files that changed from the base of the PR and between 6cac280eb2834fa44e0f1816e26cea4d329a8e65 and 4c306b7ff959da5356f0dcd74f90e7b7fe4e7de7.
📒 Files selected for processing: 3
apps/web/src/components/Sidebar.logic.test.tsapps/web/src/components/Sidebar.logic.tsapps/web/src/components/Sidebar.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
📝 Walkthrough
Working-section rows can now be dragged as chat context. Drops from those rows do not produce sidebar movement plans. Tests cover drops over pinned, active, and settled rows.
Changes: Working thread drag behavior
Layer / File(s) Summary Working-thread drag handling
apps/web/src/components/Sidebar.logic.ts,apps/web/src/components/Sidebar.tsx,apps/web/src/components/Sidebar.logic.test.tsWorking rows can start context drags when other conditions allow. These drags suppress sidebar movement previews and disable auto-scroll. The drop planner returns no move plan for Working-section sources. Tests cover drops over pinned, active, and settled rows. Priority: ➖ Normal
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers:
juliusmarminge
Merge Risk: ⚪ Minimal · up to 4c306
The change appears ready to merge after normal checks; no actionable merge-blocking issue was identified.
Pre-merge checks: Passed 4
Check name Status Explanation Title check Passed The title clearly and concisely describes the main fix: restoring drag-to-composer references for Working threads. Description check Passed The description explains the problem, fix, scope, linked issue, verification results, and evidence. It does not use every template heading exactly, but it provides the required information and is suff… Linked Issues check Passed Issue #16137requires a Working-section thread to drag into another thread's textbox as a reference.Sidebar.tsxnow allows Working rows to start the existing context drag. It suppresses sidebar mov…Out of Scope Changes check Passed The changes are limited to Working-row context dragging, suppression of sidebar movement, and focused planner tests. These changes directly support issue #16137. No unrelated change is identified.Full details: Description check
Explanation
The description explains the problem, fix, scope, linked issue, verification results, and evidence. It does not use every template heading exactly, but it provides the required information and is sufficiently complete.
Full details: Linked Issues check
Explanation
Issue
#16137requires a Working-section thread to drag into another thread's textbox as a reference.Sidebar.tsxnow allows Working rows to start the existing context drag. It suppresses sidebar movement previews and section targets.Sidebar.logic.tsreturns{ kind: "none" }for Working drag sources. Tests cover pinned, active, and settled targets.
✨ Finishing Touches
📝 Generate docstrings
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
- Commit to this branch
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
Thread transfer impact
✅ Thread transfer remains within every enforced ceiling.
| Provider | Metric | Main baseline | This PR | Impact | PR ceiling | |
|---|---|---|---|---|---|---|
| Codex | Total thread wire | 5.0 KiB | 5.0 KiB | 0 B (0.0%) | 6.8 KiB | ✅ |
| Codex | Thread snapshot wire | 3.8 KiB | 3.8 KiB | 0 B (0.0%) | 4.9 KiB | ✅ |
| Codex | Live turn WebSocket wire | 1.2 KiB | 1.2 KiB | 0 B (0.0%) | 2.0 KiB | ✅ |
| Codex | Live turn WebSocket decoded | 20.9 KiB | 20.9 KiB | 0 B (0.0%) | 29.3 KiB | ✅ |
| Codex | Live turn messages | 2 | 2 | 0 (0.0%) | 8 | ✅ |
| Claude | Total thread wire | 5.0 KiB | 5.0 KiB | 0 B (0.0%) | 6.8 KiB | ✅ |
| Claude | Thread snapshot wire | 3.8 KiB | 3.8 KiB | 0 B (0.0%) | 4.9 KiB | ✅ |
| Claude | Live turn WebSocket wire | 1.2 KiB | 1.2 KiB | 0 B (0.0%) | 2.0 KiB | ✅ |
| Claude | Live turn WebSocket decoded | 21.2 KiB | 21.2 KiB | 0 B (0.0%) | 29.3 KiB | ✅ |
| Claude | Live turn messages | 2 | 2 | 0 (0.0%) | 8 | ✅ |
Baseline: ab3a3cd · PR result: 6cac280 · Source CI: success
Scenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 108.5 KiB
- Claude decoded thread snapshot: 108.8 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
Added 1 commit
- fix(web): allow Working threads to be dragged into chat as references4c306b7