Add pagination controls to model health status - #26826
Conversation
Made-with: Cursor
Made-with: Cursor
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Made-with: Cursor
|
@greptileai review it |
Greptile SummaryThis PR adds server-side pagination controls to the Health Status tab by introducing a dedicated Confidence Score: 5/5Safe to merge — changes are isolated to the Health Status tab UI and carry no backend or auth impact. No P0/P1 findings. The pagination logic is correct: resultsStart/resultsEnd math matches the test assertions, buttons disable on boundaries, handleRefreshClick now resets the health page, and the act-wrapped unit test properly flushes async effects. E2e locator fix is strictly more precise. No files require special attention.
|
| Filename | Overview |
|---|---|
| ui/litellm-dashboard/src/components/model_dashboard/HealthCheckComponent.tsx | Adds pagination props, a health-specific table data memo, and Previous/Next controls with a results counter; page changes clear in-component health state correctly. |
| ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/ModelsAndEndpointsView.tsx | Introduces a dedicated healthCurrentPage state and a second useModelsInfo call for the Health tab; handleRefreshClick now resets the health page to 1. |
| ui/litellm-dashboard/src/components/model_dashboard/HealthCheckComponent.test.tsx | Adds a new test verifying pagination controls and onPageChange callback; existing tests receive only whitespace/formatting fixes that don't change assertions. |
| ui/litellm-dashboard/e2e_tests/tests/modelsPage/addModel.spec.ts | Tightens two result-count assertions to use data-testid="models-results-count" instead of a broad text locator, preventing false ambiguity now that a second counter exists. |
Reviews (2): Last reviewed commit: "Fix health pagination review issues" | Re-trigger Greptile
Greptile SummaryThis PR adds a dedicated pagination state and UI (Previous/Next buttons, result counter) to the Model Health Status tab, backed by a separate Confidence Score: 4/5Safe to merge — no functional regressions found; only minor test-quality and UX polish issues. All findings are P2 (style/best-practice): missing act() wrapper in one new test and a missing setHealthCurrentPage(1) on refresh. No logic errors, security concerns, or broken contracts were found. HealthCheckComponent.test.tsx — new pagination test should follow the act() pattern used by other tests in the file.
|
| Filename | Overview |
|---|---|
| ui/litellm-dashboard/src/components/model_dashboard/HealthCheckComponent.tsx | Adds pagination props and UI (Previous/Next buttons, result counter), clears health statuses on page change, and extracts table-data mapping to a separate variable — all changes are correct. |
| ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/ModelsAndEndpointsView.tsx | Adds a separate useModelsInfo call for the Health tab with its own page state; initial queries share a React Query key (page 1, size 50) so no extra network call is made until the user navigates pages. Refresh does not reset the health page counter. |
| ui/litellm-dashboard/src/components/model_dashboard/HealthCheckComponent.test.tsx | Adds a meaningful pagination test and cleans up trailing whitespace; the new test is missing the act() + microtask flush pattern used by all other tests, which may produce 'not wrapped in act' warnings. |
| ui/litellm-dashboard/e2e_tests/tests/modelsPage/addModel.spec.ts | Narrows the broad text-based locator to data-testid="models-results-count", which correctly targets the All Models counter and avoids the ambiguity introduced by the new Health Status counter. |
Reviews (1): Last reviewed commit: "Address health pagination review feedbac..." | Re-trigger Greptile
Made-with: Cursor
|
@greptileai review again with the new commit that resolves the p2 issues |
…agination Add pagination controls to model health status
Description:
Adds visible pagination to the Model Management Health Status tab and updates related e2e coverage so admins can navigate and check health status across all model pages.
Cause:
The Health Status tab was backed by paginated model data but did not expose page navigation, so users could only access the first page. Adding a second results counter also made an existing broad e2e locator ambiguous.
Fix:

Added Health Status-specific pagination state, result count, Previous/Next controls, stale health-status clearing on page changes, and stronger e2e assertions that target the All Models result counter directly.
Before:
After
