refactor(ui): colocate users page into route-level _components - #31897
Conversation
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 SummaryThis PR is a behavior-neutral file-move refactoring: 14 files that implement the Users page are relocated from the shared
Confidence Score: 5/5Pure 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.
|
| 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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…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
Relevant issues
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaiand received a Confidence Score of at least 4/5 before requesting a maintainer reviewScreenshots / 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
ui/litellm-dashboard, runnpm 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 beforeSupporting checks that ran green: the six moved test suites pass with the same 75 assertions as before the move,
tsc --noEmitreports no new errors in any touched file,eslint .reports zero errors, andnext buildcompiles the/usersroute.Type
🧹 Refactoring
Changes
Continues the App Router colocation work by pulling the users page implementation out of the shared
src/componentsdump into the route that owns it. Fourteen route-private files move intoapp/(dashboard)/users/_components/: theview_usersdashboard and its table/columns/info-view, plusBulkEditUsers,edit_user,DefaultUserSettings, anduser_edit_view. The page imports them through a./_componentsbarrelUserInfomoves to its real owner rather than a bucket. It was defined in a view folder (components/view_users/types.ts) thatnetworking.tsxreached up into, which is backwards; the data layer should not depend on a view. The interface now lives innetworking.tsxbesideUserListResponse, which is the response type that embeds it, so the backwards dependency is gone and theview_users/folder drains entirely.CreateUserButtonandonboarding_linkstay insrc/componentsbecause the create-key flow also consumes them; they get a proper home when that area colocatesRelative imports in the moved files become
@/components/*absolute paths, the eight pre-existingeslint-suppressions.jsonentries are re-keyed to the new paths so the move stays lint-neutral, and a deadvi.mockthat pointed at the now-deleted@/components/view_usersis removed