feat(web): reorder active sidebar threads - #8666
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0597ba4128
ℹ️ 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".
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR adds a new drag-and-drop workflow for active threads, browser-persisted ordering, lifecycle handling, and navigation integration across the sidebar. The behavior is user-initiated and locally scoped, but the implementation is broad enough to warrant human review. You can add or adjust custom eligibility rules. Learn more. |
There was a problem hiding this comment.
Reviewed the sidebar thread-reordering change for consistency with the existing pinned-drag pattern. The DnD composition, nested-list markup, sensors, modifiers, and the reorderThreads store logic all mirror the established pinned/project contracts. Two interaction concerns from extending the sortable row bag to the whole active inbox are noted inline.
Posted via Macroscope — UI Consistency
There was a problem hiding this comment.
One finding on the new active-thread drag block: moving the inbox rows into a nested list drops them out of the sidebar's auto-animate parent. The two issues flagged on the previous commit (unstable sortable bag defeating SidebarThreadRow's memo, and the rename input being a drag activator) both look addressed.
Posted via Macroscope — UI Consistency
Problem
Pinned threads can be dragged into a custom order, but active unpinned threads are locked to creation order. That makes it hard to keep the current work queue arranged intentionally.
Fix
This also addresses the filtered-project data-loss issue identified on the earlier closed implementation in #8039.
Evidence
drag-before.mp4
drag-after.mp4
Verification
vp test run src/uiStateStore.test.ts src/components/Sidebar.logic.test.ts --passWithNoTests --project unit(134 tests passed)vp run --filter @t3tools/web typecheckBuilt by GPT-5.6 Sol via the Codex harness in T3 Code.
Note
Low Risk
UI-only ordering in local persistence with unit tests; no server contract changes, aside from delete fallback navigation using the visible order.
Overview
Active unpinned threads can now be drag-reordered in the sidebar (same whole-row interaction as pinned threads). Order is saved in browser
localStoragevia newthreadOrder/threadOrderAnchorByIdstate andreorderThreads, not synced across devices?docs call this out vs server-synced pinned order.resolveActiveThreadOrderkeeps a saved layout only when each thread?s order anchor still matches; new or reactivated threads appear above the saved list. Reordering while a project filter hides threads preserves slots for hidden IDs so positions aren?t lost when the filter clears.The active list is wrapped in dnd-kit with auto-animate paused during drag to avoid double motion. Search, jump shortcuts, and traversal use the custom active order because
orderedThreadsincludes reordered actives. After delete,getFallbackThreadIdAfterDelete/deleteThreadtakepreferredThreadKeysso navigation follows sidebar order, not creation sort. Rename inputsstopPropagationon pointer down so drags don?t start while editing titles.Reviewed by Cursor Bugbot for commit 98da5ea. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add drag-to-reorder for active sidebar threads with browser persistence
threadOrderandthreadOrderAnchorByIdin uiStateStore.tsresolveActiveThreadOrdermerges new or reactivated threads ahead of the saved order when anchors mismatch, so stale persisted orders are corrected on loadreorderThreadscomputes deterministic state updates that preserve positions of hidden threads and append newly visible ones without slotsgetFallbackThreadIdAfterDeleteanduseThreadActions.deleteThreadnow accept a preferred active order so post-delete navigation respects the current UI orderSortableThreadRowgeneralizes the previous pinned-only row wrapper for both pinned and active sections; auto-animate is paused during drag to avoid double animationsdeleteThreadmust passpreferredThreadKeysto get the new behaviorMacroscope summarized 98da5ea.