GeezerVison is showing github.com — Sort sidebar projects and threads by recency by juliusmarminge · Pull Request #1372 · pingdotgg/t3code
Conversation
juliusmarminge
commented
Mar 24, 2026
•
edited by macroscopeapp
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
- Added configurable sidebar sort orders for projects and threads, with new app settings defaults.
- Implemented shared sidebar sorting logic that ranks projects and threads by recency, falling back to creation time or manual order where appropriate.
- Updated the sidebar UI to use the new ordering, disable drag reordering outside manual mode, and add a sort menu for changing project/thread sort behavior.
- Added tests covering the new settings defaults and sidebar sorting behavior.
Testing
- Not run (PR content only).
- Added unit coverage for sidebar project/thread sorting logic in
apps/web/src/components/Sidebar.logic.test.ts.
- Added settings schema/default coverage in
apps/web/src/appSettings.test.ts and store coverage in apps/web/src/store.test.ts.
Note Medium Risk
Changes sidebar ordering behavior and gates drag-and-drop reordering behind a new setting, which could affect navigation expectations and any code relying on previous stable ordering.
Overview
Adds configurable sidebar sorting for projects and threads. New app settings sidebarProjectSortOrder and sidebarThreadSortOrder (default updated_at) are introduced and covered by tests.
Sidebar rendering now uses shared helpers (sortProjectsForSidebar, sortThreadsForSidebar) to order by latest user message recency with fallbacks to updatedAt/createdAt (or manual order for projects), and ensures the active thread stays visible in the collapsed preview.
Projects/threads now carry createdAt/updatedAt from the server read model into local Project/Thread state, the sidebar UI adds a sort menu, disables drag reordering unless in manual mode, and animates list changes via @formkit/auto-animate.
Written by Cursor Bugbot for commit a3bb36c. This will update automatically on new commits. Configure here.
Note
Sort sidebar projects and threads by recency with configurable sort order
- Adds
sortProjectsForSidebar and sortThreadsForSidebar functions in Sidebar.logic.ts that order items by latest user message timestamp, falling back to updatedAt/createdAt.
- Introduces
sidebarProjectSortOrder and sidebarThreadSortOrder app settings (default updated_at) with a new ProjectSortMenu UI in the sidebar header to change them.
- Propagates
createdAt/updatedAt from the server read model into Project and Thread state objects so sort timestamps are available.
- Adds
@formkit/auto-animate to animate list reordering; drag-and-drop manual reordering is disabled unless the sort order is set to Manual.
- Collapsed thread lists now always include the active thread even if it falls beyond the preview limit.
Macroscope summarized a3bb36c.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
- Add configurable project and thread sidebar sort orders
- Keep manual project reordering when enabled
- Animate sidebar list updates and cover new sort logic with tests
coderabbitai
Bot
commented
Mar 24, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
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
Run ID: 120b7f4d-a36b-4dc8-bf5c-39eba48cf0ab
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:
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch
t3code/updated-sort-order
Comment @coderabbitai help to get the list of available commands and usage tips.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Avoid cloning thread arrays before sorting
- Cache loaded project favicons across sidebar renders
- Update sidebar sort labels for clearer wording
cursor
Bot
left a comment
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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 and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: NaN comparator skips tiebreaker in project sorting
- Added a
!Number.isNaN(byTimestamp) guard to the comparator condition so that when both projects resolve to NEGATIVE_INFINITY the NaN result falls through to the name/id tiebreaker.

Or push these changes by commenting:
Preview (659ca5e71b)
diff --git a/apps/web/src/components/Sidebar.logic.ts b/apps/web/src/components/Sidebar.logic.ts
--- a/apps/web/src/components/Sidebar.logic.ts
+++ b/apps/web/src/components/Sidebar.logic.ts
@@ -270,7 +270,7 @@
const byTimestamp =
getProjectSortTimestamp(right, threadsByProjectId.get(right.id) ?? [], sortOrder) -
getProjectSortTimestamp(left, threadsByProjectId.get(left.id) ?? [], sortOrder);
- if (byTimestamp !== 0) return byTimestamp;
+ if (byTimestamp !== 0 && !Number.isNaN(byTimestamp)) return byTimestamp;
return left.name.localeCompare(right.name) || left.id.localeCompare(right.id);
});
}
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Keep the current thread visible in folded project thread lists
- Extract shared visible-thread selection logic and cover it with tests
- Treat missing or invalid timestamps as absent instead of zero
- Fall back to name and id ordering when projects have no sortable dates
- Add coverage for timestamp-less project sorting
cursor
Bot
left a comment
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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 and found 1 potential issue.

Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: NaN from NEGATIVE_INFINITY subtraction breaks sort tiebreaker
- Replaced subtraction-based comparison with explicit equality/greater-than checks (matching sortProjectsForSidebar), so two NEGATIVE_INFINITY values correctly produce 0 and fall through to the ID tiebreaker.

Or push these changes by commenting:
Preview (e09809f495)
diff --git a/apps/web/src/components/Sidebar.logic.ts b/apps/web/src/components/Sidebar.logic.ts
--- a/apps/web/src/components/Sidebar.logic.ts
+++ b/apps/web/src/components/Sidebar.logic.ts
@@ -270,8 +270,10 @@
T extends Pick<Thread, "id" | "createdAt" | "updatedAt" | "messages">,
>(threads: readonly T[], sortOrder: SidebarThreadSortOrder): T[] {
return threads.toSorted((left, right) => {
+ const rightTimestamp = getThreadSortTimestamp(right, sortOrder);
+ const leftTimestamp = getThreadSortTimestamp(left, sortOrder);
const byTimestamp =
- getThreadSortTimestamp(right, sortOrder) - getThreadSortTimestamp(left, sortOrder);
+ rightTimestamp === leftTimestamp ? 0 : rightTimestamp > leftTimestamp ? 1 : -1;
if (byTimestamp !== 0) return byTimestamp;
return right.id.localeCompare(left.id);
});
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Rename the sort timestamp test to better describe the no-threads fallback
- No behavior change
- Preserve deterministic id ordering when timestamps are missing
- Add coverage for updated_at sort fallback
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:XXL
1,000+ changed lines (additions + deletions).
vouch:trusted
Author is trusted by repo permissions or the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|