From 640271145207d1ced277364aadaef4e7720b7515 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Thu, 23 Apr 2026 22:54:00 -0700 Subject: [PATCH] fix(ui/memory): drop misleading client-side column sorters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With server-side pagination, client sorters on `key` and `updated_at` only reorder the current page while pretending to sort the full dataset — users would see "sorted by name" but only the visible 50 rows would actually be sorted. Remove the sorters. The backend already returns rows in `updated_at DESC` order (sensible default for a memory view), and users can narrow the result with the key-prefix filter. Greptile also flagged missing `@@map` on the new model as a "consistency" issue, but only 1 of 59 tables in this repo uses `@@map` — the dominant pattern is to rely on Prisma's default (model name == table name). Skipping that finding as a false-positive on convention. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../src/components/MemoryView/MemoryView.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ui/litellm-dashboard/src/components/MemoryView/MemoryView.tsx b/ui/litellm-dashboard/src/components/MemoryView/MemoryView.tsx index 6ae3ecbfa59..23f6adc94df 100644 --- a/ui/litellm-dashboard/src/components/MemoryView/MemoryView.tsx +++ b/ui/litellm-dashboard/src/components/MemoryView/MemoryView.tsx @@ -210,7 +210,10 @@ export const MemoryView: React.FC = ({ accessToken }) => { key: "key", width: 200, render: (k: string) => {k}, - sorter: (a, b) => a.key.localeCompare(b.key), + // No client-side sorter: pagination is server-side, so a client sort + // would only reorder the current page and mislead users into thinking + // the whole list is sorted. Backend returns rows ordered by + // `updated_at DESC`; use the prefix filter for discovery by name. }, { title: "Preview", @@ -241,13 +244,10 @@ export const MemoryView: React.FC = ({ accessToken }) => { dataIndex: "updated_at", key: "updated_at", width: 180, - render: (ts?: string) => ( - {formatTimestamp(ts)} - ), - sorter: (a, b) => - new Date(a.updated_at ?? 0).getTime() - - new Date(b.updated_at ?? 0).getTime(), - defaultSortOrder: "descend", + render: (ts?: string) => {formatTimestamp(ts)}, + // No sorter — backend already returns rows in `updated_at DESC` order, + // and a client-side sorter on a paginated view would only affect the + // current page. }, { title: "",