Skip to content

refactor(ui): colocate users page into route-level _components - #31897

Merged
ryan-crabbe-berri merged 1 commit into
litellm_internal_stagingfrom
litellm_colocate_users
Jul 2, 2026
Merged

refactor(ui): colocate users page into route-level _components#31897
ryan-crabbe-berri merged 1 commit into
litellm_internal_stagingfrom
litellm_colocate_users

Conversation

@ryan-crabbe-berri

Copy link
Copy Markdown
Contributor

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 requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Screenshots / Proof of Fix

This is a behavior-neutral move, so the proof is parity: the Users page and the flows it owns look and work exactly as before. To confirm locally

  1. From ui/litellm-dashboard, run npm run dev, open the dashboard, and go to the Users page (route /users). Confirm the users table renders, and that Create User, Edit User, the bulk-edit modal, Default User Settings, and clicking into a user's info view all behave as before
  2. There is nothing to verify elsewhere; the two shared widgets the page reuses (CreateUserButton, onboarding_link) were intentionally left in place, so the create-key flow is unaffected

Supporting checks that ran green: the six moved test suites pass with the same 75 assertions as before the move, tsc --noEmit reports no new errors in any touched file, eslint . reports zero errors, and next build compiles the /users route.

Type

🧹 Refactoring

Changes

Continues the App Router colocation work by pulling the users page implementation out of the shared src/components dump into the route that owns it. Fourteen route-private files move into app/(dashboard)/users/_components/: the view_users dashboard and its table/columns/info-view, plus BulkEditUsers, edit_user, DefaultUserSettings, and user_edit_view. The page imports them through a ./_components barrel

UserInfo moves to its real owner rather than a bucket. It was defined in a view folder (components/view_users/types.ts) that networking.tsx reached up into, which is backwards; the data layer should not depend on a view. The interface now lives in networking.tsx beside UserListResponse, which is the response type that embeds it, so the backwards dependency is gone and the view_users/ folder drains entirely. CreateUserButton and onboarding_link stay in src/components because the create-key flow also consumes them; they get a proper home when that area colocates

Relative imports in the moved files become @/components/* absolute paths, the eight pre-existing eslint-suppressions.json entries are re-keyed to the new paths so the move stays lint-neutral, and a dead vi.mock that pointed at the now-deleted @/components/view_users is removed

Moves the user-management component tree (view_users plus BulkEditUsers, edit_user, DefaultUserSettings, user_edit_view, and the view_users table/columns/info-view) out of the shared src/components dump into the users route segment under _components, now that the app router owns the route. The page imports from a trimmed ./_components barrel

UserInfo moves into networking.tsx beside UserListResponse, its real owner: networking defines the user API response shapes that embed it, and previously reached up into a view folder (components/view_users/types) to import the type. Defining it in networking removes that backwards data-layer-to-view dependency and drains the view_users/ folder entirely. CreateUserButton and onboarding_link stay in components/ since the create-key flow also consumes them

Relative imports in the moved files are rewritten to @/components/* absolute paths, and the eight pre-existing eslint-suppressions entries are re-keyed to the new paths so the move stays behavior and lint neutral

Verified: the moved suites pass with the same 75 assertions as before the move, tsc and eslint are clean, and next build compiles the /users route
@greptile-apps

greptile-apps Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR is a behavior-neutral file-move refactoring: 14 files that implement the Users page are relocated from the shared src/components/ dump into the route-private src/app/(dashboard)/users/_components/ directory, and their relative imports are updated to @/components/* absolute paths.

  • UserInfo is moved from the view-layer view_users/types.ts into networking.tsx beside UserListResponse, reversing the backwards data-layer→view dependency. A thin barrel index.tsx re-exports ViewUserDashboard so the route page.tsx can use a clean named import.
  • Eight eslint-suppressions.json entries and one dead vi.mock(\"@/components/view_users\", …) in CreateKeyPage.expiredToken.test.tsx are updated/removed to reflect the new paths, keeping the move lint- and test-neutral.

Confidence Score: 5/5

Pure file-move with no logic changes; all import paths verified clean, no orphaned consumers of the old paths remain.

Every moved file has its import paths correctly updated, the deleted types.ts has no remaining consumers, and the dead mock in the test suite is properly cleaned up. The UserInfo interface definition in networking.tsx is byte-for-byte identical to the one it replaces. No functional code was changed.

No files require special attention.

Important Files Changed

Filename Overview
ui/litellm-dashboard/src/components/networking.tsx UserInfo interface moved inline from view_users/types.ts; old re-export removed. Interface definition is identical, no functional change.
ui/litellm-dashboard/src/components/view_users/types.ts File deleted after its only content (UserInfo) was moved to networking.tsx; all consumers updated.
ui/litellm-dashboard/src/app/(dashboard)/users/_components/index.tsx New barrel that re-exports ViewUserDashboard as a named export; used by the route page.tsx.
ui/litellm-dashboard/src/app/(dashboard)/users/page.tsx Import updated from @/components/view_users (default) to ./_components (named), matching the new barrel export.
ui/litellm-dashboard/src/app/(dashboard)/users/_components/view_users.tsx Moved from src/components/view_users.tsx; relative imports for shared components replaced with @/components/* absolutes; route-private imports remain relative.
ui/litellm-dashboard/tests/CreateKeyPage.expiredToken.test.tsx Dead vi.mock("@/components/view_users") removed; the module no longer exists at that path and the create-key flow does not render the users page.
ui/litellm-dashboard/eslint-suppressions.json Eight suppression entries re-keyed to the new file paths, keeping suppression counts unchanged.

Reviews (1): Last reviewed commit: "refactor(ui): colocate users page into r..." | Re-trigger Greptile

@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ryan-crabbe-berri
ryan-crabbe-berri merged commit 3d644e1 into litellm_internal_staging Jul 2, 2026
122 checks passed
@ryan-crabbe-berri
ryan-crabbe-berri deleted the litellm_colocate_users branch July 2, 2026 03:14
Rodrigo-Palma pushed a commit to Rodrigo-Palma/litellm that referenced this pull request Jul 3, 2026
…AI#31897)

Moves the user-management component tree (view_users plus BulkEditUsers, edit_user, DefaultUserSettings, user_edit_view, and the view_users table/columns/info-view) out of the shared src/components dump into the users route segment under _components, now that the app router owns the route. The page imports from a trimmed ./_components barrel

UserInfo moves into networking.tsx beside UserListResponse, its real owner: networking defines the user API response shapes that embed it, and previously reached up into a view folder (components/view_users/types) to import the type. Defining it in networking removes that backwards data-layer-to-view dependency and drains the view_users/ folder entirely. CreateUserButton and onboarding_link stay in components/ since the create-key flow also consumes them

Relative imports in the moved files are rewritten to @/components/* absolute paths, and the eight pre-existing eslint-suppressions entries are re-keyed to the new paths so the move stays behavior and lint neutral

Verified: the moved suites pass with the same 75 assertions as before the move, tsc and eslint are clean, and next build compiles the /users route
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