Skip to content

fix: lower pollen balance threshold from 1 to 0.5 - #15

Merged
Simplereally merged 3 commits into
mainfrom
fix/lower-pollen-balance-threshold
Jan 16, 2026
Merged

Simplereally merged 3 commits into
mainfrom
fix/lower-pollen-balance-threshold

Conversation

@Simplereally

@Simplereally Simplereally commented Jan 16, 2026

Copy link
Copy Markdown
Owner

Summary

Lowers the user's pollen balance warning threshold from the default of 1.0 to 0.5.

Changes

  • Updated DEFAULT_LOW_BALANCE_THRESHOLD in hooks/use-pollen-balance.ts from 1 to 0.5.
  • Simplified the low balance warning tooltip text in components/pollen-balance/pollen-balance-display-view.tsx to remain concise.

Rationale

Users can continue to generate images with fractional pollen amounts, so warning at 1.0 was premature. This change reduces noise for users who still have workable balances.

Summary by CodeRabbit

  • Bug Fixes
    • Low-balance warning threshold lowered to 0.5 pollen to better reflect available units.
    • Low-balance warning message simplified to "Your balance is running low."
    • Tooltip and balance display messages made consistent for clearer, more concise notices.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel

vercel Bot commented Jan 16, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
bloomstudio Ready Ready Preview, Comment Jan 16, 2026 8:56am

@coderabbitai

coderabbitai Bot commented Jan 16, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@Simplereally has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 22 minutes and 15 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between d5e596d and 994d495.

📒 Files selected for processing (1)
  • hooks/use-pollen-balance.ts
📝 Walkthrough

Walkthrough

Updates to the low-balance UI and balance hook: JSX formatting and shortened low-balance message in the display component, default low-balance threshold reduced from 1 to 0.5, and related test expectation adjustments.

Changes

Cohort / File(s) Summary
Low-Balance Display Updates
components/pollen-balance/pollen-balance-display-view.tsx
JSX formatting: consolidated TooltipContent opening tags. UI text: shortened low-balance message from "Your balance is running low. Consider topping up." to "Your balance is running low." in display and tooltip locations.
Balance Threshold Configuration
hooks/use-pollen-balance.ts
Changed exported DEFAULT_LOW_BALANCE_THRESHOLD from 1 to 0.5 and updated accompanying comment.
Tests Updated
hooks/use-pollen-balance.test.tsx
Adjusted mocked balance values and minor formatting in assertions; expectations changed to reflect threshold behavior (e.g., 0.49 used where previously 0.5).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A tiny hop, the number slips to half,
The tooltip trims its gentle chaff,
Tests nod softly, balances inch low,
A rabbit cheers the little flow — ha-ha, let's go! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: lowering the pollen balance threshold from 1 to 0.5, which aligns with the primary modifications across all three files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@hooks/use-pollen-balance.ts`:
- Around line 36-40: The comment above DEFAULT_LOW_BALANCE_THRESHOLD is outdated
(mentions “Set to 1…”) and should be updated to reflect the current 0.5 value;
edit the comment near the DEFAULT_LOW_BALANCE_THRESHOLD constant in
use-pollen-balance (hooks/use-pollen-balance.ts) so the text states that the
default low balance threshold is 0.5 pollen and remove or correct the reference
to 1 to avoid future confusion.
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3c05fdd and 404200e.

📒 Files selected for processing (2)
  • components/pollen-balance/pollen-balance-display-view.tsx
  • hooks/use-pollen-balance.ts
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Always leverage TypeScript (strict mode); avoid usage of any which defeats the point of using TypeScript.
Let TypeScript inference work; export explicit prop types for shared/public components.
No any type in TypeScript. Use unknown and narrow instead.
Avoid as casts in TypeScript; prefer satisfies, generics, and runtime validation.
@ts-expect-error allowed only with a comment explaining why + link/TODO to remove.

Files:

  • components/pollen-balance/pollen-balance-display-view.tsx
  • hooks/use-pollen-balance.ts
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Avoid useEffect for app data fetching. Use it for browser-only side effects (subscriptions, observers, localStorage).

Files:

  • components/pollen-balance/pollen-balance-display-view.tsx
🧠 Learnings (1)
📚 Learning: 2026-01-16T04:33:52.104Z
Learnt from: Simplereally
Repo: Simplereally/bloomstudio PR: 13
File: app/_server/actions/invalidation.ts:25-28
Timestamp: 2026-01-16T04:33:52.104Z
Learning: In Next.js app router, revalidateTag(tag, secondArg) accepts a second parameter that can be a string or a CacheLifeConfig. Use revalidateTag(tag, "max") to enable stale-while-revalidate behavior. This applies to all TypeScript files that invoke revalidateTag in app routes; ensure the second argument is appropriate for your cache strategy and verify Next.js version supports this usage.

Applied to files:

  • hooks/use-pollen-balance.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Run Tests
🔇 Additional comments (3)
components/pollen-balance/pollen-balance-display-view.tsx (3)

59-61: Formatting change looks good.


101-103: Formatting change looks good.


120-122: Concise low-balance message is fine.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment thread hooks/use-pollen-balance.ts
@Simplereally
Simplereally merged commit 8b4c7a3 into main Jan 16, 2026
2 of 3 checks passed

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@hooks/use-pollen-balance.test.tsx`:
- Line 256: The inline test comment is stale — update the comment or the test
value to match the new DEFAULT_LOW_BALANCE_THRESHOLD (0.5). Locate the line
using mockFetchPollenBalance.mockResolvedValue({ balance: 0.49 }) and either
change the comment to say "Below default threshold of 0.5" or adjust the mocked
balance to be below/above DEFAULT_LOW_BALANCE_THRESHOLD as intended; reference
DEFAULT_LOW_BALANCE_THRESHOLD and mockFetchPollenBalance in your change so the
test and comment remain consistent.
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 404200e and d5e596d.

📒 Files selected for processing (1)
  • hooks/use-pollen-balance.test.tsx
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Always leverage TypeScript (strict mode); avoid usage of any which defeats the point of using TypeScript.
Let TypeScript inference work; export explicit prop types for shared/public components.
No any type in TypeScript. Use unknown and narrow instead.
Avoid as casts in TypeScript; prefer satisfies, generics, and runtime validation.
@ts-expect-error allowed only with a comment explaining why + link/TODO to remove.

Files:

  • hooks/use-pollen-balance.test.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Avoid useEffect for app data fetching. Use it for browser-only side effects (subscriptions, observers, localStorage).

Files:

  • hooks/use-pollen-balance.test.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Run Tests
🔇 Additional comments (3)
hooks/use-pollen-balance.test.tsx (3)

51-71: LGTM!

The formatting improvements in the property-based test enhance readability without affecting test behavior.


208-210: LGTM!

The hanging promise correctly simulates a pending fetch for loading state verification.


130-137: LGTM!

Good use of the imported DEFAULT_LOW_BALANCE_THRESHOLD constant—these tests automatically adapt to the updated threshold value without requiring code changes.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

});

mockFetchPollenBalance.mockResolvedValue({ balance: 0.5 }); // Below default threshold of 1
mockFetchPollenBalance.mockResolvedValue({ balance: 0.49 }); // Below default threshold of 1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Stale comment: threshold reference is outdated.

The comment still references the old threshold of 1, but DEFAULT_LOW_BALANCE_THRESHOLD is now 0.5.

📝 Suggested fix
-      mockFetchPollenBalance.mockResolvedValue({ balance: 0.49 }); // Below default threshold of 1
+      mockFetchPollenBalance.mockResolvedValue({ balance: 0.49 }); // Below default threshold of 0.5
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
mockFetchPollenBalance.mockResolvedValue({ balance: 0.49 }); // Below default threshold of 1
mockFetchPollenBalance.mockResolvedValue({ balance: 0.49 }); // Below default threshold of 0.5
🤖 Prompt for AI Agents
In `@hooks/use-pollen-balance.test.tsx` at line 256, The inline test comment is
stale — update the comment or the test value to match the new
DEFAULT_LOW_BALANCE_THRESHOLD (0.5). Locate the line using
mockFetchPollenBalance.mockResolvedValue({ balance: 0.49 }) and either change
the comment to say "Below default threshold of 0.5" or adjust the mocked balance
to be below/above DEFAULT_LOW_BALANCE_THRESHOLD as intended; reference
DEFAULT_LOW_BALANCE_THRESHOLD and mockFetchPollenBalance in your change so the
test and comment remain consistent.

@Simplereally
Simplereally deleted the fix/lower-pollen-balance-threshold branch January 16, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant