Skip to content

frontend: allow entering fiat in lightning receive#4163

Open
bznein wants to merge 1 commit into
BitBoxSwiss:staging-sparkfrom
bznein:ln-recv-fiat
Open

frontend: allow entering fiat in lightning receive#4163
bznein wants to merge 1 commit into
BitBoxSwiss:staging-sparkfrom
bznein:ln-recv-fiat

Conversation

@bznein
Copy link
Copy Markdown
Collaborator

@bznein bznein commented May 25, 2026

Before asking for reviews, here is a check list of the most common things you might need to consider:

  • updating the Changelog
  • writing unit tests
  • checking if your changes affect other coins or tokens in unintended ways
  • testing on multiple environments (Qt, Android, ...)
  • having an AI review your changes

@bznein
Copy link
Copy Markdown
Collaborator Author

bznein commented May 25, 2026

@CodeRabbit review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

✅ Actions performed

Review triggered.

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
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

The Receive Lightning route component was refactored to improve amount validation and conversion. The component now uses an explicit parseSatsAmount helper and tracks SAT/fiat text as separate state properties instead of relying on effects. Async conversion callbacks replaced effect-based logic, using monotonically increasing request IDs to ignore stale in-flight responses. The form was updated to use NumberInput controls for both fields, with the confirm button's disabled state now derived from satsAmount === undefined. Submission validation uses the pre-computed satsAmount directly and shows translated errors when parsing fails.

✨ 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 and usage tips.

Copy link
Copy Markdown

@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: 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 `@frontends/web/src/routes/lightning/receive/receive.tsx`:
- Around line 236-244: The fiat input uses a SAT-specific translation key
causing incorrect placeholder text: update the NumberInput with id
"amountFiatInput" to use a dedicated fiat/generic key (e.g. replace
t('lightning.receive.amountSats.placeholder') with a new key like
'lightning.receive.amountFiat.placeholder' or
'lightning.receive.amount.placeholder') and add that new key and translations to
the locale files for all supported languages so the NumberInput (component:
NumberInput, prop: placeholder) shows the correct fiat/generic placeholder.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3e3d0ce1-a432-4ef2-979c-3560bce17ced

📥 Commits

Reviewing files that changed from the base of the PR and between 2536dc6 and 36c61b8.

📒 Files selected for processing (1)
  • frontends/web/src/routes/lightning/receive/receive.tsx

Comment thread frontends/web/src/routes/lightning/receive/receive.tsx
@bznein bznein marked this pull request as ready for review May 25, 2026 14:57
@bznein bznein requested a review from a team as a code owner May 25, 2026 14:57
@bznein bznein requested a review from Beerosagos May 25, 2026 14:57
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