Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto read clipboard in send screen #200

Closed
Bosch-0 opened this issue Oct 11, 2021 · 7 comments
Closed

Auto read clipboard in send screen #200

Bosch-0 opened this issue Oct 11, 2021 · 7 comments

Comments

@Bosch-0
Copy link

Bosch-0 commented Oct 11, 2021

When opening the receive screen if the user has a Lightning invoice copied in their clipboard it should auto read it and give an option to click a button opening that invoice.

Mockup below:

image

@dpad85
Copy link
Member

dpad85 commented Oct 13, 2021

It's a good idea especially because clipboard data would only be read when the user is the "send payment" context. Also, if the invoice has an amount/description, we can display that instead of the raw invoice, something like:

PAY INVOICE IN CLIPBOARD
lnbc1u1pwz5w78pp5e8w8cr5c30...
1234 sat for 1 cup of coffee

Since it's a lot of text compared to what we have now, we probably have to revisit the layout of the send screen. We also need room to add a button to load QR code screenshots saved on disk, and a button to input an invoice manually (which is needed for lightning addresses).

@Bosch-0
Copy link
Author

Bosch-0 commented Oct 15, 2021

Here is a quick mockup integrating your suggestions:

  • Icon on top right lets you pick an image.
  • Only show the payment amount and who it is being sent to.
    • If they have a node alias set you could put this there or if they use an invoice name similar to what blixt does. Showing invoice data probably isn't required here. If they want to they have send see it within the next send details screen.
    • If no name could just say 'to unknown.'
  • If clipboard is clear have option to manually enter, for Lnaddress for example.
    • May need to add a 'clear clipboard' button to the right of the clipboard popup which would switch to the manually enter screen. This would be if the user has something on their clipboard but wants to manually pay instead.
  • Also added other clipboard states for LNURL-Pay and LNURL-Withdraw on the left.

image

@robbiehanson
Copy link
Contributor

I started to implement this. But in testing I noticed something I hadn't considered before:

On iOS, we can quietly ask if the clipboard has a string (yes or no). But if we actually read the string, then iOS presents this pop-up. I personally find it to be a little distracting.

(Note that it's quite common to have something in the clipboard - usually a string. So this pop-up will be occurring most of the time we visit this screen.)

Also, we probably shouldn't fetch a LNURL unless instructed to do so by the user. There are security considerations.

So, what we can discover (without performing a URL request):

  • Bolt 11 invoice
  • LNUrl.Auth
  • LNUrl (generic URL)

Open questions for discussion:

  • Does the iOS pop-up pose a problem ?
  • Will the user care, or is this to be expected ?
  • How will this feature be affected by Bolt 12 offers ?

@dpad85
Copy link
Member

dpad85 commented Feb 2, 2022

Does the iOS pop-up pose a problem ?

If it does then the whole auto-read feature has to be dropped. By the way, recent versions of Android show the same warning.

It is not great, it does feel a bit invasive, but still seems OK to me. This behaviour would be limited to that screen, whose purpose is obvious (send a payment after reading external data) so the user can reasonably expect that the app will read the clipboard. We could make this auto-read feature opt-out ?

How will this feature be affected by Bolt 12 offers ?

Bolt12 offers should be like classic Bolt11 invoices in that they can contain a description/amount that can be shown to the user before actually calling the offer itself.

@robbiehanson
Copy link
Contributor

@Bosch-0 I really liked the clean simplicity of your mock-ups. Especially how there was just a single button at the bottom of the scan screen. So here's what I came up with.

clipboard_inspect

@Bosch-0
Copy link
Author

Bosch-0 commented Apr 1, 2022

Hey Robbie, thanks!

Looks good! How does it appear if there is nothing on the clipboard? This prompt should probably only be shown if there is in fact relevant data on the clipboard.

One visual improvement suggestion would be the hamburger menu, I think it's protruding a little too much into the main screen region. A possible cleaner solution could be to have a button in the bottom right (so its easily clickable by most people) that when clicked shows a paste, image and manual entry option. Similar to this menu on Samurai shown below

Screenshot_20220401-105612

@robbiehanson
Copy link
Contributor

Closed via PR #260

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

No branches or pull requests

3 participants