The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 23, 03:00 UTC
fix(web,mobile): limit bars use each provider's chart color (#16936)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Charlie Lockyer committed
Oct 18, 2026 at 13:08 UTC
64a3ca48fb99651e6445928d68bf8b07dd1f21d4
4 files changed
+14
-21
apps/mobile/src/features/usage/UsageLimitsPooled.tsx
+2
-8
@@ -24,7 +24,7 @@ import { ProviderIcon } from "../../components/ProviderIcon";
24
import { SettingsScreen } from "../settings/components/SettingsScreen";
25
import { environmentPresentations } from "../../state/presentation";
26
import { ResetCredits } from "./UsageLimitsSection";
27
-import { useProviderColors } from "./usageProviders";
27
+import { usageProviderKind, useProviderColors } from "./usageProviders";
28
29
const DRIVER_LABEL: Partial<Record<string, string>> = {
30
codex: "Codex",
@@ -283,13 +283,7 @@ export function UsageLimitsSection({
283
<PoolWindowCard
284
key={`${window.kind}:${window.id}`}
285
pool={window}
286
- color={
287
- pool.driver === "claudeAgent"
288
- ? colors.claude
289
- : pool.driver === "antigravity"
290
- ? colors.antigravity
291
- : colors.codex
292
- }
286
+ color={colors[usageProviderKind(pool.driver) ?? "codex"]}
287
now={now}
288
environmentIds={
289
selectedEnvironmentIds === null ? null : [...selectedEnvironmentIds]
apps/mobile/src/features/usage/UsageLimitsSection.tsx
+2
-4
@@ -8,7 +8,6 @@ import {
8
type ServerProvider,
9
type ServerProviderResetCredits,
10
type ServerProviderUsageWindow,
11
- type UsageProviderKind,
11
} from "@t3tools/contracts";
12
import {
13
elapsedShare,
@@ -28,7 +27,7 @@ import { environmentPresentations } from "../../state/presentation";
27
import { serverEnvironment } from "../../state/server";
28
import { readEnvironmentScope, useEnvironmentScope } from "../../state/session";
29
import { useAtomCommand } from "../../state/use-atom-command";
31
-import { useProviderColors } from "./usageProviders";
30
+import { usageProviderKind, useProviderColors } from "./usageProviders";
31
32
const PACE_LABEL = { ahead: "ahead of pace", on: "on pace", under: "under pace" } as const;
33
@@ -36,8 +35,7 @@ type Driver = ServerProvider["driver"];
35
36
function useBarColor(driver: Driver): string | null {
37
const colors = useProviderColors();
39
- const kind: UsageProviderKind | null =
40
- driver === "codex" ? "codex" : driver === "claudeAgent" ? "claude" : null;
38
+ const kind = usageProviderKind(driver);
39
return kind ? colors[kind] : null;
40
}
41
apps/mobile/src/features/usage/usageProviders.ts
+6
@@ -11,6 +11,12 @@ export const PROVIDER_ORDER: readonly UsageProviderKind[] = [
11
"pi",
12
];
13
14
+/** The usage series a provider driver reports under, or null for drivers without one. */
15
+export function usageProviderKind(driver: string): UsageProviderKind | null {
16
+ if (driver === "claudeAgent") return "claude";
17
+ return PROVIDER_ORDER.find((kind) => kind === driver) ?? null;
18
+}
19
+
20
export const PROVIDER_LABEL: Record<UsageProviderKind, string> = {
21
claude: "Claude Code",
22
codex: "Codex",
apps/web/src/components/usage/UsageLimits.tsx
+4
-9
@@ -47,15 +47,10 @@ const PACE: Record<LimitPace, { readonly label: string; readonly icon: typeof Ga
47
};
48
49
export function barColor(driver: ServerProvider["driver"]): string {
50
- const kind: UsageProviderKind | undefined =
51
- driver === "codex"
52
- ? "codex"
53
- : driver === "claudeAgent"
54
- ? "claude"
55
- : driver === "antigravity"
56
- ? "antigravity"
57
- : undefined;
58
- return kind ? PROVIDER_PRESENTATION[kind].color : "var(--foreground)";
50
+ const presentation = Object.values(PROVIDER_PRESENTATION).find(
51
+ (entry) => entry.driverKind === driver,
52
+ );
53
+ return presentation?.color ?? "var(--foreground)";
54
}
55
56
export function PaceIcon({ pace }: { readonly pace: LimitPace }) {