mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-17 23:51:30 +00:00
fix(ui/memory): drop misleading client-side column sorters
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) <noreply@anthropic.com>
This commit is contained in:
parent
c1ccfb397b
commit
6402711452
1 changed files with 8 additions and 8 deletions
|
|
@ -210,7 +210,10 @@ export const MemoryView: React.FC<MemoryViewProps> = ({ accessToken }) => {
|
|||
key: "key",
|
||||
width: 200,
|
||||
render: (k: string) => <Text code>{k}</Text>,
|
||||
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<MemoryViewProps> = ({ accessToken }) => {
|
|||
dataIndex: "updated_at",
|
||||
key: "updated_at",
|
||||
width: 180,
|
||||
render: (ts?: string) => (
|
||||
<Text type="secondary">{formatTimestamp(ts)}</Text>
|
||||
),
|
||||
sorter: (a, b) =>
|
||||
new Date(a.updated_at ?? 0).getTime() -
|
||||
new Date(b.updated_at ?? 0).getTime(),
|
||||
defaultSortOrder: "descend",
|
||||
render: (ts?: string) => <Text type="secondary">{formatTimestamp(ts)}</Text>,
|
||||
// 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: "",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue