Skip to content

refactor(ui): colocate cost-tracking and prompts components into _components/ - #32716

Merged
ryan-crabbe-berri merged 1 commit into
litellm_internal_stagingfrom
litellm_colocate_cost_prompts
Jul 10, 2026
Merged

ryan-crabbe-berri merged 1 commit into
litellm_internal_stagingfrom
litellm_colocate_cost_prompts

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; the proof is that both pages still render. On a live proxy:

  1. http://localhost:4000/ui/cost-tracking renders cost tracking settings (the "How it works" code block and pricing calculator still work)
  2. http://localhost:4000/ui/prompts renders the prompts panel (prompt editor / conversation panel still work)

Local checks: npx vitest run on the moved folders passes with 231 tests across 17 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. It renames the local components/ folders of cost-tracking and prompts to _components/, so each route's owned implementation is private to its segment (matching Next's _ route-exclusion convention used by the already-colocated segments)

Both folders are imported only by their own page.tsx via the folder index, verified to have zero external importers across src, tests, and e2e_tests. Because a rename keeps every file at the same depth in the tree, all internal and relative imports are unaffected; the only source change per segment is repointing that one index import from ./components to ./_components. Grandfathered lint suppressions under the two folders (31 entries total, all pre-existing) are re-keyed to the new paths with counts unchanged. No behavior change

This combines what were two separate PRs (cost-tracking and prompts) into one, since both are the identical mechanical rename

…ponents/

Renames each segment's local components/ folder to _components/ (private to the
route, matching Next's _ route-exclusion). Both folders are imported only by
their own page.tsx via the folder index (verified zero external importers
across src, tests, and e2e_tests), so each is a straight rename plus repointing
that one index import; a folder rename keeps every file at the same depth, so
all internal and relative imports are unaffected.

Grandfathered lint suppressions under the two folders (31 entries: cost-tracking
15, prompts 16) are re-keyed to the new paths with counts unchanged. No behavior
change.
@greptile-apps

greptile-apps Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR renames the local components/ folders under cost-tracking and prompts route segments to _components/, following Next.js's route-exclusion convention for colocated private implementation files.

  • Import update: both page.tsx files have a one-line import change from ./components to ./_components; all relative imports inside the moved files are unaffected since the folder depth is unchanged.
  • ESLint suppressions: 31 path keys in eslint-suppressions.json are re-keyed to the new folder names with counts left unchanged.
  • Build artifact: tsconfig.tsbuildinfo is included in the diff; this is a generated incremental-build cache file whose committed copy contains machine-local absolute paths — a pre-existing concern unrelated to this PR.

Confidence Score: 5/5

Safe to merge — the change is a mechanical folder rename with no logic touched anywhere.

Every source file is a pure rename with zero content change. The only edited source files are the two page.tsx entry points (one-line import fix each) and eslint-suppressions.json (path re-keying). A search of the entire codebase confirms no other file imports from the old components/ paths, so no dangling references were left behind. The committed tsconfig.tsbuildinfo contains stale path strings, but that file is machine-generated and self-heals on the next build.

No files require special attention.

Important Files Changed

Filename Overview
ui/litellm-dashboard/src/app/(dashboard)/cost-tracking/page.tsx Single import path updated from ./components to ./_components; correct and complete.
ui/litellm-dashboard/src/app/(dashboard)/prompts/page.tsx Single import path updated from ./components to ./_components; correct and complete.
ui/litellm-dashboard/eslint-suppressions.json All 31 affected path keys re-keyed from components/ to _components/ with suppression counts unchanged; exhaustive and correct.
ui/litellm-dashboard/tsconfig.tsbuildinfo Auto-generated incremental build artifact; contains machine-local absolute paths (pre-existing). Old components/ path strings are still present in this snapshot, but TypeScript will reconcile them on the next build.

Reviews (1): Last reviewed commit: "refactor(ui): colocate cost-tracking and..." | Re-trigger Greptile

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed

codspeed Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing litellm_colocate_cost_prompts (e062080) with litellm_internal_staging (913314a)1

Open in CodSpeed

Footnotes

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

@ryan-crabbe-berri
ryan-crabbe-berri merged commit 27cf064 into litellm_internal_staging Jul 10, 2026
78 checks passed
@ryan-crabbe-berri
ryan-crabbe-berri deleted the litellm_colocate_cost_prompts branch July 10, 2026 04:34
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