litellm/ui/litellm-dashboard/e2e_tests/fixtures/menuMappings.ts
ryan-crabbe-berri 1cc70f84c0
fix(ui): distinguish response cache from provider prompt caching (#34138)
* fix(ui): distinguish response cache from provider prompt caching

The log detail drawer labeled LiteLLM's response cache result as
"Cache Hit" and rendered a red "false" tag next to provider prompt
cache token counts, which read as prompt caching being broken. The
row is now labeled "Response Cache" with an explanatory tooltip,
shows a neutral "Miss" tag instead of a red one, and the prompt
cache token rows are prefixed with "Prompt Cache" and get their own
tooltips. Cost breakdown line items get the same prefix.

The Caching dashboard only reports response cache analytics but never
said so; it is renamed to "Response Cache" in the sidebar, gains a
scope description pointing to the Usage page and Logs for prompt
caching, and the ambiguous "Cached Tokens" stat card is renamed to
"Cached Completion Tokens".

* test(ui): cover renamed Response Cache sidebar item in e2e

The sidebar navigation spec now clicks the renamed "Response Cache"
item and asserts it routes to /ui/caching, and the menu label fixture
maps the new label while keeping "Caching" as a legacy alias.
Verified by running sidebar.spec.ts through run_e2e.sh (full harness:
built UI served by the proxy, seeded postgres); both tests pass.

* feat(ui): link cache tooltips and dashboard description to docs

The Response Cache tooltip links to the proxy caching docs and the
two prompt cache token tooltips link to the prompt caching docs, so
users can jump straight to the explanation of whichever mechanism
they are looking at. The Response Cache dashboard description links
both docs pages the same way.
2026-07-21 14:26:26 -07:00

39 lines
1.2 KiB
TypeScript

import { Page } from "./pages";
/**
* Maps sidebar menu item labels to their corresponding page enum values.
* This mapping is for the admin role.
*/
export const menuLabelToPage: Record<string, Page> = {
"Virtual Keys": Page.ApiKeys,
Playground: Page.LlmPlayground,
Models: Page.Models,
"Models + Endpoints": Page.Models,
Usage: Page.NewUsage,
Teams: Page.Teams,
"Internal Users": Page.Users,
"Internal User": Page.Users, // Legacy label support
Organizations: Page.Organizations,
"API Reference": Page.ApiRef,
"AI Hub": Page.ModelHubTable,
"Model Hub": Page.ModelHubTable,
Logs: Page.Logs,
Guardrails: Page.Guardrails,
// Settings submenu items
"Router Settings": Page.RouterSettings,
"Logging & Alerts": Page.LoggingAndAlerts,
"Admin Settings": Page.AdminPanel,
"Cost Tracking": Page.CostTracking,
"UI Theme": Page.UiTheme,
// Experimental submenu items
"Response Cache": Page.Caching,
Caching: Page.Caching, // Legacy label support
Prompts: Page.Prompts,
Budgets: Page.Budgets,
"API Playground": Page.TransformRequest,
"Tag Management": Page.TagManagement,
"Old Usage": Page.Usage,
// Tools submenu items
"MCP Servers": Page.McpServers,
"Vector Stores": Page.VectorStores,
};