fix(web): Working threads can be dragged into chat as references again#19697

merged1
main
fix/working-thread-references-takeover
opened26d agobyTtheo
View on GitHubTwo-way sync enabledPR last imported 21d ago

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/web typecheck 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

24 successful · 11 skipped
All checks passed
4c306b7
Synced from GitHub

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.

Synced from GitHub

Review in Change Stack →

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.ts
  • apps/web/src/components/Sidebar.logic.ts
  • apps/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.ts
Working 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 nameStatusExplanation
Title checkPassedThe title clearly and concisely describes the main fix: restoring drag-to-composer references for Working threads.
Description checkPassedThe 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 checkPassedIssue #16137 requires a Working-section thread to drag into another thread's textbox as a reference. Sidebar.tsx now allows Working rows to start the existing context drag. It suppresses sidebar mov…
Out of Scope Changes checkPassedThe 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 #16137 requires a Working-section thread to drag into another thread's textbox as a reference. Sidebar.tsx now allows Working rows to start the existing context drag. It suppresses sidebar movement previews and section targets. Sidebar.logic.ts returns { 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.

Synced from GitHub

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ProviderMetricMain baselineThis PRImpactPR ceiling
CodexTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
CodexLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
CodexLive turn WebSocket decoded20.9 KiB20.9 KiB0 B (0.0%)29.3 KiB✅
CodexLive turn messages220 (0.0%)8✅
ClaudeTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
ClaudeLive turn WebSocket decoded21.2 KiB21.2 KiB0 B (0.0%)29.3 KiB✅
ClaudeLive turn messages220 (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