Skip to content

feat: add paste option in dual currency input#439

Merged
im-adithya merged 2 commits into
masterfrom
feat/dualcurrencyinput-paste
Jun 18, 2026
Merged

feat: add paste option in dual currency input#439
im-adithya merged 2 commits into
masterfrom
feat/dualcurrencyinput-paste

Conversation

@im-adithya

@im-adithya im-adithya commented Jun 17, 2026

Copy link
Copy Markdown
Member

Adds paste tooltip in DualCurrencyInput component

Summary by CodeRabbit

  • New Features
    • Added clipboard paste support for currency amounts via long-press gesture.
    • Haptic feedback triggered when long-pressing the amount input.
    • Dismissible paste action overlay appears when clipboard data is available.
    • Input validation with error notifications for invalid amounts.

@im-adithya

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@im-adithya, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 54 minutes and 59 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 499a0c85-992f-49c3-a1f7-2090d17b5e66

📥 Commits

Reviewing files that changed from the base of the PR and between 6d55bda and d2bc84b.

📒 Files selected for processing (1)
  • components/DualCurrencyInput.tsx
📝 Walkthrough

Walkthrough

DualCurrencyInput gains clipboard paste support: a long-press on the amount display triggers haptics and shows a "Paste" popover. Pasted text is sanitized per input mode (sats vs fiat), validated against MAX_SATS_THRESHOLD, and applied via setAmount. Invalid clipboard content emits an error toast. expo-haptics is added as a new dependency.

Changes

Long-press Clipboard Paste in DualCurrencyInput

Layer / File(s) Summary
Paste state, parsing, and callbacks
package.json, components/DualCurrencyInput.tsx
Adds expo-haptics dependency, imports Clipboard and Haptics, introduces showPasteAction state, and implements applyPastedValue (sanitize, parse, threshold check, setAmount) and paste (async clipboard read, apply, hide UI) callbacks.
Long-press overlay and Paste popover render
components/DualCurrencyInput.tsx
Updates the amount display to render a dismissible absolute overlay and a "Paste" popover button on long-press when there is no current input and the field is not read-only; haptics fire on reveal.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Hop, hop — I long-pressed today,
Clipboard treasures on their way!
Sats or fiat, clean and bright,
Haptics buzz with pure delight.
Invalid paste? A toast will say.
✨ Paste away, dear friend, paste away!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main feature added: a paste option in the dual currency input component, which matches the changeset.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/dualcurrencyinput-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 and usage tips.

@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 `@components/DualCurrencyInput.tsx`:
- Around line 554-564: The Pressable component in the paste action menu has
conflicting background classes where bg-foreground and bg-card are both applied,
causing bg-card to override bg-foreground. This creates visual inconsistency
with the arrow being dark while the button is light, and results in poor text
contrast. Remove the bg-foreground class from the Pressable and keep only
bg-card, then verify the text-background color provides sufficient contrast
against the bg-card background, changing to text-foreground or another
appropriate color if the contrast is inadequate.
🪄 Autofix (Beta)

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: defaults

Review profile: CHILL

Plan: Pro

Run ID: f9774b4f-4ee9-4634-acf7-b6c6896f1841

📥 Commits

Reviewing files that changed from the base of the PR and between 1ce5cd6 and 6d55bda.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (2)
  • components/DualCurrencyInput.tsx
  • package.json

Comment thread components/DualCurrencyInput.tsx
@im-adithya im-adithya merged commit 1c20d55 into master Jun 18, 2026
3 checks passed
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