[Feature] UI - Navbar: Option to hide Usage Popup#20910
Merged
yuneng-jiang merged 1 commit intomainfrom Feb 11, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Greptile OverviewGreptile SummaryAdds a user-facing toggle in the navbar dropdown to hide the usage indicator from the sidebar. The implementation follows existing patterns (
Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| ui/litellm-dashboard/src/app/(dashboard)/hooks/useDisableUsageIndicator.ts | New hook following existing useDisableShowPrompts pattern exactly. Uses useSyncExternalStore with localStorage to reactively track the disableUsageIndicator preference. |
| ui/litellm-dashboard/src/app/(dashboard)/hooks/useDisableUsageIndicator.test.ts | Comprehensive test suite for the hook with 11 tests covering initial state, storage events, custom events, cleanup, and multi-instance behavior. Follows project testing conventions. |
| ui/litellm-dashboard/src/components/Navbar/UserDropdown/UserDropdown.tsx | Added "Hide Usage Indicator" toggle following the same pattern as the existing "Hide All Prompts" toggle. Clean integration with localStorage utilities. |
| ui/litellm-dashboard/src/components/UsageIndicator.tsx | Renamed from usage_indicator.tsx. Added useDisableUsageIndicator hook and disableUsageIndicator check to conditionally hide the component. API call still fires when disabled. Contains unused NavStyleView component (pre-existing). |
| ui/litellm-dashboard/src/components/UsageIndicator.test.tsx | New comprehensive test suite replacing the old tests. 12 tests including the new disable behavior, loading/error states, and user interactions. Uses screen and userEvent per project conventions. |
| ui/litellm-dashboard/src/components/usage_indicator.test.tsx | Deleted old test file as part of the file rename from usage_indicator.tsx to UsageIndicator.tsx. |
| ui/litellm-dashboard/src/app/(dashboard)/components/Sidebar2.tsx | Updated import path from usage_indicator to UsageIndicator and reformatted indentation of the menuItems array (whitespace-only changes). |
| ui/litellm-dashboard/src/components/leftnav.tsx | Updated import path from usage_indicator to UsageIndicator and minor import reordering. |
Sequence Diagram
sequenceDiagram
participant User as User
participant Dropdown as UserDropdown
participant LS as localStorage
participant Hook as useDisableUsageIndicator
participant UI as UsageIndicator
User->>Dropdown: Toggle "Hide Usage Indicator"
Dropdown->>LS: setLocalStorageItem("disableUsageIndicator", "true")
Dropdown->>LS: emitLocalStorageChange("disableUsageIndicator")
LS-->>Hook: CustomEvent(LOCAL_STORAGE_EVENT)
Hook->>Hook: useSyncExternalStore re-reads snapshot
Hook-->>UI: disableUsageIndicator = true
UI->>UI: return null (hidden)
Contributor
Additional Comments (1)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relevant issues
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unitCI (LiteLLM team)
Branch creation CI run
Link:
CI run for the last commit
Link:
Merge / cherry-pick CI run
Links:
Type
🆕 New Feature
✅ Test
Changes
Adds an option to hide the usage indicator in the dashboard UI. A "Hide Usage Indicator" toggle is available in the user dropdown; when enabled, the setting is stored in localStorage (
disableUsageIndicator) and the usage indicator is not rendered in the sidebar. A newuseDisableUsageIndicatorhook usesuseSyncExternalStoreso the preference stays in sync across tabs (storage events and a custom event). The usage indicator component was renamed fromusage_indicator.tsxtoUsageIndicator.tsx; tests were added foruseDisableUsageIndicatorand forUsageIndicator(including the hide-when-disabled behavior).Screenshots