Skip to content

refactor(ui): colocate caching, projects, and guardrails-monitor into _components/ - #32696

Closed
ryan-crabbe-berri wants to merge 1 commit into
litellm_internal_stagingfrom
litellm_colocate_batch2
Closed

refactor(ui): colocate caching, projects, and guardrails-monitor into _components/#32696
ryan-crabbe-berri wants to merge 1 commit into
litellm_internal_stagingfrom
litellm_colocate_batch2

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 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

Pure directory renames with no behavior change, so the proof is that each page still renders. On a live proxy, load each and screenshot:

  1. http://localhost:4000/ui/caching renders the cache dashboard (cache settings tab still opens)
  2. http://localhost:4000/ui/projects renders the projects page (create/edit project modals still open)
  3. http://localhost:4000/ui/guardrails-monitor renders the guardrails monitor view

Local checks: npx vitest run on the moved suites passes with 118 tests across 14 files, npm run build compiles every route, and make pre-commit passes.

Type

🧹 Refactoring

Changes

Continues the colocation follow-up to the App Router migration, after the api-reference template (#32690) and the memory/budgets/access-groups batch (#32694). Same convention: a page's owned components live in <segment>/_components/ (private to the segment, matching Next's _ route-exclusion)

caching, projects, and guardrails-monitor were chosen because their local component folders are entirely self-contained. Each folder is imported only by its own page.tsx (verified zero external importers across src, tests, and e2e_tests, and no absolute self-imports inside the folder, so internal relative imports move with it), which makes each a straight components/ to _components/ rename plus repointing that one import. Every @/components import in these segments is genuinely shared infrastructure (networking, shared/*, common_components, llm_calls, molecules), so nothing is drained out of @/components. No logic changes

Grandfathered lint suppressions under the three folders (14 entries: caching 4, projects 4, guardrails-monitor 6) are re-keyed to the files' new paths with counts unchanged, since fixing those underlying violations is a separate effort out of scope for a file move

… _components/

Continues the colocation follow-up (after api-reference #32690 and the
memory/budgets/access-groups batch #32694), applying the same convention to
three more self-contained segments: rename each `<segment>/components/` to
`_components/` and repoint the one `page.tsx` import.

Each folder is imported only by its own page (verified zero external importers
across src, tests, and e2e_tests, and no absolute self-imports inside the
folder), so this is a pure relocation with no logic change. The `@/components`
imports in these segments are all genuinely shared (networking, shared/*,
common_components, llm_calls, molecules) and stay put; nothing is drained.

Grandfathered lint suppressions under the three folders (14 entries total:
caching 4, projects 4, guardrails-monitor 6) are re-keyed to the new paths with
counts unchanged.
@greptile-apps

greptile-apps Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR continues the Next.js App Router colocation convention by renaming components/ to _components/ in three dashboard segments — caching, projects, and guardrails-monitor. The underscore prefix marks these folders as private to their segment (Next.js _ route-exclusion convention), with no logic or behavior changes.

  • Three page.tsx files have their single local import updated from ./components/... to ./_components/...; all @/components shared-infrastructure imports are untouched.
  • eslint-suppressions.json has 14 suppression keys re-keyed to the new paths, with rule counts preserved exactly.
  • Verification confirms zero remaining references to the old components/ paths across the codebase, and the old directories are fully removed.

Confidence Score: 5/5

Pure directory rename with no logic changes; old paths have no remaining references and the old directories are fully removed.

Every changed file is either a straight file move (content identical to the source), a one-line import path update in a page entry point, or a suppression-key rename in eslint-suppressions.json. No component logic, no API calls, no test assertions, and no shared exports were modified.

No files require special attention.

Important Files Changed

Filename Overview
ui/litellm-dashboard/eslint-suppressions.json 14 suppression keys re-keyed from components/ to _components/ for caching, guardrails-monitor, and projects; rule counts are unchanged
ui/litellm-dashboard/src/app/(dashboard)/caching/page.tsx Import of CacheDashboard updated from ./components/ to ./_components/; no other changes
ui/litellm-dashboard/src/app/(dashboard)/projects/page.tsx Import of ProjectsPage updated from ./components/ to ./_components/; no other changes
ui/litellm-dashboard/src/app/(dashboard)/guardrails-monitor/page.tsx Import of GuardrailsMonitorView updated from ./components/ to ./_components/; no other changes
ui/litellm-dashboard/src/app/(dashboard)/caching/_components/cache_dashboard.tsx Moved verbatim from caching/components/; internal relative imports and @/components references are all intact
ui/litellm-dashboard/src/app/(dashboard)/projects/_components/ProjectsPage.tsx Moved verbatim from projects/components/; no logic changes
ui/litellm-dashboard/src/app/(dashboard)/guardrails-monitor/_components/GuardrailsMonitorView.tsx Moved verbatim from guardrails-monitor/components/; no logic changes

Reviews (1): Last reviewed commit: "refactor(ui): colocate caching, projects..." | Re-trigger Greptile

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed-hq

codspeed-hq Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing litellm_colocate_batch2 (6b0e0b4) with litellm_internal_staging (68a4ca7)

Open in CodSpeed

@ryan-crabbe-berri

Copy link
Copy Markdown
Contributor Author

Superseded by #32704, which combines all four colocation batches into one PR per request. Same commits, cherry-picked onto one branch; branch kept for now.

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.

1 participant