Skip to content

feat(web): reorder active sidebar threads - #8666

Open
abcdmku wants to merge 3 commits into
pingdotgg:mainfrom
abcdmku:feat/unpinned-thread-reordering
Open

feat(web): reorder active sidebar threads#8666
abcdmku wants to merge 3 commits into
pingdotgg:mainfrom
abcdmku:feat/unpinned-thread-reordering

Conversation

@abcdmku

@abcdmku abcdmku commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

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

  • Make active unpinned sidebar rows sortable with the same whole-row drag interaction used by pinned threads.
  • Persist the active order in browser-owned UI state so it survives reloads without changing server contracts.
  • Keep new threads at the top until the user places them.
  • Preserve saved positions for threads hidden by a project filter, while new and reactivated threads return to the top.
  • Feed the custom order into search, jump shortcuts, selection, and fallback navigation so every sidebar path agrees.
  • Document that active ordering is local to the browser, while pinned ordering remains server-synced.

This also addresses the filtered-project data-loss issue identified on the earlier closed implementation in #8039.

Evidence

Before After
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 typecheck
  • Targeted lint passed for the changed TypeScript files
  • Formatting check passed for all changed files

Built 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 localStorage via new threadOrder / threadOrderAnchorById state and reorderThreads, not synced across devices?docs call this out vs server-synced pinned order.

resolveActiveThreadOrder keeps 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 orderedThreads includes reordered actives. After delete, getFallbackThreadIdAfterDelete / deleteThread take preferredThreadKeys so navigation follows sidebar order, not creation sort. Rename inputs stopPropagation on 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

  • Users can drag active, unpinned threads in the sidebar to set a preferred order; the order persists per-browser via threadOrder and threadOrderAnchorById in uiStateStore.ts
  • resolveActiveThreadOrder merges new or reactivated threads ahead of the saved order when anchors mismatch, so stale persisted orders are corrected on load
  • reorderThreads computes deterministic state updates that preserve positions of hidden threads and append newly visible ones without slots
  • getFallbackThreadIdAfterDelete and useThreadActions.deleteThread now accept a preferred active order so post-delete navigation respects the current UI order
  • SortableThreadRow generalizes the previous pinned-only row wrapper for both pinned and active sections; auto-animate is paused during drag to avoid double animations
  • Risk: deleting threads while a project filter is active now navigates to the first thread in the active UI order rather than the first sorted thread — callers in Sidebar.tsx and useThreadActions.ts are updated; out-of-tree consumers of deleteThread must pass preferredThreadKeys to get the new behavior

Macroscope summarized 98da5ea.

@coderabbitai

coderabbitai Bot commented Aug 29, 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: ae354cff-397a-486a-922a-ffab09535186

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

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 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 Completed 2026-08-29T16:54:08.759014Z 0597ba4 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 PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 29, 2026
Comment thread apps/web/src/components/Sidebar.tsx

@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: 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".

Comment thread apps/web/src/components/Sidebar.tsx Outdated
@macroscopeapp

macroscopeapp Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

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

Comment thread apps/web/src/components/Sidebar.tsx
Comment thread apps/web/src/components/Sidebar.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.

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

Comment thread apps/web/src/components/Sidebar.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant