feat(redeem): funnel low-Points users from RC top-up to in-app Points purchase#3281
Conversation
… purchase The RC top-up redeem screen previously just disabled Next when the price exceeded the Points balance, with no message and no way to get more Points. - Show an 'insufficient Points' message when price > balance. - Add an always-visible 'Buy Points' action that opens the in-app Points purchase (native Apple/Google billing via the Boost/IAP screen), so a user with no Hive can buy Points and return to finish the top-up. Shown even with enough balance so users can stock up for later. No SDK bump (uses existing navigation + the existing IAP screen).
|
Warning Review limit reached
More reviews will be available in 21 minutes and 57 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe RC Top-Up screen gains a ChangesRC Top-Up Insufficient Points Flow
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7a01951aa5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const _onBuyPoints = () => { | ||
| RootNavigation.navigate({ | ||
| name: ROUTES.SCREENS.BOOST, | ||
| params: { username: currentAccountName }, | ||
| }); |
There was a problem hiding this comment.
Refresh point balance after returning from purchase
When a low-Points user opens this purchase flow, completes an IAP, and backs out, the RC top-up screen is still mounted and its balance only changes when pointsQuery.data changes. BoostScreen only shows a toast on purchase success and does not pass fetchData or invalidate the points query, while the shared query client disables focus refetches, so the old balance can keep Next disabled and the insufficient warning visible even after the purchase credits. Add an explicit refetch/invalidation on return or purchase success before expecting the user to finish the top-up.
Useful? React with 👍 / 👎.
- Refetch the Points balance with useFocusEffect when the RC top-up screen regains focus, so Points bought via the IAP show up on return (RN refetch-on-focus is AppState-based, not navigation-based) and the user can finish the top-up without leaving the screen. - Add paddingHorizontal to the Buy Points button for a comfortable tap target.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/screens/redeem/children/rcTopUp.tsx`:
- Around line 1-11: The import order violates ESLint's import/order rule. The
useFocusEffect import from `@react-navigation/native` on line 11 is an external
third-party import that must be grouped with the other external imports at the
top of the file, before the relative imports. Move the useFocusEffect import
line to be positioned after the other external imports (such as after the import
from `@ecency/sdk`) and before the relative imports (such as before the
ScaleSlider import).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 99801269-4fb4-4ba2-8bc7-75f258a10bbf
📒 Files selected for processing (3)
src/config/locales/en-US.jsonsrc/screens/redeem/children/rcTopUp.tsxsrc/screens/redeem/styles/boostPlus.styles.ts
…ports (eslint import/order)
Mobile counterpart to the web buy-Points funnel. The RC top-up redeem screen used to just disable Next when the user lacked enough Points, with no message and no path forward.
Changes (
src/screens/redeem/children/rcTopUp.tsx)099points...9999points). After the purchase credits Points, the user returns and the balance query refetches so they can finish the top-up.Mobile is the easiest conversion path here since the purchase is the OS payment sheet (no crypto, no QR). No SDK bump (uses existing navigation + the existing IAP screen), so it ships on the next app build. Strings added to
en-US.jsononly.Summary by CodeRabbit