Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(usage): show Codex and Claude subscription limits on a Limits tab #9507

Mergedjuliusmarmingemerged 7 commits intomain fromrefs/pull/9507/headmerged by juliusmarminge View on GitHub

Showing 56 changed files with 186 additions and 0 deletions (loading 53).

x
0 of 56 viewed, 56 left
183 additions and 0 deletionsapps/mobile/src/features/usage/UsageLimitsSection.tsxAdded
View file
@@ -0,0 +1,183 @@
+import { useAtomValue } from "@effect/atom-react";
+import type {
+ ServerProvider,
+ ServerProviderUsageWindow,
+ UsageLimitSourceAccount,
+} from "@t3tools/contracts";
+import {
+ collectLimitSources,
+ collectLimitsGroups,
+ elapsedShare,
+ formatResetsIn,
+ limitsNotice,
+ paceOf,
+ providerLimitsLabel,
+} from "@t3tools/shared/usageLimits";
+import { useState } from "react";
+import { View } from "react-native";
+​
+import { AppText as Text } from "../../components/AppText";
+import { environmentPresentations } from "../../state/presentation";
+import { SettingsSection } from "../settings/components/SettingsSection";
+​
+const PACE_LABEL = { ahead: "ahead of pace", on: "on pace", under: "under pace" } as const;
+​
+/**
+ * One window as a bar spanning its whole duration: the fill is quota spent,
+ * the hairline is how far into the window the clock is.
+ */
+function WindowBar(props: { readonly window: ServerProviderUsageWindow; readonly now: number }) {
+ const { window, now } = props;