Add configurable Sidebar V2 ordering #4702
main fromrefs/pull/4702/head·opened View on GitHubWhat Changed#
Adds an opt-in automatic ordering mode to Sidebar V2 on web/desktop and Thread List V2 on mobile.
- Keeps the existing newest-created-first order as the default.
- Adds a user-configurable group priority for Needs review, Working, and Other active.
- Orders Needs review by its latest attention event so recently finished work rises to the top.
- Clears completion/wake priority after that device opens the thread.
- Tracks mobile visits from navigation state so taps, deep links, restored routes, new tasks, and auxiliary thread screens behave consistently.
Closes #4695.
Why#
Sidebar V2 currently leaves recently completed work below agents that are still working. Automatic mode turns it into an attention queue while preserving the existing static behavior for users who prefer it.
This is one cross-platform preference and ordering model, but it necessarily touches both independently implemented clients. The diff is expected to receive size:XL; it is not presented as a small PR.
UI Changes#
Before: static creation order#
After: Needs review above Working#
Ordering controls#
Web sidebar result#
Short mobile interaction video
Verification#
pnpm exec vp test run apps/web/src/uiStateStore.test.ts packages/client-runtime/src/state/threadSnoozed.test.ts apps/web/src/components/Sidebar.logic.test.ts apps/mobile/src/features/threads/threadListV2.test.ts apps/mobile/src/features/threads/navigationThreadVisit.test.ts apps/mobile/src/state/preferences.test.ts packages/contracts/src/settings.test.ts apps/desktop/src/settings/DesktopClientSettings.test.ts— 8 files, 190 tests passed.- Targeted typechecks passed for
@t3tools/client-runtime,@t3tools/contracts,@t3tools/web,@t3tools/mobile, and@t3tools/desktop. - Targeted lint and formatting passed;
pnpm lint:mobileexited 0 (optional SwiftLint, ktlint, and detekt tools were not installed and were skipped). - Web integrated pass verified persisted automatic mode, configurable priority, and seeded sidebar ordering.
- iOS Simulator integrated pass verified settings persistence, review-first ordering, and visit-marker persistence for normal and auxiliary deep links.
Checklist#
- This PR is small and focused
- I explained what changed and why
- I included before/after screenshots for UI changes
- I included a video for interaction changes
Note
Add configurable Sidebar V2 thread ordering with automatic group classification#
- Adds two new client settings (
sidebarV2ThreadOrderModeandsidebarV2ThreadGroupOrder) that control whether threads are sorted by creation time or automatically grouped intoreview,working, andreadybuckets with user-configurable priority. - The automatic mode classifies threads based on unseen wakes, unseen completions, actionable proposed plans, and resolved status; within the
reviewgroup, threads are ordered by attention recency. - Adds settings UI on both web (BetaSettingsPanel.tsx) and mobile (SettingsRouteScreen.tsx) for toggling mode and reordering group priority.
- Mobile navigation now records per-thread last-visited timestamps into device-local preferences on startup and on every navigation state change, used to determine whether wakes/completions are unseen.
- Behavioral Change:
markThreadVisitedon web now stores a timestamp resolved byresolveThreadVisitTimestamprather than unconditionally usingserverThread.updatedAt.
📊 Macroscope summarized 7a0960a. 13 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted
🗂️ Filtered Issues#
No issues evaluated.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XL
- @@ -57,3 +70,4 @@5770 return null;5871 }597273+function AppNavigation(props: { readonly theme: Theme }) {
🟡 Medium
src/App.tsx:73Rapid consecutive navigation changes can silently lose thread visit records. If the user moves from thread A to thread B before
preferencesResultre-renders, both calls towriteThreadVisitread the same stalepreferencesResult.value.threadLastVisitedAtByKeymap.recordThreadVisitfor A adds A to that map and saves it;recordThreadVisitfor B adds B to the same old map (missing A) and saves it. The later save overwrites A's visit, leaving thread A classified as unseen even though the user just visited it. The stale render-time snapshot is the problem —writeThreadVisitshould accumulate from the latest optimistic preferences state or use an atomic updater rather than replacing the whole map from a closure value.🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/mobile/src/App.tsx around line 73: Rapid consecutive navigation changes can silently lose thread visit records. If the user moves from thread A to thread B before `preferencesResult` re-renders, both calls to `writeThreadVisit` read the same stale `preferencesResult.value.threadLastVisitedAtByKey` map. `recordThreadVisit` for A adds A to that map and saves it; `recordThreadVisit` for B adds B to the same old map (missing A) and saves it. The later save overwrites A's visit, leaving thread A classified as unseen even though the user just visited it. The stale render-time snapshot is the problem — `writeThreadVisit` should accumulate from the latest optimistic preferences state or use an atomic updater rather than replacing the whole map from a closure value. Closing this draft to restore the repository’s issue-first sequence for cross-client feature work. The implementation branch and media are preserved, but I will wait for explicit maintainer direction on #4695 before reopening or rebuilding an implementation PR. The current XL shape should not be treated as aligned merely because its automated checks passed.
saphid(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
aede7a33-1e4a-4e1f-b0f4-f6c2cd6784daYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
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