fix(ui): honor model view scope - #39138
Conversation
Greptile SummaryThe PR corrects model query scoping and ensures scope changes begin on the first page.
Confidence Score: 5/5The PR appears safe to merge. The previously reported pagination issue is fixed: changing model scope now resets pagination while the query derives the new page and team scope together, and no blocking failure remains.
|
| Filename | Overview |
|---|---|
| ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTab.tsx | The scope-dependent team query and pagination reset correctly address the previously reported stale-page behavior. |
| ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTab.test.tsx | The added interaction test verifies that switching from team page two to all models requests the unscoped first page and restores the selected team afterward. |
| ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/page.test.tsx | The test-query changes are a semantics-preserving cleanup from render-scoped queries to screen. |
Reviews (3): Last reviewed commit: "test(ui): use screen queries in models p..." | Re-trigger Greptile
|
@greptileai please re-review the pagination reset and patched browserslist lockfile at the latest head commit |
250c919 to
67d6539
Compare
9afb744 to
945f02f
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@greptileai please re-review the model scope fix and screen-query lint cleanup at the latest head commit |
|
OSV failure is tracked in #39217 and comes from unchanged staging locks; this PR only changes model scope UI code and tests |
e3ed5fd to
37e8a5c
Compare
The debounced refetch assertions leave no headroom against the 1s default that @testing-library/react applies to waitFor/findBy*, which flaked on CI.
TLDR
Problem this solves:
prefer-screen-querieslimitHow it solves it:
screenqueriesUser Flow
Before: an admin cannot reliably leave the selected team's model scope
teamId=team-1andpage=2After: the same view switch loads all available models from the first page
teamIdand usespage=1teamId=team-1from page 1Relevant issues
Discovered through a static query-state audit and the PR lint check
Linear ticket
Pre-Submission checklist
Screenshots / Proof of Fix
Before (bad55da)
teamId: "team-1"andpage: 2testing-library/prefer-screen-queries: 21 | max: 18After (e3ed5fd)
teamId: undefinedandpage: 1teamId: "team-1"from page 1testing-library/prefer-screen-queries: 18 | max: 18Type
Bug Fix
Caveats (if any)
CI baseline
uv.lockuv.lockby the repository dependency guardFinal Attestation