From c585cee12f3b3e3bd357badc4ca8385857121516 Mon Sep 17 00:00:00 2001 From: DhanushSantosh Date: Thu, 15 Jan 2026 21:05:35 +0530 Subject: [PATCH] feat: add dynamic usage status icon and tab-aware updates to usage button - Add provider icon (Anthropic/OpenAI) that displays based on active tab - Icon color reflects usage status (green/orange/red) - Progress bar and stale indicator update dynamically when switching tabs - Shows Claude metrics when Claude tab is active, Codex metrics when Codex tab is active Co-Authored-By: Claude Haiku 4.5 --- apps/ui/src/components/usage-popover.tsx | 32 +++++++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/apps/ui/src/components/usage-popover.tsx b/apps/ui/src/components/usage-popover.tsx index fa8a6a1b..ac15a519 100644 --- a/apps/ui/src/components/usage-popover.tsx +++ b/apps/ui/src/components/usage-popover.tsx @@ -333,19 +333,43 @@ export function UsagePopover() { return 'bg-green-500'; }; + // Determine which provider icon and percentage to show based on active tab + const getTabInfo = () => { + if (activeTab === 'claude') { + return { + icon: AnthropicIcon, + percentage: claudeMaxPercentage, + isStale: isClaudeStale, + }; + } + return { + icon: OpenAIIcon, + percentage: codexMaxPercentage, + isStale: isCodexStale, + }; + }; + + const tabInfo = getTabInfo(); + const statusColor = getStatusInfo(tabInfo.percentage).color; + const ProviderIcon = tabInfo.icon; + const trigger = ( -