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

Initial Template for Request Payment page #435

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

johnny9
Copy link
Contributor

@johnny9 johnny9 commented Nov 22, 2024

These commits introduce the Request Payment flow. This view is available under the "Receive" tab on the Desktop Wallets main navigation view.

The Request Payment form itself currently only includes fields currently supported by the Qt wallet (label, message, and amount). Follow up PR will add support for local notes.

The Amount field in the Request form takes only valid Satoshi/Bitcoin amounts and supports flipping the units with the associated button toggle.

When the Continue button is pressed the Request Confirmation page gets pushed to the stack will eventually reflect the fields inputted in the previous form backed by the output of the WalletModel result. In its current implemention it just has statically defined properties to check the visual layout. The page also contains an address field with the copy icon that can be used to move the address into your clipboard.

Ubuntu screenshots

@johnny9
Copy link
Contributor Author

johnny9 commented Nov 22, 2024

The piece I'm most concerned about this form is the Amount input field and how to properly sanitize and convert the field. The current object backing it doesnt quite feel right but I am limited by the inability to extend the actual TextInput class.

@johnny9 johnny9 changed the title Request Payment page Initial Template for Request Payment page Nov 22, 2024
{
QString result = text;

// Remove any invalid characters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the right thing to do?
QT gui simply refuses to paste when there are invalid characters.

@MarnixCroes
Copy link
Contributor

The piece I'm most concerned about this form is the Amount input field and how to properly sanitize and convert the field. The current object backing it doesnt quite feel right but I am limited by the inability to extend the actual TextInput class.

yeah there are a couple weird things:

  • decimals when having sats as unit
  • unnecessary leading zeroes when switching between sats en BTC. i.e. it can display things like 000100 sats

This control is primarily used in wallet forms where the user
is expected to input values for sending or receiving transactions.
It contains a Label describing the input as well as a TextInput
where the actual string is entered. A Icon is also available on
the right side of the component for extra actions.
The copy icon will be used to initiate a copy to clipboard
when it is clicked.
The flip-veritcal icon is primarily used when flipping the units
displayed when clicked
The pending icon will be used to show the status of transactions
@johnny9 johnny9 force-pushed the request-payment-form branch from 1b869eb to e642461 Compare November 25, 2024 14:23
BitcoinAmount is a helper object can be used to manage inputs in
sats or btc.
This page contains the form for the user to fill out to create
a payment request.
This page contains the details of a payment request. It is
pushed onto the RequestPayment page's stack after the user
has clicke don Continue.
@johnny9 johnny9 force-pushed the request-payment-form branch from e642461 to adff8f2 Compare November 25, 2024 18:39
@johnny9
Copy link
Contributor Author

johnny9 commented Nov 25, 2024

From from 1b869eb to adff8f

  • Rebased with main and used PageStack in RequestPayment.qml
  • Fixed lint issue
  • Fixed mac build issue with missing bitcoinamount.h in Makefile

@GBKS
Copy link
Contributor

GBKS commented Nov 28, 2024

Looking good. I know we talked about this before, that the basic concept of the receive page has changed a bit. Away from the two separate pages, and towards creating the QR code directly on the page. Just realized I already implemented this in the web prototype here (note the differences in responsive layouts).

The amount input logic, which you bring up, is not properly implemented in the web prototype. There definitely has to be some sanitation. Something to look out for is that when I type 5000 sats and switch to , it should then show 0.00 005 000 ₿ and not 5000 ₿. There should be a conversion happening. If this is too messy right now, I'd just come back to it in a separate PR.

In a web prototype update I am working on, I am tying the unit toggle to the application setting. So when you switch the unit in the amount input, the wallet balance display in the top left also changes. Wonder if that is intuitive or not. What do you think? In the send page, that unit setting should at least live on a user flow level. So when you toggle, the unit in the amount input, but also the fee selector changes, as well as the unit in the review screen.

Small thing about the input and amount fields is that I can enter unlimited characters (and emoji). Should probs be restricted in some way.

@johnny9
Copy link
Contributor Author

johnny9 commented Dec 1, 2024

Looking good. I know we talked about this before, that the basic concept of the receive page has changed a bit. Away from the two separate pages, and towards creating the QR code directly on the page. Just realized I already implemented this in the web prototype here (note the differences in responsive layouts).

I will remove the confirmation page and get the request page in alignment with the latest. I won't be able to get QR codes functioning in this PR as that will have to be a follow up once the requests are working end-to-end.

Small thing about the input and amount fields is that I can enter unlimited characters (and emoji). Should probs be restricted in some way.

I'll double check this. I've made some improvements with the amount but I havent tried emojis

@johnny9
Copy link
Contributor Author

johnny9 commented Dec 9, 2024

Screenshot from 2024-12-09 09-48-28
Screenshot from 2024-12-09 09-48-50

Updated the form to be a single page. Does not include QR code generation, separation of address text into individual items with their own background, or the copy tooltip. I'd prefer to add these details afterwards.

@GBKS
Copy link
Contributor

GBKS commented Dec 11, 2024

Looks great. I know you want to exclude various interaction details and handle those in follow-ups, so I won't comment on those. Just one question about the layout. Does this already include the mobile one where the QR code is inline and the buttons are static at the bottom?

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.

3 participants