feat(ui): mark Cost Optimization as beta in the left nav (#34984) - #34987
Conversation
(cherry picked from commit f4a68a7)
| .map((w) => w.charAt(0).toUpperCase() + w.slice(1)) | ||
| .join(" "); | ||
|
|
||
| const labelText = (item: MenuItem): string => (typeof item.label === "string" ? item.label : prettify(item.key)); |
There was a problem hiding this comment.
Tooltip diverges from visible label
Deriving every JSX label from its key makes the collapsed tooltip for admin-panel read “Admin Panel” while the expanded navigation item reads “Admin Settings,” creating inconsistent names for the same destination.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Greptile SummaryThis PR adds a Beta badge to the Cost Optimization navigation item and improves collapsed-sidebar tooltip text for JSX labels.
Confidence Score: 4/5The PR appears safe to merge, with one non-blocking inconsistency in the collapsed tooltip for Admin Settings. The badge and targeted tooltip behavior are covered by focused tests, but deriving all JSX-label text from keys makes Admin Settings appear as “Admin Panel” in the collapsed rail. Files Needing Attention: ui/litellm-dashboard/src/components/leftnav.tsx
|
| Filename | Overview |
|---|---|
| ui/litellm-dashboard/src/components/leftnav.tsx | Adds the Cost Optimization Beta badge and readable JSX-label tooltips, with a minor Admin Settings tooltip mismatch. |
| ui/litellm-dashboard/src/components/leftnav.test.tsx | Adds focused coverage for the badge, navigation availability, and collapsed tooltip behavior without weakening existing assertions. |
Reviews (1): Last reviewed commit: "feat(ui): mark Cost Optimization as beta..." | Re-trigger Greptile
Cherry-pick of #34984 onto
rc/1.94.0, picked with-xfromf4a68a75ff4afa946e1e9f94d003ad0a7d41eb08The pick applied cleanly (auto-merge on
leftnav.tsx, no conflicts) and is byte-for-byte the upstream change;git patch-id --stableisfc05e4ae2193f202b78a6e4131f4bbc8fe7d4e91on both the staging commit and this oneRelevant issues
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaito 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
To capture at
3db78a88ed, with the dashboard dev server pointed at a local proxy:npm run devinui/litellm-dashboard, then open http://localhost:3000/ui/ and sign in as a proxy adminenableProjectsUIon, hovering Projects should read "Projects", not "projects"Type
🆕 New Feature
Changes
Everything in the picked commit already applied on this line:
rc/1.94.0carriesBetaBadge(from #33449), thecost-optimizationnav entry, and thelabelText/prettifypair the change reorders, so nothing had to be adaptedThe Cost Optimization nav item gains the Beta badge Projects already renders, which turns its
labelfrom a plain string into JSX. BecauselabelText()fell back to the raw menu key for non-string labels, that switch would have made the collapsed-rail tooltip read "cost-optimization"; the fallback now runs the key throughprettify(), the same helpergetBreadcrumb()uses, which also fixes Projects showing "projects" in the rail on this line todayVerification on
rc/1.94.0:npx vitest run src/components/leftnav.test.tsxis 15 passed. Reverting onlyleftnav.tsxback to the rc parent, keeping the new tests, turns exactly the two new tests red ("expected 'Cost Optimization' to contain 'Beta'" and the collapsed-tooltip assertion) at 2 failed / 13 passed, then green again once the source is restored.prettier --checkpasses on both files andeslintreports 0 errors on themOne thing to be aware of for the release: this changes dashboard source only, so the committed bundle under
litellm/proxy/_experimental/out/onrc/1.94.0will not show the badge until the UI build is re-run for this lineFinal Attestation