Skip to content

feat(web): add drag-to-reorder for sidebar thread sections - #6069

Open
adhyaay-karnwal wants to merge 2 commits into
pingdotgg:mainfrom
adhyaay-karnwal:feat/sidebar-thread-drag-reorder
Open

feat(web): add drag-to-reorder for sidebar thread sections#6069
adhyaay-karnwal wants to merge 2 commits into
pingdotgg:mainfrom
adhyaay-karnwal:feat/sidebar-thread-drag-reorder

Conversation

@adhyaay-karnwal

@adhyaay-karnwal adhyaay-karnwal commented Aug 10, 2026

Copy link
Copy Markdown

Summary

  • Adds hold-and-drag reordering for active, snoozed, and settled sidebar threads with no visible drag handles (6px activation threshold keeps clicks working)
  • Persists per-section order locally via threadOrderBySection in UI state; pinned threads continue using server-synced pinOrderKey ordering
  • Updates user docs to describe the new behavior

Test plan

  • pnpm exec vitest run src/uiStateStore.test.ts (17 tests pass)
  • Hold and drag threads within the active inbox; order should stick after reload
  • Repeat for snoozed and settled shelves (expanded)
  • Confirm pinned thread drag still works and syncs when server supports reorder
  • Confirm plain clicks still navigate without accidental drags

Made with Cursor

Note

Add drag-to-reorder for active, snoozed, and settled sidebar thread sections

  • Wraps each sidebar thread section in a DndContext and SortableContext (via dnd-kit), allowing threads to be reordered by dragging within their section; cross-section drops are ignored.
  • Adds a reorderThreads pure function and store action in uiStateStore.ts that merges visible reordered ids with hidden thread positions to avoid losing filtered-out threads.
  • Per-section order is persisted to and restored from localStorage via threadOrderBySection in PersistedUiState.
  • Slim thread rows (snoozed/settled) gain drag transform styles and a dragging visual state (z-20 opacity-80); pinned rows continue to use the existing sortable path.
  • Behavioral Change: thread order in active, snoozed, and settled sections is now client-local, while pinned order continues to sync via the server.

Macroscope summarized a7652a6.

Users can hold and drag threads within active, snoozed, and settled sections without visible drag handles. Order persists locally per section while pinned threads keep server-synced ordering.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Aug 10, 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: 98cdd90b-e494-403c-85a0-ea476807e937

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:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 10, 2026
Comment thread apps/web/src/components/Sidebar.tsx

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

Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e9303dc. Configure here.

Comment thread apps/web/src/components/Sidebar.tsx
Snoozed and settled threads use the slim row variant, which returned before applying the dnd-kit sortable ref, listeners, and transform — so those sections could never be reordered.

Co-authored-by: Cursor <cursoragent@cursor.com>
@macroscopeapp

macroscopeapp Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces a new user-facing feature (drag-to-reorder for sidebar thread sections) with new state management and UI interactions. New features warrant human review to validate the behavior and user experience.

You can customize Macroscope's approvability policy. Learn more.

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