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:
Krrish Dholakia 2026-04-23 22:54:00 -07:00
parent c1ccfb397b
commit 6402711452

View file

@ -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: "",