-
Notifications
You must be signed in to change notification settings - Fork 13
[TASK-10210] feat: accept usernames in general input #873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TASK-10210] feat: accept usernames in general input #873
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Caution Review failedThe pull request is closed. """ WalkthroughThis change expands recipient input functionality by adding support for usernames alongside addresses, ENS, IBAN, and US identifiers. It updates type definitions, input validation logic, and placeholder texts to explicitly include usernames. The AddressInput component is removed, and recipient validation is consolidated in GeneralRecipientInput. Changes
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/components/Global/GeneralRecipientInput/index.tsx (1)
59-68
: Consider providing more specific error messages.The unified validation approach is clean, but the generic error message "Invalid address" on line 65 might be misleading when username validation fails. Consider using the error message from the caught exception or mapping error types to user-friendly messages.
- } catch (error) { - errorMessage.current = 'Invalid address' - console.error('Error while validating recipient input field:', error) - return false + } catch (error) { + if (error instanceof Error) { + errorMessage.current = error.message || 'Invalid recipient' + } else { + errorMessage.current = 'Invalid recipient' + } + console.error('Error while validating recipient input field:', error) + return false🧰 Tools
🪛 GitHub Actions: Tests
[error] 66-66: Error while validating recipient input field: RecipientValidationError: Invalid Peanut username
[error] 66-66: Error while validating recipient input field: RecipientValidationError: Invalid Ethereum address
[error] 66-66: Error while validating recipient input field: RecipientValidationError: Error resolving ENS name
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
src/components/Claim/Link/Initial.view.tsx
(1 hunks)src/components/Global/AddressInput/index.tsx
(0 hunks)src/components/Global/GeneralRecipientInput/index.tsx
(4 hunks)src/components/Request/direct-request/views/Initial.direct.request.view.tsx
(1 hunks)src/components/Withdraw/views/Initial.withdraw.view.tsx
(1 hunks)src/hooks/useRecentRecipients.ts
(1 hunks)src/interfaces/interfaces.ts
(1 hunks)
💤 Files with no reviewable changes (1)
- src/components/Global/AddressInput/index.tsx
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/components/Global/GeneralRecipientInput/index.tsx (2)
src/lib/validation/recipient.ts (1)
validateAndResolveRecipient
(12-56)src/interfaces/interfaces.ts (1)
RecipientType
(4-4)
🪛 GitHub Actions: Tests
src/components/Global/GeneralRecipientInput/index.tsx
[error] 66-66: Error while validating recipient input field: RecipientValidationError: Invalid Peanut username
[error] 66-66: Error while validating recipient input field: RecipientValidationError: Invalid Ethereum address
[error] 66-66: Error while validating recipient input field: RecipientValidationError: Error resolving ENS name
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Deploy-Preview
🔇 Additional comments (5)
src/components/Claim/Link/Initial.view.tsx (1)
556-556
: Consistent placeholder text update.The placeholder text update is consistent with other components and clearly indicates username support.
src/components/Request/direct-request/views/Initial.direct.request.view.tsx (1)
155-155
: Consistent placeholder text update with proper type integration.The placeholder text update is consistent with other components and the component properly imports the updated
RecipientType
interface.src/hooks/useRecentRecipients.ts (1)
8-8
: LGTM! Type extension is clean and consistent.The addition of
'username'
to theRecentRecipient
type union aligns with the PR objective and is consistent with theRecipientType
definition ininterfaces.ts
.src/components/Global/GeneralRecipientInput/index.tsx (2)
48-48
: Good UX improvement for handling pasted URLs.The addition of
.replace(\
${BASE_URL}/`, '')` handles cases where users paste full Peanut URLs instead of just the username/address, improving the user experience.
91-93
: Correctly extended to handle username type.The condition now properly includes both ENS and username types, ensuring that human-readable names are displayed while resolved addresses are used internally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LFGGG 🚀
@jjramirezn resolve conflict before merging 🫡 |
…ept-usernames-in-general-input
Also deleted AddressInput because it was not used anywhere
contributes to TASK-9432