Skip to content

Conversation

Hugo0
Copy link
Contributor

@Hugo0 Hugo0 commented Sep 15, 2025

This UI is wrong. It should be the USERS address, not bank address. See this task for more:
https://www.notion.so/peanutprotocol/Bug-Can-t-withdraw-to-US-26b838117579804e856fec94f7a3b9aa?pvs=25

image

tackles TASK-14753

Copy link

vercel bot commented Sep 15, 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 15, 2025 11:55am

Copy link
Contributor

coderabbitai bot commented Sep 15, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Updated non-IBAN address field placeholders and revised the street field’s required validation message in DynamicBankAccountForm.tsx. Additionally, a minor formatting change was made in external-accounts action. No logic, control flow, or data submission changes.

Changes

Cohort / File(s) Summary of Changes
UI copy updates (non-IBAN address fields)
src/components/AddWithdraw/DynamicBankAccountForm.tsx
Updated placeholders: street → "Your Street Address", city → "Your City", state → "Your State", postalCode → "Your Postal Code". Changed validation text: "Bank address is required" → "Street address is required". No logic changes.
Minor formatting in action
src/app/actions/external-accounts.ts
Cosmetic reformatting: single-line declaration of source inside invalid_parameters error construction. No behavioral changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested reviewers

  • kushagrasarathe
  • jjramirezn

Suggested labels

enhancement

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Fix/copy hotfix" is related to the changes because this PR updates user-facing copy in the withdraw form (address placeholders and a validation message) and signals an urgent fix, but the wording is vague and does not specify which copy or form was changed.
Description Check ✅ Passed The description clearly states the problem (the UI shows the bank address instead of the user's address), links to the Notion task, includes a screenshot, and references TASK-14753, so it is directly related to the changes in this PR.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a2227a7 and ff8d0d3.

📒 Files selected for processing (1)
  • src/app/actions/external-accounts.ts (1 hunks)

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.

@Hugo0 Hugo0 changed the base branch from main to peanut-wallet September 15, 2025 11:38
Copy link

@coderabbitai coderabbitai bot added the enhancement New feature or request label Sep 15, 2025
@Hugo0 Hugo0 merged commit 94e344d into peanut-wallet Sep 15, 2025
5 of 6 checks passed
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/components/AddWithdraw/DynamicBankAccountForm.tsx (1)

376-391: Optional UX: add browser autocomplete tokens and use “ZIP Code” placeholder for US.

Small polish to improve autofill and locale fit.

Apply:

@@
-                                {renderInput('street', 'Your Street Address', {
+                                {renderInput('street', 'Your Street Address', {
                                     required: 'Street address is required',
                                 })}
@@
-                                {renderInput('city', 'Your City', { required: 'City is required' })}
+                                {renderInput('city', 'Your City', { required: 'City is required' })}
@@
-                                {renderInput('state', 'Your State', {
+                                {renderInput('state', 'Your State', {
                                     required: 'State is required',
                                 })}
@@
-                                {renderInput('postalCode', 'Your Postal Code', {
+                                {renderInput('postalCode', isUs ? 'Your ZIP Code' : 'Your Postal Code', {
                                     required: 'Postal code is required',
                                 })}

Supporting change to enable autofill without touching every call site:

@@
-        const renderInput = (
+        const renderInput = (
             name: keyof IBankAccountDetails,
             placeholder: string,
             rules: any,
             type: string = 'text',
             rightAdornment?: React.ReactNode,
             onBlur?: (field: any) => Promise<void> | void
-        ) => (
+        ) => (
             <div className="w-full">
                 <div className="relative">
                     <Controller
                         name={name}
                         control={control}
                         rules={rules}
                         render={({ field }) => (
                             <BaseInput
                                 {...field}
                                 type={type}
                                 placeholder={placeholder}
                                 className="h-12 w-full rounded-sm border border-n-1 bg-white px-4 text-sm"
+                                autoComplete={
+                                    name === 'street'
+                                        ? 'address-line1'
+                                        : name === 'city'
+                                            ? 'address-level2'
+                                            : name === 'state'
+                                                ? 'address-level1'
+                                                : name === 'postalCode'
+                                                    ? 'postal-code'
+                                                    : undefined
+                                }
                                 onBlur={async (e) => {
                                     // remove any whitespace from the input field
                                     // note: @dev not a great fix, this should also be fixed in the backend
                                     if (typeof field.value === 'string') {
                                         field.onChange(field.value.trim())
                                     }
                                     field.onBlur()
                                     if (onBlur) {
                                         await onBlur(field)
                                     }
                                 }}
                             />
                         )}
                     />
                 </div>
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d7d34ab and a2227a7.

📒 Files selected for processing (1)
  • src/components/AddWithdraw/DynamicBankAccountForm.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 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.
Learnt from: Zishan-7
PR: peanutprotocol/peanut-ui#1094
File: src/utils/withdraw.utils.ts:181-191
Timestamp: 2025-08-14T14:42:54.411Z
Learning: The countryCodeMap in src/components/AddMoney/consts/index.ts uses uppercase 3-letter country codes as keys (like 'AUT', 'BEL', 'CZE') that map to 2-letter country codes, requiring input normalization to uppercase for proper lookups.
Learnt from: Hugo0
PR: peanutprotocol/peanut-ui#545
File: src/components/Global/GeneralRecipientInput/index.tsx:118-126
Timestamp: 2024-11-26T12:06:11.603Z
Learning: For bank account input fields, use `autocomplete="bank-account-number"` when the recipient type is `'us'` or `'iban'`.
Learnt from: jjramirezn
PR: peanutprotocol/peanut-ui#484
File: src/components/Cashout/Components/Initial.view.tsx:273-274
Timestamp: 2024-10-25T11:33:46.776Z
Learning: In the `InitialCashoutView` component (`src/components/Cashout/Components/Initial.view.tsx`), linked bank accounts should not generate error states, and the `ValidatedInput` component will clear any error messages if needed. Therefore, it's unnecessary to manually clear the error state when selecting or clearing linked bank accounts.
Learnt from: Zishan-7
PR: peanutprotocol/peanut-ui#1094
File: src/components/AddWithdraw/DynamicBankAccountForm.tsx:0-0
Timestamp: 2025-08-13T18:22:01.941Z
Learning: In the DynamicBankAccountForm component, the countryName parameter from useParams will always resemble a country title, not a URL slug.
📚 Learning: 2025-08-14T14:42:54.411Z
Learnt from: Zishan-7
PR: peanutprotocol/peanut-ui#1094
File: src/utils/withdraw.utils.ts:181-191
Timestamp: 2025-08-14T14:42:54.411Z
Learning: The countryCodeMap in src/components/AddMoney/consts/index.ts uses uppercase 3-letter country codes as keys (like 'AUT', 'BEL', 'CZE') that map to 2-letter country codes, requiring input normalization to uppercase for proper lookups.

Applied to files:

  • src/components/AddWithdraw/DynamicBankAccountForm.tsx
📚 Learning: 2025-08-13T18:22:01.941Z
Learnt from: Zishan-7
PR: peanutprotocol/peanut-ui#1094
File: src/components/AddWithdraw/DynamicBankAccountForm.tsx:0-0
Timestamp: 2025-08-13T18:22:01.941Z
Learning: In the DynamicBankAccountForm component, the countryName parameter from useParams will always resemble a country title, not a URL slug.

Applied to files:

  • src/components/AddWithdraw/DynamicBankAccountForm.tsx
📚 Learning: 2024-10-25T11:33:46.776Z
Learnt from: jjramirezn
PR: peanutprotocol/peanut-ui#484
File: src/components/Cashout/Components/Initial.view.tsx:273-274
Timestamp: 2024-10-25T11:33:46.776Z
Learning: In the `InitialCashoutView` component (`src/components/Cashout/Components/Initial.view.tsx`), linked bank accounts should not generate error states, and the `ValidatedInput` component will clear any error messages if needed. Therefore, it's unnecessary to manually clear the error state when selecting or clearing linked bank accounts.

Applied to files:

  • src/components/AddWithdraw/DynamicBankAccountForm.tsx
📚 Learning: 2024-11-26T12:06:11.603Z
Learnt from: Hugo0
PR: peanutprotocol/peanut-ui#545
File: src/components/Global/GeneralRecipientInput/index.tsx:118-126
Timestamp: 2024-11-26T12:06:11.603Z
Learning: For bank account input fields, use `autocomplete="bank-account-number"` when the recipient type is `'us'` or `'iban'`.

Applied to files:

  • src/components/AddWithdraw/DynamicBankAccountForm.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: Deploy-Preview
🔇 Additional comments (1)
src/components/AddWithdraw/DynamicBankAccountForm.tsx (1)

376-391: Approve — address placeholders updated; no action required
Search found "Bank Address" only in src/components/TransactionDetails/TransactionDetailsReceipt.tsx and src/components/AddMoney/components/AddMoneyBankDetails.tsx; those are intentional bank-deposit labels, not user-address copy.

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.

2 participants