Skip to content

fix(web): threads in the Working section can be dragged into Pinned - #28119

Open
Info-Cado wants to merge 1 commit into
pingdotgg:mainfrom
Info-Cado:fix/working-threads-drag-to-pin
Open

Info-Cado wants to merge 1 commit into
pingdotgg:mainfrom
Info-Cado:fix/working-threads-drag-to-pin

Conversation

@Info-Cado

Copy link
Copy Markdown
Contributor

Problem

With the Working section expanded, a thread in it cannot be dragged into Pinned. The row stays put, no drop labels appear, and nothing is pinned on release. Thread menu > Pin already allows the same action, so the drag was the only way that failed. Fixes #28117.

Change

  • Drop planner: a thread lifted from Working can now be pinned. Other drops stay blocked, for two reasons. Live status would put a thread dropped on the inbox straight back in Working, and the server refuses to settle a running thread.
  • Drag handling: a Working drag is now a normal sidebar drag, not always a drag to the composer. It gets the row lift, the auto-scroll, the Pinned and Active labels and the Pin badge. Dragging outside the list to a composer still works, through the same path as other rows.
  • Preview: rows make room for the labels while a Working row is lifted, and the Working shelf closes in the preview when its last thread is pinned. The Active and Settled placeholders stay hidden, because those drops do nothing.
  • Drop hold: Working counts as active in the check that holds a dropped row in place, because server state has no Working section.

Scope and approval

This changes a deliberate rule from #19697, which stopped all sidebar moves from Working because the section follows live status. Pinning fits that reasoning: pins outrank Working, so a pinned thread stays in Pinned and keeps its Working status. The fix qualifies as a small, focused bug fix: it brings the drag in line with the existing Pin menu action, on web and desktop. Mobile has no drag from this section, so it is not affected.

Verification

Focused tests in Sidebar.logic.test.ts and Sidebar.drag.test.ts cover the pin plan, the blocked drops, the label room and the shelf closing. vp run check:changed passes.

I also ran the whole app in headless Chromium against apps/web/test/fakeEnvironment.ts, with running threads, pointer events and a 500 ms server delay. That throwaway test is not in this PR.

Check Result
Before the fix: drag to Pinned Row stays in Working, no pin command
Drag to Pinned Row lifts, shows Pin, sends thread.pin at the spot
After the drop No layout change in any frame for 1.4 s, row keeps its Working status
Pin the last Working thread Shelf closes
Drop on an inbox row or Settled Nothing moves, no command sent
Server refuses the pin Row returns to Working, "Failed to pin thread" toast
Drag to a composer Reference chip added, sidebar unchanged
Labels during the lift No overlap with rows (without the fix: overlap on 2 rows)

Not checked: a live server, the Electron app, or touch input. The test used the Chromium build on my machine, not the one this Playwright version pins.

Before: dragging After: dragging After: dropped
Before After, dragging After, dropped

🤖 Generated with Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-31T11:57:03.729421Z
We couldn’t complete this review. Comment @codex review to try again.
fcfb2b6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Oct 31, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at fcfb2b6

Macroscope's review found this PR approvable — Working threads can now be dragged into Pinned, with updated previews and destination hints. The change uses existing pin operations and keeps other section drops blocked, limiting its effects to user-directed sidebar organization.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

Working-thread drags now use sidebar sorting and can be dropped into Pinned. The sidebar updates drag targeting, optimistic drop state, and drop hints. Tests and documentation describe the updated behavior.

Changes: Working Thread Drag and Pinning

Layer / File(s) Summary
Working drag projection
apps/web/src/components/Sidebar.drag.ts, apps/web/src/components/Sidebar.tsx, apps/web/src/components/Sidebar.drag.test.ts
The sorting strategy projects Working-thread drags when no drop target is resolved. It uses the Working-thread count when projecting the Working header. Tests check preview offsets.
Working thread pin drop
apps/web/src/components/Sidebar.logic.ts, apps/web/src/components/Sidebar.logic.test.ts, apps/web/src/components/Sidebar.tsx
Working-thread drops into Pinned now plan a pin operation. The sidebar updates drag targeting, optimistic source sections, and drop hints. Tests cover the pin plan and unsupported targets.
Documented Working-thread placement
docs/user/thread-sidebar.md
The documentation states that Working threads can be dragged into Pinned but not other sections.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related issues

  • pingdotgg/t3code#27669 concerns sidebar auto-scroll during thread drags. This PR changes Working drags to use normal sidebar drag handling, but the summaries do not show changes to auto-scroll behavior.

Suggested reviewers: maria-rcks, t3dotgg

Merge Risk: Minimal · up to c1cec

Working threads can be dragged into Pinned. No material merge-blocking risk was established.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Out of Scope Changes check Warning The current pull request also changes behavior unrelated to issue #28117. Sidebar.tsx adds disconnected-environment filtering for the Working shelf, resets scroll on project-scope changes, changes s… Remove the unrelated Sidebar.tsx and Sidebar.logic.ts behavior changes from this pull request, or move them to a separate pull request. Keep only the Working drag implementation, its focused tests, and directly related documentation.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: allowing threads in the Working section to be dragged into Pinned.
Description check Passed The description includes all required sections. It explains the problem, change, scope and approval, verification results, limitations, screenshots, and the agent used.
Linked Issues check Passed Issue #28117 requires Working-to-Pinned drag support, normal sidebar drag feedback, pinning at the drop position, and blocked drops to other sections. The reviewed head permits only the Working-to-Pin…
Full details: Linked Issues check

Explanation

Issue #28117 requires Working-to-Pinned drag support, normal sidebar drag feedback, pinning at the drop position, and blocked drops to other sections. The reviewed head permits only the Working-to-Pinned plan in planSidebarThreadDrop, uses normal sidebar drag handling, preserves the Working status during the optimistic drop, and includes focused tests for the plan, blocked drops, label space, and shelf closing. The incremental changes do not show a removal of this behavior.

Full details: Out of Scope Changes check

Explanation

The current pull request also changes behavior unrelated to issue #28117. Sidebar.tsx adds disconnected-environment filtering for the Working shelf, resets scroll on project-scope changes, changes shelf-motion animation, changes search-popup focus behavior, reorders project badges, changes the sidebar list role, and changes the Settled load-more row. These changes do not support Working-to-Pinned dragging or its required tests.

Resolution

Remove the unrelated Sidebar.tsx and Sidebar.logic.ts behavior changes from this pull request, or move them to a separate pull request. Keep only the Working drag implementation, its focused tests, and directly related documentation.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ast-grep (0.51.1)

ast-grep could not parse rule config: /ast-grep-rules/ast-grep-essentials/rules/javascript/security/no-deprecated.yml

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 068fc3c and c1cec4d.

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; 9 remain after this review.

@juliusmarminge juliusmarminge added bugfix Fix PR opened by an issue lead; enters the PR loop pr:needs-julius Needs Julius: route gate, unverifiable surface, or blocked labels Oct 31, 2026
@Info-Cado
Info-Cado force-pushed the fix/working-threads-drag-to-pin branch from fcfb2b6 to 068fc3c Compare October 31, 2026 19:11

maria-rcks commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Note

Written by gpt-6.1-sol on behalf of Maria

Verified in a real dev environment

verified as-is at 068fc3c11cee8c5b2b4b8d5e742d0ed079157d79 on a linux boat vm, using repository playwright and /usr/bin/google-chrome at 1440x1000.

  • reproduced on github/main (54c5f25249) in a separate worktree: dragging a running thread from working over pinned left it in working, without the pin badge.
  • installed both checkouts with vp i and ran one background vp run dev server at a time, with isolated task state. main was stopped before the pr server started.
  • added the real repository through the app and created real codex gpt-6.1-sol turns through the composer. no fake environment, replay provider, fixtures, or direct database edits. the same app-created threads were copied into the stopped pr environment for comparison.
  • on the exact pr head, the working row lifts, displays the pin badge, and lands in pinned while retaining its working status. pinning the last working thread closes the working shelf. the pin survives a browser reload.
  • unpinning returns the running thread to working. drops onto active or settled leave it in working. dragging it into another thread's composer adds a reference chip without pinning it.
  • both real provider turns on the pr completed with working ready. after about 3m 30s. the proxy showed transient provider retries before proceeding; neither turn stalled for ten minutes.
  • blacksmith ran vp test run apps/web/src/components/Sidebar.logic.test.ts apps/web/src/components/Sidebar.drag.test.ts: 127 tests passed across both files. the head has 28 successful ci contexts, zero pending, zero failing.

before: main leaves the running thread in working during the drag.

main: running thread stays in working

after: the same running thread is pinned.

pr: pinned thread retains working status

pr: working-to-pinned drag recording

pr: working thread reference in another composer

captures were inspected; uploaded video playback and seeking were checked. no code changes were needed. task-owned dev servers and the blacksmith worker were stopped.

Not verified

native electron, ios/android, macos/windows, touch input, other providers, relay/tunnel connections, multi-environment dragging, and server-rejected pin recovery were not exercised. this pass used the linux web client with codex through the local proxy. mobile has no corresponding working-section drag flow in this pr.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fix PR opened by an issue lead; enters the PR loop pr:needs-julius Needs Julius: route gate, unverifiable surface, or blocked size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Threads in the Working section cannot be dragged into Pinned

4 participants