Skip to content

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

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

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

Conversation

@Info-Cado

@Info-Cado Info-Cado commented Oct 31, 2026 •

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 https://git.cafe/pingdotgg/t3code/issues/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 https://git.cafe/pingdotgg/t3code/pulls/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

Fixes #28117

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

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

Working-thread drags now receive sidebar sorting projections and can be dropped into Pinned. The sidebar updates drag targeting, optimistic drop state, and drop hints. Tests cover projection offsets and pin planning. Documentation describes Working-thread placement.

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 uses the Working section as a fallback 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, docs/user/thread-sidebar.md
Working-thread drops into Pinned can plan a pin operation. The sidebar updates drag targeting, optimistic source sections, and drop hints. Tests and documentation describe the supported placement.

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

Change: Bug fix · Severity of issue fixed: Low

Possibly related PRs

  • pingdotgg/t3code#27341: Adds a Watching section and defines drag-source and drop-verb rules that share the Working-source contract.

Suggested reviewers: maria-rcks, t3dotgg

Merge Risk: Minimal · previous review d411a

This change lets users drag a running thread from Working into Pinned and keeps other drops from Working blocked. No actionable merge-blocking risk is identified from the supplied evidence.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: threads in the Working section can now be dragged into Pinned. It matches the changeset, which allows pinning a Working thread through the drop planner and sidebar dra…
Description check Passed The description follows the template sections: Problem, Change, Scope, and Verification. The Problem section states the bug and the expected behavior with a reference to issue #28117. The Change secti…
Linked Issues check Passed Issue #28117 is the only directly linked issue. Its coding requirements are: (1) a Working thread lifts and follows the pointer; (2) Pinned and Active labels appear; (3) the row shows the Pin badge; (…
Out of Scope Changes check Passed All changed areas connect to the Working-to-Pinned drag objective. Sidebar.logic.ts, Sidebar.tsx, and Sidebar.drag.ts implement the drop planning, drag classification, and preview behavior. The Sideba…
Full details: Title check

Explanation

The title names the main change: threads in the Working section can now be dragged into Pinned. It matches the changeset, which allows pinning a Working thread through the drop planner and sidebar drag handling. It uses a conventional commit prefix and is specific enough for a teammate to understand the primary change.

Full details: Description check

Explanation

The description follows the template sections: Problem, Change, Scope, and Verification. The Problem section states the bug and the expected behavior with a reference to issue #28117. The Change section explains the drop planner, drag handling, preview, and drop hold updates. The Scope section links the prior PR being changed and explains why the change qualifies as a small bug fix. The Verification section lists focused tests, a manual browser check with a results table, and items not checked. Reproduction environment is covered in the issue link and verification notes. The description has no separate model or harness attribution line beyond the generated-by note, and the template asks for the model and harness used by an agent. This is a minor gap that does not affect the overall assessment.

Full details: Linked Issues check

Explanation

Issue #28117 is the only directly linked issue. Its coding requirements are: (1) a Working thread lifts and follows the pointer; (2) Pinned and Active labels appear; (3) the row shows the Pin badge; (4) a drop on Pinned pins the thread at the drop position; (5) the pinned thread keeps its Working status. The whole-PR summary supports each point. Sidebar.logic.ts (+3/-1) permits a Working thread to pin and keeps other Working drops blocked. Sidebar.tsx no longer classifies Working-section drags as context drags, so they use normal sidebar drag handling. Sidebar.drag.ts accepts workingThreadCount and projects Working drags when there is no resolved target. Sidebar.drag.test.ts covers label clearance and shelf closing. Sidebar.logic.test.ts covers pin planning and blocked drops to Active and Settled. The PR description and the linked issue both describe the Pin badge and labels. Evidence is the summary and the PR description. I did not run the test suite or inspect the full diff for this assessment. The change since the previous reviewed head is not described in detail, so the assessment relies on the whole-PR summary. The result is PASS because the summary establishes each requirement.

Full details: Out of Scope Changes check

Explanation

All changed areas connect to the Working-to-Pinned drag objective. Sidebar.logic.ts, Sidebar.tsx, and Sidebar.drag.ts implement the drop planning, drag classification, and preview behavior. The Sidebar.drag.ts and Sidebar.logic.test.ts changes test those behaviors. docs/user/thread-sidebar.md (+2/-1) documents the same pin-from-Working rule. The summary shows no unrelated sidebar behavior changes. Composer-reference dragging stays on the same path, which the PR description and linked issue treat as existing behavior that must keep working. The result is PASS based on the whole-PR summary. I did not inspect the full diff, so line-level confirmation is not part of this assessment.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between ece5ba9 and d411a72.

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 claude-opus-5-5 on behalf of Maria

Takeover update at ece5ba984d

  • merged current main with a merge commit (no rebase). one conflict in Sidebar.tsx isContextDrag: kept main's new projectFolders !== null guard and its comment, and dropped the activeSection === "working" clause as this pr intends.
  • blacksmith ran vp run check:changed against main: format, lint, knip, typecheck, 6 test files and react compiler all pass.
  • coderabbit's out-of-scope warning is wrong: it diffed across an earlier base, and the pr's own commit only touches the drag logic, its tests, and the sidebar doc.
  • the drag was not re-run in a browser after the merge; the earlier pass below was by gpt-6.1-sol at 068fc3c.

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>
maria-rcks and others added 4 commits November 10, 2026 04:39
# Conflicts:
#	apps/web/src/components/Sidebar.tsx
…inned

Lifting a Working row opens label space below the pins. Moving up into that
space or onto the Active label already read as Pinned, so a drop meant for
Active pinned the thread. A Working row now reaches Pinned only above the
divider, where the pinned rows end; Active stays refused.

AI-assisted; verified with the tests and tools listed above.
The Working-row threshold used the divider's untransformed rect, which the
drag preview shifts down by the label height. The lower part of a visible
pin, and with no pins the whole Pinned label, refused the drop. Use the live
Active label's top instead, so everything above it pins and the label itself
stays refused.

AI-assisted; verified with the tests and tools listed above.
@juliusmarminge

Copy link
Copy Markdown
Member

The automated pipeline stopped on this pull request and will not merge it:

in the real app the problem is still there, and the rework changed nothing:

No code change; the report describes the fix working, and the remaining visual point comes from the sidebar's normal drag behaviour. Per the report, base leaves Running task unpinned in Working, and head shows section labels and a Pin badge, then pins it below Existing pin while the turn keeps running. Releases over Active and Settled return it to Working with no empty-section hints, which is intended because Working rows cannot move there. On the overlap: I reproduced the steps at 0b880d2 in the real web app (isolated scenario server, Chromium 1280x800, a replay turn held running) and logged element positions. With the pointer at Existing pin's lower edge (y=203), the preview slot is below Existing pin (the Active label moved down to 295 to open a card-height slot), matching where the drop lands. The lifted Running task card spans y=162-244 because the dragged row follows the pointer from its grab point (its centre), so it covers Existing pin's title and branch; the frame right after release is the card animating into its slot. On the same build, an ordinary Active thread dragged to the same pointer position gives identical results: card at 162-244 over Existing pin, the same release frame, and the same final slot below Existing pin. That path predates this PR, so the overlap is not something this fix introduced, and changing it would mean changing drag feedback for every sidebar section.

It stays open for a person to finish or close.

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 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