Repository navigation
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:
✨ 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. Comment |
| return null; | ||
| } | ||
|
|
||
| function AppNavigation(props: { readonly theme: Theme }) { |
There was a problem hiding this comment.
🟡 Medium src/App.tsx: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.
🤖 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. |
What Changed
Adds an opt-in automatic ordering mode to Sidebar V2 on web/desktop and Thread List V2 on mobile.
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.@t3tools/client-runtime,@t3tools/contracts,@t3tools/web,@t3tools/mobile, and@t3tools/desktop.pnpm lint:mobileexited 0 (optional SwiftLint, ktlint, and detekt tools were not installed and were skipped).Checklist
Note
Add configurable Sidebar V2 thread ordering with automatic group classification
sidebarV2ThreadOrderModeandsidebarV2ThreadGroupOrder) that control whether threads are sorted by creation time or automatically grouped intoreview,working, andreadybuckets with user-configurable priority.reviewgroup, threads are ordered by attention recency.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.