Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add invoice and bond payout: Scan QR offers a detour where there is no camera

Open Beginner friendly
#766 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
dart, flutter
Domain
mobile

Research direction

Read add_lightning_invoice_screen.dart and bond_payout_invoice_screen.dart, then trace how canScanQr() and qrScanUnavailable are used in the NWC wallet and Cashu Receive. Add widget tests for disabled Scan actions on Linux and enabled actions on Android, and run the affected tests. Done when both screens follow that behavior; regenerate the goldens if they change.

Written by the indexing model from the issue text.

Description

What happens

On web, Linux, Windows and macOS the app has no camera scanner: since #657, PlatformAwareQrScanner shows a paste form there (qrInputFor), and canScanQr() is false.

Two screens still offer Scan QR as if it worked:

  • Add Lightning invoice (lib/features/order/screens/add_lightning_invoice_screen.dart): the field's Scan action (InvoiceInputField, AutomationIds.invoiceScan).
  • Bond payout claim (lib/features/order/screens/bond_payout_invoice_screen.dart): the Scan icon next to Paste (InvoiceIconAction).

On those platforms, tapping it opens a page titled "Scan QR Code" that is a second paste field with Submit, over a screen that already has a field and a Paste button. It works (before #657 it was a blank page), but it is a detour with nothing to scan.

The NWC wallet and Cashu Receive already handle this (#657): Scan QR stays visible, disabled, with the tooltip "Not available on this device" (qrScanUnavailable).

Proposal

Apply the same rule to both screens:

  • Where canScanQr() is false, the Scan action is disabled and shows the qrScanUnavailable tooltip (hover, long press, screen readers). Where it is true, nothing changes.
  • Add invoice: _FieldAction.onPressed is non-nullable today, and InvoiceInputField.onScan is required. Make them nullable, so that null draws the disabled state in the palette's faint ink with the tooltip. AutomationIds.invoiceScan stays on the action.
  • Bond payout: InvoiceIconAction.onPressed is already nullable, so pass null and switch the tooltip to qrScanUnavailable.
  • No new l10n key: qrScanUnavailable exists in all six locales.

Tests

  • Widget tests on both screens: on Linux, the Scan action is disabled with the reason; on Android it is enabled.
  • The add-invoice and bond goldens may change (disabled ink), regenerated in CI.

Out of scope

  • Enabling the camera on macOS (entitlement and NSCameraUsageDescription). That needs a Mac and is a separate issue.

Follow-up of #657 (noted in specs/004-mostro-p2p-client/tasks.md, T121).

Dominant language
Dart
Stars
11
Forks
9
Avg merge
17h 18m
Merged PRs (30d)
195

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MostroP2P/app

All issues in MostroP2P/app

Similar issues

More Dart issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.