From 85ef9a17ac83a81184c574b0f4365fac671c1f02 Mon Sep 17 00:00:00 2001 From: Kiet Ho Date: Wed, 22 Apr 2026 13:52:07 -0700 Subject: [PATCH 1/2] fix(desktop): render pending workspaces at top of sidebar New workspaces are inserted with a prepend tabOrder (top), but the pending placeholder was pinned to MAX_SAFE_INTEGER (bottom), so the creating/failed indicator visually separated from the row it represents. Flip the constant to MIN_SAFE_INTEGER so the pending sits alongside the just-created workspace at the top. --- .../hooks/useDashboardSidebarData/useDashboardSidebarData.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/hooks/useDashboardSidebarData/useDashboardSidebarData.ts b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/hooks/useDashboardSidebarData/useDashboardSidebarData.ts index b9a8b6b5c3a..4c757310837 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/hooks/useDashboardSidebarData/useDashboardSidebarData.ts +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/hooks/useDashboardSidebarData/useDashboardSidebarData.ts @@ -16,8 +16,9 @@ import type { DashboardSidebarWorkspace, } from "../../types"; -// Pending workspaces are always rendered at the end of the project's workspace list -const PENDING_WORKSPACE_TAB_ORDER = Number.MAX_SAFE_INTEGER; +// Pending workspaces render at the top of the project's workspace list, matching where +// the real workspace is inserted (getPrependTabOrder) once creation succeeds. +const PENDING_WORKSPACE_TAB_ORDER = Number.MIN_SAFE_INTEGER; export function useDashboardSidebarData() { const { data: session } = authClient.useSession(); From db66c92df8d8a1f2494489b7bf11b94d93498e8b Mon Sep 17 00:00:00 2001 From: Kiet Ho Date: Wed, 22 Apr 2026 13:54:38 -0700 Subject: [PATCH 2/2] chore(desktop): tighten PENDING_WORKSPACE_TAB_ORDER comment --- .../hooks/useDashboardSidebarData/useDashboardSidebarData.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/hooks/useDashboardSidebarData/useDashboardSidebarData.ts b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/hooks/useDashboardSidebarData/useDashboardSidebarData.ts index 4c757310837..ce0b564cc75 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/hooks/useDashboardSidebarData/useDashboardSidebarData.ts +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/hooks/useDashboardSidebarData/useDashboardSidebarData.ts @@ -16,8 +16,8 @@ import type { DashboardSidebarWorkspace, } from "../../types"; -// Pending workspaces render at the top of the project's workspace list, matching where -// the real workspace is inserted (getPrependTabOrder) once creation succeeds. +// Sits above every real workspace so the pending row lines up with the real one, +// which is inserted via getPrependTabOrder. const PENDING_WORKSPACE_TAB_ORDER = Number.MIN_SAFE_INTEGER; export function useDashboardSidebarData() {