GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Sort sidebar projects and threads by recency by juliusmarminge · Pull Request #1372 · pingdotgg/t3code

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Mar 24, 2026 •
edited by macroscopeapp Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

All reactions
@juliusmarminge
Sort sidebar projects and threads by recency
eac4909
- 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

coderabbitai Bot commented Mar 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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:

  • 🔍 Trigger review
✨ 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added size:XXL 1,000+ changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list. labels Mar 24, 2026
macroscopeapp[bot]
macroscopeapp Bot reviewed Mar 24, 2026
View reviewed changes
Comment thread apps/web/src/components/Sidebar.logic.test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Mar 24, 2026
View reviewed changes
Comment thread apps/web/src/components/Sidebar.logic.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
Optimize sidebar sorting and favicon reuse
d9ef0ca
- Avoid cloning thread arrays before sorting
- Cache loaded project favicons across sidebar renders
- Update sidebar sort labels for clearer wording
cursor[bot]
cursor Bot reviewed Mar 24, 2026
View reviewed changes

@cursor cursor Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

Create PR

Or push these changes by commenting:

@cursor push 659ca5e71b
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.

All reactions
Comment thread apps/web/src/components/Sidebar.logic.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

juliusmarminge added 2 commits March 24, 2026 11:57
@juliusmarminge
Show active thread in collapsed sidebar previews
04a4545
- Keep the current thread visible in folded project thread lists
- Extract shared visible-thread selection logic and cover it with tests
@juliusmarminge
Handle missing sort timestamps in sidebar ordering
1f96d6d
- 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]
cursor Bot reviewed Mar 24, 2026
View reviewed changes

@cursor cursor Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

Fix All in Cursor

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.

Create PR

Or push these changes by commenting:

@cursor push e09809f495
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.

All reactions
Comment thread apps/web/src/components/Sidebar.logic.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

juliusmarminge added 2 commits March 24, 2026 12:08
@juliusmarminge
Clarify project timestamp fallback test
554d063
- Rename the sort timestamp test to better describe the no-threads fallback
- No behavior change
@juliusmarminge
Stabilize sidebar thread sorting fallback
a3bb36c
- Preserve deterministic id ordering when timestamps are missing
- Add coverage for updated_at sort fallback
@juliusmarminge
juliusmarminge merged commit 28afb14 into main Mar 24, 2026
9 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
juliusmarminge deleted the t3code/updated-sort-order branch March 24, 2026 19:40
@ashvinnihalani ashvinnihalani mentioned this pull request Mar 25, 2026
[Feature]: Rebase Off 8888f6a from Upstream ashvinnihalani/t3code#34
Closed
apexsloth pushed a commit to apexslothforks/t3code that referenced this pull request Mar 26, 2026
@juliusmarminge @apexsloth
Sort sidebar projects and threads by recency (pingdotgg#1372)
5ef79b5
@juliusmarminge juliusmarminge mentioned this pull request Jun 9, 2026
Project sorting #797
Closed
youpele52 referenced this pull request in youpele52/bigbud Jun 17, 2026
@juliusmarminge
Sort sidebar projects and threads by recency (#1372)
61b4b45
dcherrera pushed a commit to dcherrera/t3code that referenced this pull request Jul 7, 2026
@juliusmarminge
Sort sidebar projects and threads by recency (pingdotgg#1372)
1917768
NeilTheFisher pushed a commit to NeilTheFisher/t3code that referenced this pull request Aug 18, 2026
@juliusmarminge
Sort sidebar projects and threads by recency (pingdotgg#1372)
8107ee5
@deanjstone deanjstone mentioned this pull request Sep 5, 2026
chore(web): drop dead getVisibleThreadsForProject helper deanjstone/t3code#22
Merged
5 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@macroscopeapp macroscopeapp[bot] macroscopeapp[bot] left review comments
@cursor cursor[bot] cursor[bot] left review comments

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.

Projects

None yet

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.

1 participant

@juliusmarminge
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.