Fix workspace sidebar ordering to use updated_at instead of created_at (Vibe Kanban) (#1965)
* Done. I've updated the workspace sorting in `frontend/src/components/ui-new/hooks/useWorkspaces.ts` to use `updated_at` instead of `created_at`. Both active and archived workspaces will now be sorted by their most recent update time (with pinned workspaces still appearing first). All type checks and lint pass. * Cleanup script changes for workspace 37e99d73-8ab0-4501-990e-1007d78e44aa
This commit is contained in:
@@ -179,9 +179,9 @@ export function useWorkspaces(): UseWorkspacesResult {
|
||||
if (a.pinned !== b.pinned) {
|
||||
return a.pinned ? -1 : 1;
|
||||
}
|
||||
// Then by created_at (newest first)
|
||||
// Then by updated_at (most recent first)
|
||||
return (
|
||||
new Date(b.created_at).getTime() - new Date(a.created_at).getTime()
|
||||
new Date(b.updated_at).getTime() - new Date(a.updated_at).getTime()
|
||||
);
|
||||
})
|
||||
.map((ws) => toSidebarWorkspace(ws, activeSummaries.get(ws.id)));
|
||||
@@ -195,9 +195,9 @@ export function useWorkspaces(): UseWorkspacesResult {
|
||||
if (a.pinned !== b.pinned) {
|
||||
return a.pinned ? -1 : 1;
|
||||
}
|
||||
// Then by created_at (newest first)
|
||||
// Then by updated_at (most recent first)
|
||||
return (
|
||||
new Date(b.created_at).getTime() - new Date(a.created_at).getTime()
|
||||
new Date(b.updated_at).getTime() - new Date(a.updated_at).getTime()
|
||||
);
|
||||
})
|
||||
.map((ws) => toSidebarWorkspace(ws, archivedSummaries.get(ws.id)));
|
||||
|
||||
Reference in New Issue
Block a user