Skip to content

feat(web): drag sidebar threads between categories - #8001

Open
tarik02 wants to merge 30 commits into
pingdotgg:mainfrom
tarik02:feature/sidebar-dnd-upstream
Open

feat(web): drag sidebar threads between categories#8001
tarik02 wants to merge 30 commits into
pingdotgg:mainfrom
tarik02:feature/sidebar-dnd-upstream

Conversation

@tarik02

@tarik02 tarik02 commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

What Changed

  • Allow dragging threads between Pinned, Regular, Snoozed, and Settled on web and desktop.
  • Apply the destination state on drop. Pinned preserves the chosen position; other categories use their normal sort order. Dropping into Snoozed opens the existing duration menu.
  • Replace the pinned-only sorter with one flat dnd-kit board. dnd-kit handles sortable transforms, auto-scroll compensation, the drag overlay, and drop animation.
  • Keep the source slot and viewport stable while category geometry changes.
  • Use the existing lifecycle commands. Their deciders clear conflicting pinned, settled, and snoozed state atomically, without adding a command or event.
  • Keep mobile lifecycle menus consistent with the category rules.

Why

The sidebar previously allowed reordering only inside Pinned.

The diff is larger than a normal UI patch because the old pinned-only implementation lived inside Sidebar.tsx. This PR moves drag state, collision handling, pinned ordering, viewport anchoring, and board rendering into focused modules. The resulting design is documented in docs/internals/sidebar-thread-dnd.md.

UI Changes

Before: drag and drop only reordered threads within Pinned.

After:

recording-a377fc69-049a-472c-9a65-b0a7aa970521.mp4

The recording covers pinned reorder, moves between every category, the snooze menu, card-to-compact morphing, auto-scroll, and viewport stability.

Verification

  • Targeted lint passed.
  • @t3tools/web typecheck passed.
  • 128 focused sidebar and lifecycle tests passed.
  • Manually tested pinned reorder, pin/unpin, settle/unsettle, snooze selection and cancellation, collapsed categories, auto-scroll, and drop animations.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Model: GPT-5.6-sol
Harness: Codex in T3 Code


Note

High Risk
Changes orchestration event emission for pin/settle/snooze (companion cleanup events) and re-pin order-key behavior, plus a large interactive sidebar rewrite. Event consumers and racey pin reorders can behave differently.

Overview
Lets users drag threads between Pinned, Regular, Snoozed, and Settled on web. Dropping applies the destination lifecycle command; Pinned keeps the chosen slot, other sections snap to their normal sort. Dropping into Snoozed opens the duration menu. The old pinned-only sorter is replaced by a single dnd-kit board with overlay morphing, auto-scroll, and viewport anchoring.

Server lifecycle commands now treat those categories as exclusive. Pin, settle, snooze, and their reverses emit companion cleanup events so a thread lands in one shelf. Re-pinning with an orderKey now applies that placement instead of ignoring it. Snooze toasts/menus say Wake rather than Undo, matching that Wake no longer restores a previous category.

Mobile row menus follow the same rules: snooze is offered from the rendered category, and snoozed rows only Wake.

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

Note

Add drag-and-drop support for sidebar threads across categories

  • Introduces a new sidebar DnD system via SidebarThreadBoard, SidebarThreadDndShell, and useSidebarThreadDnd that lets users move threads between Pinned, Regular, Snoozed, and Settled sections.
  • Adds optimistic pinned reordering and cross-section insertion logic in useSidebarPinnedDnd, with scroll stabilization via useSidebarDndLayout.
  • Updates server orchestration in decider.ts so lifecycle commands emit companion cleanup events (e.g., thread.unsettled, thread.unsnoozed) to normalize threads to a single category.
  • Modifies mobile thread row menus in thread-list-v2-items.tsx to show "Wake" instead of "Undo" and conditionally includes snooze actions.
  • Risk: decider.ts now emits additional events for lifecycle commands, which may break out-of-tree consumers expecting a single event per command. Re-pinning with an orderKey now overwrites an existing pinOrderKey.

Macroscope summarized 8e613a3.

@tarik02 tarik02 changed the title Feature/sidebar dnd upstream feat(web): drag sidebar threads between categories Aug 23, 2026
@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 99f93bb2-aec6-4fa7-9cb2-e8e7fd60ba7f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@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 Aug 23, 2026
Comment thread apps/web/src/hooks/useSidebarPinnedDnd.ts Outdated
Comment thread apps/server/src/orchestration/decider.ts

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

UI consistency review of the new sidebar drag-and-drop surfaces. Two findings, both in newly added web UI code; everything else (primitive reuse, ScrollArea/SidebarContent viewportRef contract, Tailwind ownership, reduced-motion handling, drag-preview geometry vs. contain-intrinsic-size) looks consistent with the existing system.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/sidebar/SidebarThreadBoard.tsx Outdated
Comment thread apps/web/src/components/sidebar/SidebarThreadDnd.tsx Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 399a71d142

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/web/src/hooks/useSidebarThreadDnd.ts
Comment thread apps/web/src/hooks/useSidebarThreadDnd.ts Outdated
Comment thread apps/server/src/orchestration/decider.ts
@macroscopeapp

macroscopeapp Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR introduces a large new cross-category drag-and-drop system with custom collision handling, optimistic persistence, viewport management, and server lifecycle/event changes. Its scope and unresolved risks around compatibility and multi-step state updates warrant human review.

Not approved because:

  • 2 blocking correctness issues found at or above your repo's Minimum Blocking Severity

Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more.

Comment thread apps/web/src/hooks/useSidebarThreadDnd.ts
Comment thread apps/web/src/hooks/useSidebarPinnedDnd.ts Outdated

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

One finding on the new sidebar drag board: the empty-section drop rail is missing for Snoozed, so an empty Snoozed section presents differently from the other three sections during a drag.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/sidebar/SidebarThreadBoard.tsx
Comment thread apps/web/src/hooks/useSidebarPinnedDnd.ts
Comment thread apps/web/src/components/sidebar/SidebarThreadBoard.tsx

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

One finding on the latest commit's removal of the empty Regular drop rail. The previously reported empty-Snoozed rail inconsistency (SidebarThreadBoard.tsx, snoozed boundary) is unchanged and still stands — not re-commented.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/sidebar/SidebarThreadBoard.tsx Outdated

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

UI consistency review of the sidebar drag-and-drop rework. The two items I raised on the previous head were addressed (aria-expanded now tracks the real shelf state via a separate dropActive presentation flag, and the grab cursor now lands on the [data-thread-row] surface). One earlier finding is still open (empty Snoozed renders a shelf header instead of the dashed EmptySectionRail the other three sections get — see the existing thread on SidebarThreadBoard.tsx), plus one new note below on coverage for the newly extracted pure drag logic.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/Sidebar.dnd.logic.ts
Comment thread apps/web/src/components/sidebar/SidebarThreadBoard.tsx Outdated

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

Reviewed the sidebar drag-and-drop UI for shared-primitive usage, Tailwind ownership, and interaction/accessibility preservation. The Regular boundary droppable and the missing pure-logic tests flagged earlier are addressed. One accessibility regression remains in the new board structure.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/sidebar/SidebarThreadBoard.tsx

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

One finding: the sidebar un-settle affordance loses its shared Tooltip, reverting a recently merged fix and diverging from the sibling icon buttons in the same row.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/Sidebar.tsx Outdated
Comment thread apps/server/src/orchestration/decider.ts
Comment thread apps/server/src/orchestration/decider.ts Outdated

@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 high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8e613a3. Configure here.

const pinnedPlan = current.action === "pin" ? planPinnedInsertion(current) : null;
if (current.action === "pin" && pinnedPlan === null) {
finishTransaction();
return;

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.

Silent pin drop abort

Medium Severity

Dropping a thread into Pinned can abort after the drop animation with no error toast when planPinnedInsertion returns null. That happens when neighbor key rematerialization includes a global pinned row (including settled-but-still-pinned) whose environment lacks threadPinReorder, even though the dragged thread itself can pin. The row snaps back and the pin never commits.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 8e613a3. Configure here.

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