mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-04 09:13:08 +00:00
fix: drive usage indicator by active provider window
This commit is contained in:
@@ -244,23 +244,26 @@ export function UsagePopover() {
|
|||||||
return 'bg-green-500';
|
return 'bg-green-500';
|
||||||
};
|
};
|
||||||
|
|
||||||
// Determine which provider icon and percentage to show on the header button
|
const codexWindowMinutes = codexUsage?.rateLimits?.primary?.windowDurationMins ?? null;
|
||||||
const hasClaudeUsage = Boolean(claudeUsage);
|
const codexWindowLabel = codexWindowMinutes
|
||||||
const hasCodexUsage = Boolean(codexUsage);
|
? getCodexWindowLabel(codexWindowMinutes).title
|
||||||
const useClaudeIndicator = hasClaudeUsage || (!hasCodexUsage && isClaudeAuthenticated);
|
: 'Window';
|
||||||
const indicatorInfo = useClaudeIndicator
|
|
||||||
? {
|
// Determine which provider icon and percentage to show based on active tab
|
||||||
icon: AnthropicIcon,
|
const indicatorInfo =
|
||||||
percentage: claudeSessionPercentage,
|
activeTab === 'claude'
|
||||||
isStale: isClaudeStale,
|
? {
|
||||||
title: `Session usage (${CLAUDE_SESSION_WINDOW_HOURS}h window)`,
|
icon: AnthropicIcon,
|
||||||
}
|
percentage: claudeSessionPercentage,
|
||||||
: {
|
isStale: isClaudeStale,
|
||||||
icon: OpenAIIcon,
|
title: `Session usage (${CLAUDE_SESSION_WINDOW_HOURS}h window)`,
|
||||||
percentage: codexMaxPercentage,
|
}
|
||||||
isStale: isCodexStale,
|
: {
|
||||||
title: 'Usage',
|
icon: OpenAIIcon,
|
||||||
};
|
percentage: codexMaxPercentage,
|
||||||
|
isStale: isCodexStale,
|
||||||
|
title: `Usage (${codexWindowLabel})`,
|
||||||
|
};
|
||||||
|
|
||||||
const statusColor = getStatusInfo(indicatorInfo.percentage).color;
|
const statusColor = getStatusInfo(indicatorInfo.percentage).color;
|
||||||
const ProviderIcon = indicatorInfo.icon;
|
const ProviderIcon = indicatorInfo.icon;
|
||||||
|
|||||||
Reference in New Issue
Block a user