From 659ca5e71bcdc7710617cb66b4506b8e4e9a9ba9 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 24 Mar 2026 18:49:37 +0000 Subject: [PATCH] Fix NaN comparator skipping tiebreaker in project sorting When both projects lack timestamps and have no threads, getProjectSortTimestamp returns NEGATIVE_INFINITY for both. Subtracting NEGATIVE_INFINITY - NEGATIVE_INFINITY yields NaN, and since NaN !== 0 is true, the comparator returned NaN instead of falling through to the name/id tiebreaker. Add Number.isNaN guard to the condition. --- apps/web/src/components/Sidebar.logic.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/components/Sidebar.logic.ts b/apps/web/src/components/Sidebar.logic.ts index 4216061787..9c106ce949 100644 --- a/apps/web/src/components/Sidebar.logic.ts +++ b/apps/web/src/components/Sidebar.logic.ts @@ -270,7 +270,7 @@ export function sortProjectsForSidebar