Skip to content

feat(web): drag threads across sections with consistent motion - #9731

Merged
juliusmarminge merged 4 commits into
sidebar/mobile-active-orderfrom
sidebar/drag-sections
Sep 6, 2026
Merged

feat(web): drag threads across sections with consistent motion#9731
juliusmarminge merged 4 commits into
sidebar/mobile-active-orderfrom
sidebar/drag-sections

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Sep 4, 2026

Copy link
Copy Markdown
Member

Only pinned threads previously had direct drag reordering. Threads can now move between Pinned, Active, and Settled, wake by dragging out of Snoozed, and keep the chosen position within Pinned or Active. Section hints appear during the drag without adding idle headers or moving the list at pickup.

A single sortable list keeps the dragged row and insertion gap continuous across section boundaries. Ordinary thread actions retain their section-change animations, including the card/compact fade, while drag completion avoids a second layout transition. Reduced-motion preferences are respected.

Older servers retain pinned reordering without settlement support. Drop planning reserves hidden order keys, and marker IDs cannot collide with scoped thread IDs.

Verified with 207 focused sidebar tests, web typecheck, targeted lint, and an integrated browser pass covering Active reordering, pin/unpin, and Settle/Un-settle. Recordings use disposable seeded threads. Web and desktop share this sidebar; mobile controls are in the preceding PR.

Before: dragging an Active thread After: the row follows the insertion gap
Before: Active row stays in place After: Active row reorders with a section hint
Before: idle sidebar After: idle sidebar, without Pinned or Active headings
Before: idle sidebar After: idle sidebar without drag hints

Active reorder recordings: before, after.

Pinning and unpinning by drag:

https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/1caa2d3fcb56a1d0/web-cross-sections-final.mp4

Restored Settle and Un-settle animations:

https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/faabc7dac953ecb1/web-section-actions.mp4

Depends on #9730.

Prepared with Codex.


Note

Medium Risk
Large interaction surface touching pin/settle/snooze lifecycle and order-key persistence with optimistic concurrency, but logic is heavily unit-tested and gated on server capabilities.

Overview
Cross-section drag replaces pinned-only reordering: one DndContext and sortable list spans Pinned, Active, Settled, and Snoozed (wake on drag out; no drop into snooze). Section headers, dividers, and empty placeholders are sortable markers so the gap and drop targets stay continuous.

New Sidebar.drag and Sidebar.logic plumbing resolves destinations (resolveSidebarDropTarget), plans server writes (planSidebarThreadDrop — pin, unpin, settle, active reorder), and previews row state (applySidebarThreadDrop). Custom collision detection handles invalid targets and empty Pins; a custom sorting strategy projects layout across section boundaries (collapsed settled shelf, route row visibility, etc.).

Motion and animation: @formkit/auto-animate is removed in favor of Sidebar.motion for post-action section moves (with reduced-motion and drag suspend). animateSidebarLayoutChanges avoids double animation after drop. Active list order now follows activeOrderKey via shared client-runtime sort helpers; drops call reorderActiveThread when the server exposes threadActiveReorder.

Optimistic optimisticDrop generalizes the old pinned-order hold across section moves and key writes until canonical state catches up. UI shows drag destination hints and boundary labels only while dragging.

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

Note

Add cross-section thread dragging with consistent motion to sidebar

  • Adds dragging threads between Pinned, Active, Snoozed, and Settled sections. The drop planner generates lifecycle commands, and an optimistic projector previews the thread in its destination before server confirmation.
  • Introduces createSidebarListMotion in Sidebar.motion.ts to animate retained rows with 150ms ease-out translations, fade entering and exiting rows, and honor reduced-motion preferences.
  • Replaces pinned-only DnD utilities with a unified sortable list in Sidebar.tsx spanning all sections, including structural markers and empty-section placeholders as drop targets.
  • Risk: sortThreadsForSidebar now uses the client-runtime Active order-key sorter instead of the previous timestamp-and-id comparator, and activeThreadAnchorTimestampMs is removed from the threadSort re-export surface.

Macroscope summarized 33e70c4.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Sep 4, 2026
@juliusmarminge
juliusmarminge marked this pull request as ready for review September 4, 2026 17:47
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.6 KiB 15.1 KiB
Codex Thread snapshot wire 7.0 KiB 7.3 KiB
Codex Live turn WebSocket wire 6.6 KiB 7.8 KiB
Codex Live turn WebSocket decoded 57.1 KiB 66.4 KiB
Codex Live turn messages 10 21
Claude Total thread wire 13.6 KiB 15.1 KiB
Claude Thread snapshot wire 7.0 KiB 7.3 KiB
Claude Live turn WebSocket wire 6.5 KiB 7.8 KiB
Claude Live turn WebSocket decoded 57.8 KiB 66.4 KiB
Claude Live turn messages 9 21

Baseline: unavailable · PR result: e908032 · 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: 113.9 KiB
  • Claude decoded thread snapshot: 114.6 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@macroscopeapp

macroscopeapp Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds cross-section drag-and-drop with persistent reordering and lifecycle mutations, while replacing the sidebar's drag and animation architecture. Because it changes existing ordering behavior and can issue multiple state-changing server commands, the scope and runtime impact require human review.

Not approved because:

  • Monthly spending limit reached (workspace setting). Approvability relies on correctness review in order to determine eligibility

Review your spending limits in Billing settings. You can add or adjust custom eligibility rules. Learn more.

@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 default effort and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix is ON, but a cloud agent failed to start.

Reviewed by Cursor Bugbot for commit d2c3f46. Configure here.

Comment thread apps/web/src/components/Sidebar.tsx
Comment thread apps/web/src/components/Sidebar.tsx
Comment thread apps/web/src/components/Sidebar.tsx Outdated
Comment thread apps/web/src/components/Sidebar.logic.ts
Comment thread apps/web/src/components/Sidebar.logic.ts Outdated
@cursor

cursor Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@cursor

cursor Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@juliusmarminge
juliusmarminge merged commit 4023d93 into main Sep 6, 2026
34 of 46 checks passed
@juliusmarminge
juliusmarminge deleted the sidebar/drag-sections branch September 6, 2026 18:10
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Sep 6, 2026
## What's Changed
* fix(web): show Tux icon for WSL environments by @UtkarshUsername in pingdotgg/t3code#8511
* perf(web): speed up folder menu sorting by @AksharP5 in pingdotgg/t3code#10190
* style(web): fix inconsistencies in new settings layouts by @extoci in pingdotgg/t3code#10177
* feat(threads): persist manual active thread order by @juliusmarminge in pingdotgg/t3code#9729
* feat(mobile): arrange active threads from both thread lists by @juliusmarminge in pingdotgg/t3code#9730
* feat(web): drag threads across sections with consistent motion by @juliusmarminge in pingdotgg/t3code#9731
* feat(web): simplify sidebar drag destination cues by @juliusmarminge in pingdotgg/t3code#9750
* fix(mobile): keep pending tasks queued when a send fails in flight by @juliusmarminge in pingdotgg/t3code#10245
* feat(mobile): show new-task drafts alongside pending tasks in the thread list by @juliusmarminge in pingdotgg/t3code#10260
* feat(mobile): allow several new-task drafts per project by @juliusmarminge in pingdotgg/t3code#10327
* fix(mobile): slide settled threads out before collapsing by @StiensWout in pingdotgg/t3code#10345


**Full Changelog**: pingdotgg/t3code@v0.0.39-nightly.20260906.1303...v0.0.39-nightly.20260906.1316

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.39-nightly.20260906.1316
BarretoDiego pushed a commit to BarretoDiego/t3code that referenced this pull request Sep 7, 2026
sheehanmunim added a commit to munimtechnologies/mtcode that referenced this pull request Sep 7, 2026
Adopts upstream's manual active-thread ordering (pingdotgg#9729) in place of the
fork's own implementation, per Sheehan's call. The decider now emits
upstream's `thread.meta-updated` with `activeOrderKey` and its guards
(reject deleted/pinned/settled, retain the snooze slot, leave updatedAt
alone). The fork's `thread.active-reordered` event is no longer emitted,
but its schema, projector, ProjectionPipeline and client reducer cases are
deliberately RETAINED: shipped fork databases contain those events and
replay must keep decoding them.

Conflict resolutions worth remembering:

- ProjectionSnapshotQuery: upstream's new `getTurnStartMessage` SELECT
  omitted the fork's message-correction columns that the shared row schema
  requires, so every turn start failed to decode (`MissingKey`) and took 14
  orchestration tests with it. Added original_text, correction_target_message_id,
  correction_replacement_text and delivery_state to the SELECT.
- ProviderCommandReactor: upstream moved turn-start lookups to the projection
  and switched the handler to a thread SHELL, which carries only a truncated
  objectivePreview. The fork's Goal Continuation needs the full Objective, so
  it re-reads the detail on that path only. `buildSendTurnRequestForThread`
  also loaded the whole transcript eagerly; it now uses the shell and defers
  the detail read to the hand-off prelude that actually needs it (this is what
  upstream's "without loading old message bodies" test asserts).
- ProviderRuntimeIngestion: the fork's nullable Continuation messageId flowed
  into upstream's non-null `getThreadMessageById`; guarded.
- OpenCodeAdapter: took upstream's `textPartsByMessageId` and dropped
  partById/emittedTextByPartId/completedAssistantPartIds (no remaining uses),
  keeping the fork's turns/context-window/compaction fields.
- Migrations: upstream's ProjectionThreadBranchPullRequest appended as fork id
  52; upstream's ProjectionThreadsActiveOrderKey NOT registered again — it is
  byte-identical to the fork's already-shipped id 43.
- MessagesTimeline.logic: restored the fork's checkpoint-readiness guard that
  upstream's relocated copy lacked, so Revert stays hidden until a checkpoint
  is ready; the two fork tests that drove this through the removed
  revertTurnCountByUserMessageId prop now build a real ready-checkpoint fixture.
- threadCommands: removed duplicate ReorderActiveThreadInput/reorderActiveThread
  declarations left by a keep-both resolution.
- Re-exported helpers upstream's Knip sweep privatized but the fork imports:
  activeThreadAnchorTimestampMs.
- Sidebar.tsx keeps the FORK's drag-and-drop subsystem (drag-to-snooze, overlay
  ghost, force-settle of a running thread, sidebarActiveThreadSortOrder) over
  upstream's pingdotgg#9731/pingdotgg#9750 rework; upstream's Sidebar.drag.ts/motion.ts are now
  referenced only by their own tests.
- Guard script: upstream pingdotgg#10101 deleted the client-side ThreadChangeRequestSnapshot
  atom the linked-PR check pointed at, so the check now follows the badge to its
  new server-provided source.

Verification: all packages typecheck; server orchestration+persistence 603/603,
client-runtime 1349/1349, contracts 393/393, web unit 4427 pass. The only web
failures are the two fork Goal e2e specs, confirmed failing identically on
backup/mtcode-pre-upstream-sync-20260906b.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ 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