Skip to content
Source
Sign inSign up
pingdotgg/t3code

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

Mergedjuliusmarmingemerged 4 commits intosidebar/mobile-active-order fromrefs/pull/9731/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

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 threadAfter: the row follows the insertion gap
Before: Active row stays in placeAfter: Active row reorders with a section hint
Before: idle sidebarAfter: idle sidebar, without Pinned or Active headings
Before: idle sidebarAfter: 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](https://cursor.com/bugbot) for commit d68f19b8a655d670b7566b6901594a7ae13f5ae6. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

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.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. github-actions[bot](GitHub profile, opens in a new tab)commented

      Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

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

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire—13.6 KiB—15.1 KiB✅
      CodexThread snapshot wire—7.0 KiB—7.3 KiB✅
      CodexLive turn WebSocket wire—6.6 KiB—7.8 KiB✅
      CodexLive turn WebSocket decoded—57.1 KiB—66.4 KiB✅
      CodexLive turn messages—10—21✅
      ClaudeTotal thread wire—13.6 KiB—15.1 KiB✅
      ClaudeThread snapshot wire—7.0 KiB—7.3 KiB✅
      ClaudeLive turn WebSocket wire—6.5 KiB—7.8 KiB✅
      ClaudeLive turn WebSocket decoded—57.8 KiB—66.4 KiB✅
      ClaudeLive 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.

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      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](https://app.macroscope.com/pingdotgg/settings/billing). You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

      Fix All in Cursor Bugbot Autofix is [ON](https://www.cursor.com/dashboard/bugbot), but a cloud agent failed to start. Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit d2c3f461c5bfbee80ff37ef951516be5e66b88e6. Configure [here](https://www.cursor.com/dashboard/bugbot).
      apps/web/src/components/Sidebar.tsx line 3028Resolvedby juliusmarminge
      apps/web/src/components/Sidebar.tsx line 3174Resolvedby juliusmarminge
    5. 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.

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

    7. juliusmarminge merged this4023d93

    8. juliusmarminge closed this

Sign in to join this conversation.