Skip to content

Peanut wallet#1342

Merged
Hugo0 merged 9 commits intopeanut-wallet-devfrom
peanut-wallet
Oct 20, 2025
Merged

Peanut wallet#1342
Hugo0 merged 9 commits intopeanut-wallet-devfrom
peanut-wallet

Conversation

@Hugo0
Copy link
Contributor

@Hugo0 Hugo0 commented Oct 20, 2025

pull main

@vercel
Copy link

vercel bot commented Oct 20, 2025

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

Project Deployment Preview Comments Updated (UTC)
peanut-wallet Error Error Oct 20, 2025 3:09pm

💡 Enable Vercel Agent with $100 free credit for automated AI reviews

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 20, 2025

Important

Review skipped

More than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review.

184 files out of 291 files are above the max files limit of 100. Please upgrade to Pro plan to get higher limits.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Updates two redirect targets in redirects.json, refactors invite-code generation to use a new suffix utility, adds non‑Euro SEPA detection and a temporary-unavailable UI/disable path on the bank withdraw page, and adjusts banner z-index/vertical offset in the recipient client.

Changes

Cohort / File(s) Change Summary
Configuration & Redirects
redirects.json
Updated two redirect destinations: /pints now points to https://luma.com/zwh7l3ro (previously /adag1o/1), and /events now points to https://luma.com/zwh7l3ro (previously https://lu.ma/7j6g06rq).
Utility Functions
src/utils/general.utils.ts
Added generateInviteCodeSuffix(username: string) to compute a deterministic 3‑digit suffix; added getValidRedirectUrl(redirectUrl: string, fallbackRoute: string) for decoding/sanitizing redirect URLs; refactored generateInviteCodeLink() to use the new suffix generator.
Points Page Refactor
src/app/(mobile-ui)/points/page.tsx
Replaced manual invite code/link concatenation with generateInviteCodeLink(username), removed local env-based string assembly, and updated imports/types for invite utilities.
Withdrawal Page Enhancement
src/app/(mobile-ui)/withdraw/[country]/bank/page.tsx
Added isNonEuroSepaCountry detection; displays a warning block for non‑Euro SEPA destinations; disables primary Withdraw action (and adjusts label to "Temporarily Unavailable") and affects Retry/Withdraw interactive states when true.
Banner Styling Adjustment
src/app/[...recipient]/client.tsx
Adjusted banner container classes: added z-50, changed md:top-18md:top-22, and set md:z-0, modifying stacking order and medium-screen vertical placement.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Heterogeneous edits span configuration, utility logic, refactor, and UI/UX changes; review requires checking URL safety, deterministic suffix logic, invite-link behavior, conditional UI disabling, and a small styling adjustment.

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • kushagrasarathe
  • jjramirezn

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 2 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title Check ❓ Inconclusive The title "Peanut wallet" is generic and vague. While "Peanut" appears to be the project name (based on the repository context), the title does not communicate the actual changes in this pull request. The changeset includes diverse modifications: updating redirects, refactoring invite code generation, adding withdrawal warnings, adjusting banner CSS, and adding utility functions. The title "Peanut wallet" does not convey any meaningful information about what is being changed or improved in this specific PR. Consider using a more descriptive title that highlights the primary change. For example, if the main goal is to refactor invite code generation and improve the withdrawal flow, the title could be something like "Refactor invite code generation and add SEPA withdrawal warnings" to give reviewers and future maintainers a clear understanding of the changeset at a glance.
Description Check ❓ Inconclusive The description "pull main" is extremely vague and generic. It does not describe any of the actual changes in the pull request, including the redirect updates, invite code refactoring, SEPA withdrawal warnings, banner CSS adjustments, or new utility functions. While it mentions pulling from main, it conveys no meaningful information about what changes are being introduced or why they are needed. Provide a proper pull request description that outlines the key changes and their purpose. For example: explain what functionality was updated (redirects, invite code generation, withdrawal flow), what problems these changes address, and any relevant context for reviewers to understand the scope and impact of the PR.

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

@coderabbitai coderabbitai bot added the enhancement New feature or request label Oct 20, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/app/(mobile-ui)/withdraw/[country]/bank/page.tsx (1)

43-49: Consider clarifying the comment.

The comment "non-eur sepa countries" could be more precise. SEPA includes countries with various currencies (PLN, CZK, etc.), not just EUR. Consider rewording to: "SEPA countries using non-EUR currencies (excluding USD and MXN which are handled separately)" for better clarity.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f0c586a and df9d3aa.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • redirects.json (1 hunks)
  • src/app/(mobile-ui)/points/page.tsx (2 hunks)
  • src/app/(mobile-ui)/withdraw/[country]/bank/page.tsx (3 hunks)
  • src/app/[...recipient]/client.tsx (1 hunks)
  • src/utils/general.utils.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-10-08T17:13:13.155Z
Learnt from: Zishan-7
PR: peanutprotocol/peanut-ui#1299
File: src/app/(mobile-ui)/points/page.tsx:41-51
Timestamp: 2025-10-08T17:13:13.155Z
Learning: In `src/app/(mobile-ui)/points/page.tsx`, the icon name "invite-heart" is intentionally used (not "inviter-heart") when displaying who invited the current user, as this is a deliberate design choice despite semantic differences with UserHeader usage.

Applied to files:

  • src/app/(mobile-ui)/points/page.tsx
📚 Learning: 2025-05-22T15:38:48.586Z
Learnt from: kushagrasarathe
PR: peanutprotocol/peanut-ui#869
File: src/app/(mobile-ui)/withdraw/page.tsx:82-88
Timestamp: 2025-05-22T15:38:48.586Z
Learning: The country-specific withdrawal route exists at src/app/(mobile-ui)/withdraw/[...country]/page.tsx and renders the AddWithdrawCountriesList component with flow="withdraw".

Applied to files:

  • src/app/(mobile-ui)/withdraw/[country]/bank/page.tsx
🧬 Code graph analysis (2)
src/app/(mobile-ui)/points/page.tsx (1)
src/utils/general.utils.ts (1)
  • generateInviteCodeLink (1349-1354)
src/app/(mobile-ui)/withdraw/[country]/bank/page.tsx (1)
src/components/0_Bruddle/Button.tsx (1)
  • Button (76-267)
🔇 Additional comments (7)
redirects.json (1)

40-40: Verify both redirects point to the same destination.

Both /pints and /events now redirect to the identical Luma URL (https://luma.com/zwh7l3ro). Please confirm this is intentional and not a copy-paste error.

Also applies to: 45-45

src/app/[...recipient]/client.tsx (1)

470-470: Verify z-index layering doesn't conflict with other UI elements.

The banner now has z-50 on mobile viewports, which is a high stacking priority. Confirm this doesn't obscure navigation, modals, dropdowns, or other interactive elements that might appear over the banner.

src/utils/general.utils.ts (3)

1340-1347: LGTM!

The simple character-code hash is appropriate for generating a cosmetic suffix. While collisions are possible (e.g., anagrams produce identical hashes), this is acceptable since the suffix is purely decorative and doesn't affect functionality.


1349-1354: LGTM!

Clean refactor that extracts the suffix generation logic into a dedicated helper function. The invite code format remains consistent, and returning both inviteLink and inviteCode provides better API ergonomics for consumers.


1356-1372: LGTM!

Proper URL decoding and sanitization with fallback handling. The function correctly leverages the existing sanitizeRedirectURL logic to prevent open redirect vulnerabilities.

src/app/(mobile-ui)/points/page.tsx (1)

14-15: LGTM!

Excellent refactor that eliminates code duplication by leveraging the new generateInviteCodeLink utility. The destructured return value provides cleaner code compared to manual string concatenation.

Also applies to: 30-30

src/app/(mobile-ui)/withdraw/[country]/bank/page.tsx (1)

255-270: LGTM!

Solid implementation of the non-Euro SEPA handling:

  • Clear warning UI with appropriate styling
  • Buttons correctly disabled when service is unavailable
  • User-friendly messaging about temporary unavailability

The UX gracefully informs users about the limitation without breaking the flow.

Also applies to: 274-274, 291-291, 294-294

@vercel vercel bot temporarily deployed to Production – peanut-wallet October 20, 2025 14:58 Inactive
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/app/(mobile-ui)/withdraw/[country]/bank/page.tsx (2)

46-52: Consider extracting the supported currencies to a constant.

The hardcoded currency exclusions (EUR, USD, MXN) make it unclear why these specific currencies are allowed while others are temporarily unavailable. Consider extracting these to a named constant with documentation explaining the business logic.

+// Currencies currently supported for bank withdrawals
+const SUPPORTED_WITHDRAWAL_CURRENCIES = ['EUR', 'USD', 'MXN'] as const
+
 // non-eur sepa countries that are currently experiencing issues
-const isNonEuroSepaCountry = !!(
-    nonEuroCurrency &&
-    nonEuroCurrency !== 'EUR' &&
-    nonEuroCurrency !== 'USD' &&
-    nonEuroCurrency !== 'MXN'
-)
+const isNonEuroSepaCountry = !!(
+    nonEuroCurrency &&
+    !SUPPORTED_WITHDRAWAL_CURRENCIES.includes(nonEuroCurrency)
+)

271-286: Clear and user-friendly warning UI.

The warning message effectively communicates the temporary unavailability. The styling and structure are appropriate for this use case.

Consider enhancing the message with actionable guidance:

 <p className="mt-1 text-xs text-yellow-700">
-    Withdrawals to {nonEuroCurrency} bank accounts are temporarily unavailable.
-    Please try again later.
+    Withdrawals to {nonEuroCurrency} bank accounts are temporarily unavailable. 
+    You can withdraw to EUR, USD, or MXN accounts in the meantime.
 </p>
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between df9d3aa and f90f742.

📒 Files selected for processing (3)
  • src/app/(mobile-ui)/points/page.tsx (2 hunks)
  • src/app/(mobile-ui)/withdraw/[country]/bank/page.tsx (3 hunks)
  • src/app/[...recipient]/client.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/app/(mobile-ui)/points/page.tsx
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-05-22T15:38:48.586Z
Learnt from: kushagrasarathe
PR: peanutprotocol/peanut-ui#869
File: src/app/(mobile-ui)/withdraw/page.tsx:82-88
Timestamp: 2025-05-22T15:38:48.586Z
Learning: The country-specific withdrawal route exists at src/app/(mobile-ui)/withdraw/[...country]/page.tsx and renders the AddWithdrawCountriesList component with flow="withdraw".

Applied to files:

  • src/app/(mobile-ui)/withdraw/[country]/bank/page.tsx
🧬 Code graph analysis (1)
src/app/(mobile-ui)/withdraw/[country]/bank/page.tsx (1)
src/components/0_Bruddle/Button.tsx (1)
  • Button (76-267)
🪛 GitHub Actions: Tests
src/app/(mobile-ui)/withdraw/[country]/bank/page.tsx

[warning] 1-1: Code style issues found by Prettier. Run 'pnpm prettier --write' to fix.

⏰ 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: Deploy-Preview
🔇 Additional comments (2)
src/app/(mobile-ui)/withdraw/[country]/bank/page.tsx (1)

290-290: Disabled button states correctly implemented.

The logic properly prevents withdrawals for non-Euro SEPA countries in both the Retry and Withdraw button paths. The label change to "Temporarily Unavailable" provides clear user feedback.

Also applies to: 307-310

src/app/[...recipient]/client.tsx (1)

497-497: Verify z-index handling for mobile stacking context.

The z-50 on mobile creates potential stacking conflicts with other components using the same z-index value: tooltips, drawers, modals, loading overlays, and the QR scanner (all z-50). Stacking order will depend on DOM ordering when z-index values are equal. The QR scanner, in particular, is a full-screen overlay that could appear behind this banner unintentionally.

Consider using a lower z-index on mobile (e.g., z-20 or z-30) unless this banner must consistently overlay interactive elements, or verify that this component and conflicting overlays are never rendered simultaneously.

@Hugo0 Hugo0 merged commit e007d02 into peanut-wallet-dev Oct 20, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants