Skip to content

feat: add clipboard paste button to destination address inputs - #40

Open
MJ-RWA wants to merge 1 commit into
mainfrom
feat/clipboard-paste
Open

feat: add clipboard paste button to destination address inputs#40
MJ-RWA wants to merge 1 commit into
mainfrom
feat/clipboard-paste

Conversation

@MJ-RWA

@MJ-RWA MJ-RWA commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features
    • Added a reusable destination address field with clipboard paste support.
    • Valid addresses are accepted automatically with success feedback; invalid entries show clear error notifications.
    • Added the enhanced address field to scheduled payments and send workflows.
  • Bug Fixes
    • Improved destination address validation messaging.
    • Send actions remain unavailable until a valid address is entered.

@vercel

vercel Bot commented Aug 5, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
stellarflow Ready Ready Preview Aug 5, 2026 7:25am

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key: "path_instructions"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

The PR adds a controlled AddressInput with clipboard paste validation, notifications, and error display. SchedulePage and SendPage use it for destination address entry.

Changes

Address input integration

Layer / File(s) Summary
Address input behavior
apps/src/components/AddressInput.tsx
Adds controlled input updates, clipboard reading, Stellar address validation, paste-button UI, success and error toasts, and optional error rendering.
Destination form integration
apps/src/pages/SchedulePage.tsx, apps/src/pages/SendPage.tsx
Replaces destination text inputs with AddressInput. SendPage preserves validation and uses the shorter Invalid Stellar address message.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant AddressInput
  participant ClipboardAPI
  participant Toast
  User->>AddressInput: Click paste button
  AddressInput->>ClipboardAPI: Read clipboard text
  ClipboardAPI-->>AddressInput: Return clipboard text
  AddressInput->>AddressInput: Trim and validate address
  AddressInput->>Toast: Show success or error notification
Loading

Possibly related issues

Possibly related PRs

  • MJ-RWA/Stellarflow#39 — Both PRs update SendPage destination address validation and send-button behavior.
🚥 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 summarizes the addition of a clipboard paste button to destination address inputs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/clipboard-paste

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/src/components/AddressInput.tsx`:
- Around line 16-20: Replace the structural G-prefix and length checks with one
shared Stellar SDK address validator across AddressInput.tsx:16-20,
SchedulePage.tsx:108, and SendPage.tsx:121-123. Apply it to clipboard input,
manual input, scheduled destination saves, and pre-send validation so malformed
addresses are rejected before onChange, storage, or buildSendTx; preserve the
existing success and error behaviors.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a71030bf-1efe-4268-a15b-c188db335410

📥 Commits

Reviewing files that changed from the base of the PR and between aa256dd and 33c3397.

📒 Files selected for processing (3)
  • apps/src/components/AddressInput.tsx
  • apps/src/pages/SchedulePage.tsx
  • apps/src/pages/SendPage.tsx

Comment on lines +16 to +20
if (trimmed.startsWith('G') && trimmed.length === 56) {
onChange(trimmed);
toast.success('Address pasted');
} else {
toast.error('Clipboard does not contain a valid Stellar address');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the declared Stellar SDK and existing validation helpers.
fd -H -t f '^package\.json$' . -x sh -c 'echo "--- $1"; jq -r ".dependencies, .devDependencies" "$1" | grep -i stellar || true' _ {}

fd -t f '^stellar\.(ts|tsx)$' apps/src/lib \
  -x ast-grep outline {} --items all

rg -n -C3 'StrKey|isValidEd25519PublicKey|decodeAddress|buildSendTx|startsWith\(.G.\)|length !== 56' apps/src

Repository: MJ-RWA/Stellarflow

Length of output: 5570


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "--- AddressInput.tsx"
cat -n apps/src/components/AddressInput.tsx

echo "--- SendPage.tsx relevant section"
sed -n '1,150p' apps/src/pages/SendPage.tsx | cat -n

echo "--- SchedulePage.tsx relevant section"
sed -n '1,150p' apps/src/pages/SchedulePage.tsx | cat -n

echo "--- scheduler/stellar relevant sections"
sed -n '1,80p' apps/src/hooks/useScheduler.ts | cat -n
sed -n '1,90p' apps/src/lib/stellar.ts | cat -n

echo "--- read-only behavioral probe: clipboard structural validator accepts invalid base32 StrKeys"
python3 - <<'PY'
import string
prefix = "G"
choices = [c.upper() for c in string.ascii_uppercase[:4]] + list(string.digits)
bad_prefix = "A" + "".join(choices[:40]) + ("G" * (55 - len(choices[:40])))
bad_len = prefix + "".join(choices[:30]) * 2
print("prefix+length-only matches 'G'+ 55 base32 chars:", prefix + "".join(choices[:40]) + ("G" * (55 - len(choices[:40]))) in [prefix + c for c in choices] * 55)
print("any G-prefix 56-character string made only of base32 chars is accepted:", True)
print("bad_prefix", bad_prefix, "starts G, len", len(bad_prefix), "matches false positives")
print("bad_len", bad_len, "len", len(bad_len), "matches false positives")
PY

Repository: MJ-RWA/Stellarflow

Length of output: 22419


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "--- AddressInput.tsx"
cat -n apps/src/components/AddressInput.tsx

echo "--- SendPage.tsx relevant section"
sed -n '1,150p' apps/src/pages/SendPage.tsx | cat -n

echo "--- SchedulePage.tsx relevant section"
sed -n '1,150p' apps/src/pages/SchedulePage.tsx | cat -n

echo "--- scheduler/stellar relevant sections"
sed -n '1,80p' apps/src/hooks/useScheduler.ts | cat -n
sed -n '1,90p' apps/src/lib/stellar.ts | cat -n

echo "--- read-only behavioral probe: clipboard structural validator accepts invalid base32 StrKeys"
python3 - <<'PY'
import string
prefix = "G"
choices = [c.upper() for c in string.ascii_uppercase[:4]] + list(string.digits)
bad_prefix = "A" + "".join(choice for choice in choices[:40]) + ("G" * (55 - len(choices[:40])))
bad_len = prefix + "".join(choice for choice in choices[:30]) * 2
print("prefix+length-only matches 'G'+ 55 base32 chars:", prefix + "".join(choice for choice in choices[:40]) + ("G" * (55 - len(choices[:40]))) in [prefix + c for c in choices] * 55)
print("any G-prefix 56-character string made only of base32 chars is accepted:", True)
print("bad_prefix", bad_prefix, "len", len(bad_prefix), "starts G false positive")
print("bad_len", bad_len, "len", len(bad_len), "false positive")
PY

Repository: MJ-RWA/Stellarflow

Length of output: 22400


Use one protocol-level Stellar address validator.

AddressInput only checks G... and length before calling onChange, so malformed base32 StrKeys can be accepted. SendPage uses the same structural check and can reach buildSendTx with an invalid destination. SchedulePage stores any nonempty destination before execution. Use a shared Stellar SDK validator for clipboard input, manual input, scheduled saves, and pre-send validation.

📍 Affects 3 files
  • apps/src/components/AddressInput.tsx#L16-L20 (this comment)
  • apps/src/pages/SchedulePage.tsx#L108-L108
  • apps/src/pages/SendPage.tsx#L121-L123
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/src/components/AddressInput.tsx` around lines 16 - 20, Replace the
structural G-prefix and length checks with one shared Stellar SDK address
validator across AddressInput.tsx:16-20, SchedulePage.tsx:108, and
SendPage.tsx:121-123. Apply it to clipboard input, manual input, scheduled
destination saves, and pre-send validation so malformed addresses are rejected
before onChange, storage, or buildSendTx; preserve the existing success and
error behaviors.

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.

1 participant