Skip to content

refactor(ui): migrate memory page to shadcn - #34366

Merged
yuneng-berri merged 6 commits into
litellm_internal_stagingfrom
litellm_/migrate-page-memory-9b2c09
Jul 24, 2026
Merged

refactor(ui): migrate memory page to shadcn#34366
yuneng-berri merged 6 commits into
litellm_internal_stagingfrom
litellm_/migrate-page-memory-9b2c09

Conversation

@yuneng-berri

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • Memory page still renders on antd
  • Its detail drawer had no test coverage

How it solves it:

  • Drawer to ui/sheet, button to ui/button, typography to tokens
  • Markup only; no behaviour or data flow changes

Relevant issues

Linear ticket

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to re-request a review after pushing changes)

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

Screenshots / Proof of Fix

The tests are the regression evidence and they are deliberately split across two commits. 9dda5d882c adds them against the antd components, where they pass; d2f872d04f migrates and does not touch the test files. git diff --name-only d2f872d04f~1 d2f872d04f -- '*test*' is empty, so the same unedited assertions are green on both implementations

Screenshots to attach, captured at commit d2f872d04f:

  • before: pre-migration render of /ui/memory
  • after: same route after the migration
  • after: the detail drawer open on a memory with metadata, a null team id and a multi-line value

To reproduce by hand against a local proxy:

  1. Start the proxy and the dashboard dev server, then create a row so the drawer has something to show
curl -X POST http://localhost:4000/v1/memory -H "Authorization: Bearer sk-1234" -H "Content-Type: application/json" -d '{"key":"user:profile","value":"The user prefers concise answers.\nSecond line to prove pre-wrap rendering.","metadata":{"tags":["example","qa"],"source":"manual-verification"}}'
  1. Open http://localhost:4000/ui/?page=memory and confirm the header reads "Memory" over the /v1/memory scope note, with "New memory" on the right
  2. Click the row's ID cell. The drawer opens at 720px with the key as a code chip, Memory ID / User ID / Team ID across the top, the value in a monospace block with its newline preserved, the metadata pretty-printed, and a created/updated attribution line
  3. Close it with the X, then reopen from the row's overflow menu via View
  4. Click "New memory" and confirm the create modal still opens; it is untouched by this PR
  5. Shrink the window to roughly 1280x600. The page must scroll inside the shell with nothing clipped

Type

🧹 Refactoring

Changes

Two files migrated, both owned exclusively by this route:

  • MemoryDetailDrawer.tsx: antd Drawer to ui/sheet, Space and Typography to flex and token utilities. Width stays 720px via data-[side=right] overrides so tailwind-merge reconciles them against the primitive's own sm:max-w-sm
  • MemoryView.tsx: antd Button to ui/button, Title and Paragraph to a plain h1 and p with token classes, Space to flex utilities, and @ant-design/icons PlusOutlined to lucide Plus. Toasts move from the raw antd message API to the shared MessageManager, which is the wrapper 100+ other files already use; behaviour is identical and the route stops importing antd directly

Deliberately not touched, quoting the analyzer's buckets:

  • DEFERRED (contains an antd Form -- do not touch until forms unblock): MemoryEditModal.tsx. Its suppression entry stays
  • SHARED (reached by another page -- REFUSE to edit; Track A owns these): DeprecationBanner.tsx (7 pages), DeleteResourceModal.tsx (23), message_manager.tsx (53), notifications_manager.tsx (53)
  • TABLE: none. MemoryTable already sits on the shared DataTable

eslint-suppressions.json loses the two migrated files' no-restricted-imports entries, which is the point of the change. It also loses a dead entry for models-and-endpoints/ModelsAndEndpointsView.tsx; that file no longer exists on this branch, so the entry pointed at nothing and --prune-suppressions dropped it

Two visible differences a reviewer should expect rather than read as regressions. The "New memory" button is no longer antd blue: a bare <Button> resolves to bg-primary, which this theme sets to a near-black, matching what the already-migrated prompts page ships. Pinning it back to blue with a utility would hardcode a colour the theme is supposed to own. Separately the scope note under the heading now wraps onto a second line, because the token font metrics are marginally wider than antd's; nothing is clipped

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

…rating

Adds role/text-based coverage for MemoryDetailDrawer (which had none) and
extends MemoryView's test past the mocked table to the header, the create
modal trigger and the detail drawer round trip. Both are green against the
current antd components, so they act as an unedited regression net for the
shadcn migration that follows.
Replaces the antd Drawer with ui/sheet and the antd Button, Typography and
Space usage with ui/button plus token utilities, and swaps the @ant-design
PlusOutlined icon for lucide's Plus. Toasts now go through the shared
MessageManager so the route no longer imports antd directly.

The route's tests were written against the antd components in the previous
commit and are unchanged here, so they pass on both implementations.

MemoryEditModal is left alone because it is built on antd Form; the table
already sits on the shared DataTable.
…itellm_/migrate-page-memory-9b2c09

# Conflicts:
#	ui/litellm-dashboard/eslint-suppressions.json
@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Migrates the memory page and detail drawer from Ant Design to shared shadcn components

  • Makes the detail sheet responsive while retaining its 720px desktop width
  • Moves notifications to the shared MessageManager
  • Adds coverage for drawer content, closing, and Memory page interactions
  • Removes obsolete ESLint suppressions

Confidence Score: 5/5

The PR appears safe to merge

No blocking failure remains in the responsive sheet fix

Important Files Changed

Filename Overview
ui/litellm-dashboard/src/app/(dashboard)/memory/_components/MemoryDetailDrawer.tsx The responsive full-width sheet classes address the previously reported narrow-viewport overflow
ui/litellm-dashboard/src/app/(dashboard)/memory/_components/MemoryView.tsx Replaces Ant Design layout, typography, button, icon, and notification usage without changing the page data flow
ui/litellm-dashboard/src/app/(dashboard)/memory/_components/MemoryDetailDrawer.test.tsx Adds focused coverage for drawer rendering, optional fields, metadata, timestamps, and closure
ui/litellm-dashboard/src/app/(dashboard)/memory/_components/MemoryView.test.tsx Adds coverage for page headings, create-modal activation, and detail-sheet interaction

Reviews (2): Last reviewed commit: "fix(ui): keep the memory detail sheet in..." | Re-trigger Greptile

@codspeed-hq

codspeed-hq Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing litellm_/migrate-page-memory-9b2c09 (caac7d8) with litellm_internal_staging (43e7b96)1

Open in CodSpeed

Footnotes

  1. No successful run was found on litellm_internal_staging (a507394) during the generation of this report, so 43e7b96 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

…creens

The migrated sheet asked for a flat 720px width while its only max-width
came from the primitive's sm:-scoped rule, so below the sm breakpoint no
cap applied at all: on a 375px viewport the sheet rendered 720px wide with
its left edge at -305px, and because it is position:fixed there was no
scroll to reach the hidden content. The primitive's own w-3/4 default did
not have this problem; the fixed pixel width is what removed the guard.

Caps the width to the viewport at every breakpoint and only asks for
720px from sm up. Verified in a browser at 375px, 700px and 1280px: the
sheet is now 375, 700 and 720 wide respectively, always at left 0.
@yuneng-berri

Copy link
Copy Markdown
Contributor Author

@greptile

@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@devin-ai-integration

Copy link
Copy Markdown
Contributor

QA — Memory page shadcn migration

Tested against a live proxy (port 4000, real Postgres 16) and the dashboard dev server (route /memory), seeded one memory row with a multi-line value, a null Team ID, and nested metadata, then exercised the migrated page end to end through the UI. All 5 runtime checks passed, no functional regressions. The PR's two focused unit files also pass (12 tests)

Results

  • Header and toolbar render as shadcn primitives: Memory heading, scope note with /v1/memory in an inline code chip, near-black button with the lucide Plus icon
  • Detail drawer opens as a right-side Sheet (~720px at desktop) with the key in a code chip, the Memory ID / User ID / Team ID grid (null Team ID shows -), the multi-line value preserved in a monospace pre-wrap block, pretty-printed JSON metadata, and the created/updated attribution footer
  • Closing via the X and reopening through the overflow menu View shows the same content
  • New memory opens the create modal (Key / Value / Metadata)
  • Narrow viewport (~560px): the Sheet becomes full-width, stays inside the viewport with no clipping, and scrolls; confirms the fix in a928db1

Detail drawer

Detail sheet

Narrow viewport (~560px), Sheet full-width and inside the viewport

Narrow sheet

More evidence (page, overflow menu, create modal, recording)

Memory page

Memory page

Overflow menu

Overflow menu

Create modal

Create modal

Recording

Recording

Not covered: non-admin role gating (admin master-key login only) and create/edit/delete write paths beyond opening their modals, kept out to preserve the seeded state; both are out of scope for this markup-only migration

Tested by Devin on behalf of @yuneng — session: https://app.devin.ai/sessions/580facfbbac041c2858d88fc633c1644

@yuneng-berri
yuneng-berri merged commit bd753ae into litellm_internal_staging Jul 24, 2026
77 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_/migrate-page-memory-9b2c09 branch July 24, 2026 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants