From 404200ebdc052f17388471273fd7cb3680630028 Mon Sep 17 00:00:00 2001 From: Simplereally Date: Fri, 16 Jan 2026 19:38:55 +1100 Subject: [PATCH 1/3] fix: lower pollen balance threshold from 1 to 0.5 --- .../pollen-balance/pollen-balance-display-view.tsx | 10 +++++----- hooks/use-pollen-balance.ts | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/pollen-balance/pollen-balance-display-view.tsx b/components/pollen-balance/pollen-balance-display-view.tsx index 09cd8f9..4fa1e74 100644 --- a/components/pollen-balance/pollen-balance-display-view.tsx +++ b/components/pollen-balance/pollen-balance-display-view.tsx @@ -56,8 +56,8 @@ export const PollenBalanceDisplayView = memo(function PollenBalanceDisplayView({ Error -
@@ -98,8 +98,8 @@ export const PollenBalanceDisplayView = memo(function PollenBalanceDisplayView({ {formattedBalance} -
@@ -118,7 +118,7 @@ export const PollenBalanceDisplayView = memo(function PollenBalanceDisplayView({

{isLowBalance - ? "Your balance is running low. Consider topping up." + ? "Your balance is running low." : "Your current Pollinations account balance."}

diff --git a/hooks/use-pollen-balance.ts b/hooks/use-pollen-balance.ts index b6a1065..1a4e4b0 100644 --- a/hooks/use-pollen-balance.ts +++ b/hooks/use-pollen-balance.ts @@ -35,9 +35,9 @@ import { queryKeys, STALE_TIMES, GC_TIMES } from "@/lib/query"; /** * Default threshold for low balance warning (in pollen units) * Set to 1 because we can't infer max balance from the API - users can top up - * via Polar.sh at any time. 1 pollen means they're genuinely running low. + * via Polar.sh at any time. 0.5 pollen means they're genuinely running low. */ -export const DEFAULT_LOW_BALANCE_THRESHOLD = 1; +export const DEFAULT_LOW_BALANCE_THRESHOLD = 0.5; /** * Minimum interval between balance refreshes (in milliseconds) From d5e596df8f52526d1afd0f01ee2f2219601d3ee0 Mon Sep 17 00:00:00 2001 From: Simplereally Date: Fri, 16 Jan 2026 19:47:47 +1100 Subject: [PATCH 2/3] test: Update mock balance value and apply minor formatting in `usePollenBalance` tests. --- hooks/use-pollen-balance.test.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hooks/use-pollen-balance.test.tsx b/hooks/use-pollen-balance.test.tsx index 7963aec..9ba6dbe 100644 --- a/hooks/use-pollen-balance.test.tsx +++ b/hooks/use-pollen-balance.test.tsx @@ -55,12 +55,12 @@ describe("hooks/use-pollen-balance", () => { (balance) => { const result = formatBalance(balance); expect(result).not.toBeNull(); - + // Verify format: should have exactly 2 decimal places const parts = result!.split("."); expect(parts.length).toBe(2); expect(parts[1].length).toBe(2); - + // Verify the numeric value is preserved (within floating point tolerance) const parsed = parseFloat(result!); expect(Math.abs(parsed - balance)).toBeLessThan(0.01); @@ -206,7 +206,7 @@ describe("usePollenBalance hook", () => { // Make fetch hang to test loading state mockFetchPollenBalance.mockImplementation( - () => new Promise(() => {}) // Never resolves + () => new Promise(() => { }) // Never resolves ); const { result } = renderHook(() => usePollenBalance(), { @@ -253,7 +253,7 @@ describe("usePollenBalance hook", () => { isLoading: false, }); - mockFetchPollenBalance.mockResolvedValue({ balance: 0.5 }); // Below default threshold of 1 + mockFetchPollenBalance.mockResolvedValue({ balance: 0.49 }); // Below default threshold of 1 const { result } = renderHook(() => usePollenBalance(), { wrapper: createWrapper(), From 994d4957e386d69ea40bb5ee186ac0ca20b608ce Mon Sep 17 00:00:00 2001 From: Simplereally Date: Fri, 16 Jan 2026 19:51:15 +1100 Subject: [PATCH 3/3] fix: Adjust default low balance warning threshold from 1 to 0.5 pollen units. --- hooks/use-pollen-balance.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks/use-pollen-balance.ts b/hooks/use-pollen-balance.ts index 1a4e4b0..66c37d6 100644 --- a/hooks/use-pollen-balance.ts +++ b/hooks/use-pollen-balance.ts @@ -34,7 +34,7 @@ import { queryKeys, STALE_TIMES, GC_TIMES } from "@/lib/query"; /** * Default threshold for low balance warning (in pollen units) - * Set to 1 because we can't infer max balance from the API - users can top up + * Set to 0.5 because we can't infer max balance from the API - users can top up * via Polar.sh at any time. 0.5 pollen means they're genuinely running low. */ export const DEFAULT_LOW_BALANCE_THRESHOLD = 0.5;