Skip to content

fix(web): trim whitespace on pasted recipient address input - #596

Open
CHKM001 wants to merge 1 commit into
Fundable-Protocol:mainfrom
CHKM001:fix/439-trim-whitespace-recipient-address
Open

fix(web): trim whitespace on pasted recipient address input#596
CHKM001 wants to merge 1 commit into
Fundable-Protocol:mainfrom
CHKM001:fix/439-trim-whitespace-recipient-address

Conversation

@CHKM001

@CHKM001 CHKM001 commented Jul 30, 2026

Copy link
Copy Markdown

PR #439

Description

Pasting a Stellar address with trailing whitespace (e.g., GB... or \nGB...) into the recipient address input causes validation to fail because validateStellarAddress receives the un-trimmed string.

This fix trims whitespace from the address value at the input handler level in RecipientRow, so the pasted/typed value is sanitized before validation and state storage.

Changes

  • apps/web/src/components/molecules/RecipientRow.tsxhandleAddressChange now calls .trim() on the input value before passing it to onChange.

Testing

  • All existing tests in use-distribution-state.test.ts, stellar-validation.test.ts, and amount-validation.test.ts pass.
  • Manual verification: pasting GABC... \n no longer triggers a validation error; the whitespace is stripped.

Closes #439

Summary by CodeRabbit

  • Bug Fixes
    • Recipient addresses are now automatically trimmed of leading and trailing spaces.
    • Address validation now accurately reflects the cleaned input.

Pasting an address with trailing whitespace caused validation failure.
Now automatically trims the input before validation and storage.

Closes Fundable-Protocol#439
@drips-wave

drips-wave Bot commented Jul 30, 2026

Copy link
Copy Markdown

@CHKM001 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 539ba392-a852-47eb-849b-00a9a8a481d4

📥 Commits

Reviewing files that changed from the base of the PR and between 375c936 and 8f97e27.

📒 Files selected for processing (1)
  • apps/web/src/components/molecules/RecipientRow.tsx

📝 Walkthrough

Walkthrough

RecipientRow now trims whitespace from entered addresses before updating parent state, storing the row value, and calculating validation status or errors.

Changes

Recipient address normalization

Layer / File(s) Summary
Trim address before validation
apps/web/src/components/molecules/RecipientRow.tsx
The address change flow trims input before calling onChange, and validation uses the trimmed value.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: trimming whitespace from recipient address input.
Linked Issues check ✅ Passed The change trims recipient address input before validation and onChange, matching the linked issue's sanitization goal.
Out of Scope Changes check ✅ Passed The patch is narrowly scoped to whitespace trimming and validation handling for recipient input.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

web(DistributionForm): trim whitespace on pasted recipient address input

1 participant