Skip to content

iOS: Center the Receive amount and show the Bitcoin address - #85

Merged
bhandras merged 1 commit into
mainfrom
ios/receive-amount-layout
Nov 27, 2026
Merged

bhandras merged 1 commit into
mainfrom
ios/receive-amount-layout

Conversation

@bhandras

@bhandras bhandras commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

A new Lightning request opens with the amount focused and the number pad visible. The digits and sats unit sit together in the center. Create request stays above the keyboard while the amount or optional note is being edited.

Both receive methods put Copy and Share below the QR code. On-chain shows the full, selectable Bitcoin address there so the recipient can check it at a glance. Lightning keeps the encoded invoice inside Details.

The signet and regtest UI tests now type into the initially focused amount and read the on-chain address with a single tap on Create address.

Verified the signet flow on iOS 18.6 and 26.5 using disposable wallets. Both runs created an on-chain address and a Lightning invoice, pasted the copied invoice into Send, and recovered the same invoice from Activity after relaunch. On iOS 26.5, the full 62-character address wrapped across two lines without inserted hyphens.

Focus the Lightning amount when Receive opens. Keep the create action
above the keyboard and put Copy and Share beside the QR workflow.
Show the full Bitcoin address below its QR and keep longer invoices
under Details.
@bhandras
bhandras force-pushed the ios/receive-amount-layout branch from 35b5d4b to b99171a Compare November 27, 2026 15:07
@bhandras

Copy link
Copy Markdown
Member Author

/gateway review

Please review lightninglabs/wavelength-mobile #85 at b99171a, based on main at 6181701. Check the Lightning and on-chain Receive flows from opening the sheet through request creation, copying or sharing, and status changes. Trace initial focus, amount editing and rail changes, keyboard access to Create, the full selectable address with character wrapping, and whether the visible address, QR, Copy and Share use the same payload. Check that invoice text stays under Details, including how the updated UI tests observe it.

Both live signet flows passed on iOS 18.6 and 26.5. CI is green. For each finding, give the trigger, execution path, user impact, existing guards, likelihood, whether this change introduces it, and the smallest fix and regression risk. Classify it as a blocker, follow-up or not worth changing. End with READY, READY WITH FOLLOW-UPS or BLOCKED. A concrete material issue should block. Keep unrelated wallet changes and speculative redesigns out of scope.

@lightninglabs-gateway lightninglabs-gateway 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.

Gateway review — 1 finding

🔴 0 Blocker · 🟠 0 Major · 🟡 1 Minor · 🔵 0 Nit

Summary

The PR centers the Lightning amount entry, keeps Create above the keyboard with safeAreaInset, moves Copy and Share below the QR code, and shows the on-chain address in full in a selectable UITextView that wraps between characters. I found nothing that should block it. In both flows, the visible address, the QR code, Copy (UIPasteboard.general.string = request) and Share (ShareSheet(items: [request])) all use the same request value. requestForm.disabled(isLoading) and amountFocused = false in createRequest() stop the user from changing the rail or editing during the request call. A paid on-chain request still shows Copy, Share and the address under Details, because the rail == .lightning || !showsRequest check keeps that section.

The sizing trick for the address view is sound. The hidden SwiftUI Text and the UITextView use the same monospaced font with the same Dynamic Type scaling. If SwiftUI inserts a hyphen, that line holds fewer address characters, so the hidden text is never shorter than the UITextView and the address is never cut off. The updated UI tests check the new layout properly. The collapsed-Details state is asserted with XCTAssertFalse(request.exists), and the paste check now relies on a memo that includes a UUID, which is a reasonable stand-in for comparing the full invoice.

One unverified risk: the PR was only run on iOS 18.6 and 26.5. On iOS 15–16, setting @FocusState inside .onAppear in a sheet is often ignored, and the code comment at line 163 says iOS 15 is still supported. If that happens, the user taps the amount to focus it (the onTapGesture at line 124 handles this), so nothing breaks. The keypad just won't open automatically on those versions. Overall: READY WITH FOLLOW-UPS.

Lower-severity findings (1)

🟡 F1 (Minor) — Text under Details can still show hyphens that aren't in the payload · ios/Sample/Sources/ReceiveView.swift:211

Follow-up, not a blocker. The PR adds BitcoinAddressText because ordinary SwiftUI text wrapping can insert hyphens (lines 237–238). requestValue is still a SwiftUI Text(request), and it is what shows the Lightning invoice under Details. It also shows the on-chain address after payment, when showsRequest turns false and the BitcoinAddressText view is gone. In both cases a user reading the text can see a dash that isn't in the copied, shared or QR payload. Copy and Share still produce the correct value, so this only affects what is displayed. The smallest fix is to render requestValue with BitcoinAddressText, or a variant of it that takes a font size. Note that WavelengthUITests and SignetWalletTests (lines 68–70 and 120–122) look up the invoice as staticTexts["receive.request"], so those lookups would need to change to textViews.

Reviewed at medium effort.

Bot commands
  • /gateway re-review — re-run after pushing changes (maintainers)
  • /gateway dismiss <id> — silence a finding (maintainers)
  • /gateway explain <id> — elaborate on a finding (maintainers or PR author)

@lightninglabs-gateway

lightninglabs-gateway Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

🤖 gateway audit metadata for this PR — auto-generated, please don't edit.

@bhandras

Copy link
Copy Markdown
Member Author

F1 is a follow-up. I checked main at 6181701. ReceiveView.swift already used SwiftUI Text for the raw invoice and completed address inside Details. Both can show a visual hyphen at a line break. Copy and Share use the original request string. The new on-chain address below the QR uses character wrapping and was verified with a full 62-character address. I’m leaving the Details renderer for a separate change.

Initial amount focus passed on iOS 18.6 and 26.5. Automatic focus on iOS 15–16 is unverified. Tapping the amount also focuses it.

No code changes came out of this review. All build and test checks passed on the reviewed commit, b99171a.

@bhandras
bhandras merged commit 58fd61b into main Nov 27, 2026
5 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