Skip to content

Conversation

kushagrasarathe
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Sep 10, 2025

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

Project Deployment Preview Comments Updated (UTC)
peanut-wallet Ready Ready Preview Comment Sep 10, 2025 10:01am

Copy link
Contributor

coderabbitai bot commented Sep 10, 2025

Walkthrough

Updates include raising DaimoPayButton maxAmount to 30_000 in two places, adding /support as a public path and adjusting auth gating, adding Support navigation/links in error page, footer, and a landing section, and removing the “Bank accounts” item from the Profile menu.

Changes

Cohort / File(s) Summary
Payment cap increase
src/app/(mobile-ui)/add-money/crypto/direct/page.tsx, src/components/Common/ActionListDaimoPayButton.tsx
Increased DaimoPayButton maxAmount from 4000 to 30_000; no logic changes.
Public path auth gating
src/app/(mobile-ui)/layout.tsx
Added /support to publicPathRegex and used isPublicPath to allow public rendering without auth.
Support entry points
src/app/[...recipient]/error.tsx, src/components/LandingPage/Footer.tsx, src/components/LandingPage/securityBuiltIn.tsx
Error page adds “Contact Support” button to /support; Footer adds internal /support link and removes external Privacy link; securityBuiltIn adds “Talk to Support” CTA linking to /support.
Profile menu update
src/components/Profile/index.tsx
Removed “Bank accounts” ProfileMenuItem (commented placeholder remains).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • Zishan-7
  • Hugo0

Pre-merge checks (1 warning, 2 inconclusive)

❌ 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 current title “chore: sync hot-fixes from prod to staging” is a generic chore prefix and does not clearly convey the substantive content of the changeset, making it hard to quickly understand the main fixes or features introduced. Please update the title to a concise, descriptive phrase that highlights the most significant change (for example, “Increase crypto deposit cap and add support navigation links”), so that the intent of the pull request is immediately clear.
Description Check ❓ Inconclusive No pull request description was provided, so it is not possible to verify whether the description aligns with the changeset. Please add a clear description summarizing the intent and scope of the changes to demonstrate how the updates relate to the goals of this pull request.

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/sync-hotfixes

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.

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 (2)
src/components/Common/ActionListDaimoPayButton.tsx (2)

125-126: Avoid stale closure: add peanutWalletAddress to dependencies.

peanutWalletAddress is used inside the callback but not listed in the deps array, risking stale values if the wallet changes.

Apply:

-        [chargeDetails, completeDaimoPayment, dispatch]
+        [chargeDetails, completeDaimoPayment, dispatch, peanutWalletAddress]

114-119: Tighten log copy to reflect DB sync, not initiation.

The error happens during completion/sync, not initiation. Clarifying logs helps triage and aligns with prior guidance to avoid confusing users.

-                        console.error('Payment initiation failed:', result.error)
+                        console.error('Payment completion sync failed:', result.error)
...
-                    console.error('Error completing daimo payment:', e)
+                    console.error('Error syncing completion after Daimo payment:', e)
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 012a6a8 and ac05315.

📒 Files selected for processing (7)
  • src/app/(mobile-ui)/add-money/crypto/direct/page.tsx (1 hunks)
  • src/app/(mobile-ui)/layout.tsx (2 hunks)
  • src/app/[...recipient]/error.tsx (2 hunks)
  • src/components/Common/ActionListDaimoPayButton.tsx (1 hunks)
  • src/components/LandingPage/Footer.tsx (1 hunks)
  • src/components/LandingPage/securityBuiltIn.tsx (2 hunks)
  • src/components/Profile/index.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: Zishan-7
PR: peanutprotocol/peanut-ui#1094
File: src/components/AddWithdraw/DynamicBankAccountForm.tsx:279-279
Timestamp: 2025-08-14T08:02:26.705Z
Learning: For hotfixes in the peanut-ui codebase, prefer generic error messages over specific validation error details until the copy can be reviewed with the team, even when the validation functions return detailed error messages.
📚 Learning: 2024-10-29T12:19:41.968Z
Learnt from: jjramirezn
PR: peanutprotocol/peanut-ui#495
File: src/components/Global/TokenAmountInput/index.tsx:23-30
Timestamp: 2024-10-29T12:19:41.968Z
Learning: In the `TokenAmountInput` component (`src/components/Global/TokenAmountInput/index.tsx`), when the 'Max' button is clicked, we intentionally set the input denomination to 'TOKEN' because we are setting the value as token.

Applied to files:

  • src/app/(mobile-ui)/add-money/crypto/direct/page.tsx
  • src/components/Common/ActionListDaimoPayButton.tsx
📚 Learning: 2024-10-08T20:13:42.967Z
Learnt from: Hugo0
PR: peanutprotocol/peanut-ui#420
File: src/components/Offramp/Offramp.consts.ts:27-28
Timestamp: 2024-10-08T20:13:42.967Z
Learning: In `src/components/Offramp/Offramp.consts.ts`, the `MIN_CASHOUT_LIMIT` is set to $10 because smaller amounts are impractical due to approximately $1 fee per cashout.

Applied to files:

  • src/app/(mobile-ui)/add-money/crypto/direct/page.tsx
📚 Learning: 2024-10-29T12:20:47.207Z
Learnt from: jjramirezn
PR: peanutprotocol/peanut-ui#495
File: src/components/Create/Link/Input.view.tsx:244-248
Timestamp: 2024-10-29T12:20:47.207Z
Learning: In the `TokenAmountInput` component within `src/components/Global/TokenAmountInput/index.tsx`, when `balance` is undefined, the `maxValue` prop should be set to an empty string `''`.

Applied to files:

  • src/app/(mobile-ui)/add-money/crypto/direct/page.tsx
📚 Learning: 2025-08-22T07:25:59.304Z
Learnt from: Zishan-7
PR: peanutprotocol/peanut-ui#1104
File: src/components/Payment/PaymentForm/index.tsx:596-600
Timestamp: 2025-08-22T07:25:59.304Z
Learning: The `TokenAmountInput` component in `src/components/Global/TokenAmountInput/` always returns decimal strings (e.g., "1,234.56"), not base units. When passing these values to external APIs like Daimo's `toUnits` prop, simply stripping commas with `.replace(/,/g, '')` is sufficient.

Applied to files:

  • src/app/(mobile-ui)/add-money/crypto/direct/page.tsx
📚 Learning: 2025-08-26T15:25:53.328Z
Learnt from: Zishan-7
PR: peanutprotocol/peanut-ui#1132
File: src/app/[...recipient]/client.tsx:394-397
Timestamp: 2025-08-26T15:25:53.328Z
Learning: In `src/components/Common/ActionListDaimoPayButton.tsx`, the `handleCompleteDaimoPayment` function should not display error messages to users when DB update fails because the Daimo payment itself has succeeded - showing errors would be confusing since the payment was successful.

Applied to files:

  • src/components/Common/ActionListDaimoPayButton.tsx
📚 Learning: 2025-08-22T07:28:32.281Z
Learnt from: Zishan-7
PR: peanutprotocol/peanut-ui#1104
File: src/components/Payment/PaymentForm/index.tsx:522-545
Timestamp: 2025-08-22T07:28:32.281Z
Learning: In `src/components/Payment/PaymentForm/index.tsx`, the `handleCompleteDaimoPayment` function is only for updating payment status in the backend after a successful Daimo payment. Payment success/failure is handled by Daimo itself, so try/catch error handling and error display are not needed for backend sync failures - users shouldn't see errors if payment succeeded but database update failed.

Applied to files:

  • src/components/Common/ActionListDaimoPayButton.tsx
  • src/app/[...recipient]/error.tsx
🧬 Code graph analysis (2)
src/components/LandingPage/securityBuiltIn.tsx (1)
src/components/0_Bruddle/Button.tsx (1)
  • Button (76-267)
src/app/[...recipient]/error.tsx (1)
src/components/0_Bruddle/Button.tsx (1)
  • Button (76-267)
⏰ 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 (10)
src/app/(mobile-ui)/add-money/crypto/direct/page.tsx (1)

95-95: LGTM - Consistent maxAmount increase.

The maxAmount increase from 4,000 to 30,000 matches the corresponding change in ActionListDaimoPayButton.tsx, ensuring consistency across DaimoPayButton implementations.

src/components/Profile/index.tsx (1)

72-79: Clean temporary removal with clear restoration path.

The Bank accounts menu item has been properly commented out with a clear note for future re-enabling. The placeholder maintains the code structure for easy restoration when the Account Management project is ready.

src/components/LandingPage/securityBuiltIn.tsx (2)

2-2: LGTM - Button import added.

Import statement correctly adds the Button component from the Bruddle design system.


85-96: LGTM - Support CTA implementation.

The conditional "Talk to Support" button is properly implemented:

  • Correctly targets feature ID 3 (24/7 HELP)
  • Uses proper Button styling with shadowSize="4"
  • Links to the /support path consistently with other changes in this PR
  • Maintains clean separation with appropriate spacing
src/app/[...recipient]/error.tsx (2)

5-8: LGTM - Client-side routing added.

The useRouter import and instantiation properly enable navigation functionality for the error page.


22-28: LGTM - Support contact option added.

The changes improve error handling UX by:

  • Adding vertical flex layout (flex flex-col gap-3) for better button arrangement
  • Providing a "Contact Support" option that navigates to /support
  • Using appropriate transparent variant styling for the secondary action
src/components/LandingPage/Footer.tsx (1)

60-62: LGTM - Support link added to footer.

The internal link to /support is properly positioned and styled consistently with other footer links.

src/app/(mobile-ui)/layout.tsx (2)

24-25: LGTM - Public path regex updated.

The regex correctly extends public path handling to include /support, maintaining the existing pattern structure.


84-87: LGTM - Authentication gating updated.

The changes properly implement public path support by:

  • Line 85: Defining isPublicPath based on the updated regex
  • Line 87: Updating the loading condition to allow public paths to render without authentication

This enables /support to be accessible without requiring user authentication, which is appropriate for a support page.

src/components/Common/ActionListDaimoPayButton.tsx (1)

138-138: Extract MAX_DAIMO_USD and confirm limit

  • Replace both hard-coded maxAmount={30_000} in
    src/components/Common/ActionListDaimoPayButton.tsx:138
    src/app/(mobile-ui)/add-money/crypto/direct/page.tsx:95
    with maxAmount={MAX_DAIMO_USD} imported from a shared constants file.
  • Create (or update) src/constants/daimo.const.ts with:
    export const MAX_DAIMO_USD = 30000
  • Verify that 30000 aligns with the Daimo/provider and backend cap to avoid any validation mismatch.

@Hugo0 Hugo0 merged commit b959b01 into peanut-wallet-dev Sep 10, 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