GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(usage): say resets momentarily in the final minute (#17869) · pingdotgg/t3code@2625327

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/mobile/src/features/usage
    • UsageLimitsPooled.tsx
  • packages/shared/src
    • usageLimits.test.ts
    • usageLimits.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/mobile/src/features/usage/UsageLimitsPooled.tsx‎

Copy file name to clipboardExpand all lines: apps/mobile/src/features/usage/UsageLimitsPooled.tsx
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
collectLimitPools,
99
cursorUsageWindowDetails,
1010
displayLimitWindows,
11-
formatDuration,
1211
formatResetsIn,
1312
remainingPercent,
1413
type LimitAccount,
@@ -123,7 +122,9 @@ function PoolWindowCard({
123122
{nextRefill ? (
124123
<Text className="text-xs tabular-nums text-foreground-muted">
125124
↻ +{nextRefill.restoresPercent}%{" "}
126-
{nextRefill.at <= now ? "now" : `in ${formatDuration(nextRefill.at - now)}`}
125+
{formatResetsIn(nextRefill.member.window, now)
126+
?.replace("resets in ", "in ")
127+
.replace("resets now", "now")}
127128
</Text>
128129
) : null}
129130
<View className="flex-row gap-1">
Collapse file

‎packages/shared/src/usageLimits.test.ts‎

Copy file name to clipboardExpand all lines: packages/shared/src/usageLimits.test.ts
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,20 @@ function provider(overrides: Partial<ServerProvider>): ServerProvider {
5656
}
5757

5858
describe("pace", () => {
59+
it.each([
60+
["2026-09-03T12:01:00.000Z", "resets in 1m"],
61+
["2026-09-03T12:00:59.999Z", "Resets momentarily"],
62+
["2026-09-03T12:00:00.001Z", "Resets momentarily"],
63+
["2026-09-03T12:00:00.000Z", "resets now"],
64+
["2026-09-03T11:59:59.999Z", "resets now"],
65+
])("formats the reset boundary at %s", (resetsAt, label) => {
66+
expect(formatResetsIn({ ...window, resetsAt }, now)).toBe(label);
67+
});
68+
69+
it("ignores invalid reset timestamps", () => {
70+
expect(formatResetsIn({ ...window, resetsAt: "invalid" }, now)).toBeNull();
71+
});
72+
5973
it("places the clock three fifths through a five-hour window with two hours left", () => {
6074
expect(elapsedShare(window, now)).toBeCloseTo(0.6);
6175
expect(paceOf(window, now)).toBe("under");
Collapse file

‎packages/shared/src/usageLimits.ts‎

Copy file name to clipboardExpand all lines: packages/shared/src/usageLimits.ts
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,9 @@ export function formatDuration(ms: number): string {
607607
export function formatResetsIn(window: ServerProviderUsageWindow, now: number): string | null {
608608
const resetsAt = resetMillis(window);
609609
if (resetsAt === null) return null;
610-
return resetsAt <= now ? "resets now" : `resets in ${formatDuration(resetsAt - now)}`;
610+
if (resetsAt <= now) return "resets now";
611+
if (resetsAt - now < MINUTE) return "Resets momentarily";
612+
return `resets in ${formatDuration(resetsAt - now)}`;
611613
}
612614

613615
/** Limit commands are served by T3 from the same snapshots as Usage → Limits. */

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.