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

Feat/request payment modal 16736 #16744

Merged
merged 1 commit into from
Dec 4, 2024
Merged

Conversation

Cuteivist
Copy link
Contributor

Closes #16736

What does the PR do

  • Added feature flag for Request Payment. Disabled until whole feature is finished
  • Added Request payment modal
  • Added menu for message commands (now featuring add image and add request payment). Request payment is disabled for testnet to prevent corner cases or issues.
  • Added RequestPaymentStore to easily pass required models and stores to modal
  • Updated storybook

Affected areas

Architecture compliance

Screenshot of functionality (including design for comparison)

  • I've checked the design and this PR matches it

image

image

Impact on end user

What is the impact of these changes on the end user (before/after behaviour)

How to test

  • How should one proceed with testing this PR.
    Enable request payment feature flag, go to any chat on mainnet.
  • What kind of user flows should be checked?

Risk

Described potential risks and worst case scenarios.

Tick one:

  • Low risk: 2 devs MUST perform testing as specified above and attach their results as comments to this PR before merging.
  • High risk: QA team MUST perform additional testing in the specified affected areas before merging.

@status-im-auto
Copy link
Member

status-im-auto commented Nov 11, 2024

Jenkins Builds

Click to see older builds (48)
Commit #️⃣ Finished (UTC) Duration Platform Result
cfc1b4c #1 2024-11-11 14:26:13 ~7 min macos/aarch64 📄log
✖️ cfc1b4c #1 2024-11-11 14:26:28 ~7 min tests/nim 📄log
cfc1b4c #1 2024-11-11 14:29:04 ~9 min tests/ui 📄log
cfc1b4c #1 2024-11-11 14:29:38 ~10 min linux-nix/x86_64 📄log
cfc1b4c #1 2024-11-11 14:30:47 ~11 min macos/x86_64 📄log
cfc1b4c #1 2024-11-11 14:30:48 ~11 min linux/x86_64 📄log
cfc1b4c #1 2024-11-11 14:33:09 ~13 min windows/x86_64 📄log
✔️ 6556a35 #2 2024-11-23 13:38:10 ~7 min macos/aarch64 🍎dmg
✔️ 6556a35 #2 2024-11-23 13:38:28 ~7 min tests/nim 📄log
✔️ 6556a35 #2 2024-11-23 13:43:16 ~12 min tests/ui 📄log
✔️ 6556a35 #2 2024-11-23 13:45:15 ~14 min macos/x86_64 🍎dmg
✔️ 6556a35 #2 2024-11-23 13:46:32 ~15 min linux-nix/x86_64 📦tgz
✔️ 6556a35 #2 2024-11-23 13:51:33 ~20 min windows/x86_64 💿exe
✔️ 6556a35 #2 2024-11-23 13:53:56 ~23 min linux/x86_64 📦tgz
✔️ b620d9c #3 2024-11-26 20:55:38 ~4 min macos/aarch64 🍎dmg
✔️ b620d9c #3 2024-11-26 20:58:33 ~7 min tests/nim 📄log
b620d9c #3 2024-11-26 21:01:01 ~10 min tests/ui 📄log
✔️ b620d9c #3 2024-11-26 21:03:55 ~13 min macos/x86_64 🍎dmg
✔️ b620d9c #3 2024-11-26 21:05:37 ~14 min linux-nix/x86_64 📦tgz
✔️ b620d9c #3 2024-11-26 21:10:33 ~19 min windows/x86_64 💿exe
✔️ b620d9c #3 2024-11-26 21:11:46 ~21 min linux/x86_64 📦tgz
b620d9c #4 2024-11-27 05:12:15 ~10 min tests/ui 📄log
b620d9c #5 2024-11-27 07:51:22 ~9 min tests/ui 📄log
✔️ f15477e #4 2024-12-02 07:52:36 ~7 min tests/nim 📄log
f15477e #6 2024-12-02 07:55:03 ~9 min tests/ui 📄log
✔️ f15477e #4 2024-12-02 08:05:58 ~20 min windows/x86_64 💿exe
✔️ f15477e #5 2024-12-02 09:11:24 ~7 min macos/aarch64 🍎dmg
f15477e #7 2024-12-02 09:14:13 ~10 min tests/ui 📄log
✔️ f15477e #5 2024-12-02 09:18:42 ~14 min linux-nix/x86_64 📦tgz
✔️ f15477e #5 2024-12-02 09:20:27 ~16 min macos/x86_64 🍎dmg
✔️ f15477e #6 2024-12-02 09:27:32 ~17 min linux/x86_64 📦tgz
2375029 #5 2024-12-02 11:54:23 ~5 min windows/x86_64 📄log
✔️ 2375029 #5 2024-12-02 11:56:39 ~8 min tests/nim 📄log
✔️ 2375029 #6 2024-12-02 11:56:51 ~8 min macos/aarch64 🍎dmg
✔️ 9ec0703 #7 2024-12-02 12:04:37 ~4 min macos/aarch64 🍎dmg
✔️ 9ec0703 #6 2024-12-02 12:12:15 ~12 min tests/nim 📄log
9ec0703 #9 2024-12-02 12:16:31 ~16 min tests/ui 📄log
✔️ 9ec0703 #7 2024-12-02 12:17:54 ~18 min macos/x86_64 🍎dmg
✔️ 9ec0703 #7 2024-12-02 12:18:49 ~19 min linux-nix/x86_64 📦tgz
✔️ 9ec0703 #6 2024-12-02 12:20:08 ~20 min windows/x86_64 💿exe
✔️ 9ec0703 #8 2024-12-02 12:20:36 ~20 min linux/x86_64 📦tgz
✔️ 21e7fae #7 2024-12-02 13:00:23 ~7 min tests/nim 📄log
✔️ 21e7fae #8 2024-12-02 13:04:23 ~11 min macos/x86_64 🍎dmg
✔️ 21e7fae #10 2024-12-02 13:05:05 ~11 min tests/ui 📄log
✔️ 21e7fae #8 2024-12-02 13:05:56 ~12 min linux-nix/x86_64 📦tgz
✔️ 21e7fae #8 2024-12-02 13:07:50 ~14 min macos/aarch64 🍎dmg
✔️ 21e7fae #9 2024-12-02 13:09:13 ~16 min linux/x86_64 📦tgz
✔️ 21e7fae #7 2024-12-02 13:11:44 ~18 min windows/x86_64 💿exe
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ eb90211 #9 2024-12-04 14:04:09 ~6 min macos/aarch64 🍎dmg
✔️ eb90211 #9 2024-12-04 14:10:56 ~13 min linux-nix/x86_64 📦tgz
✔️ eb90211 #9 2024-12-04 14:13:46 ~15 min macos/x86_64 🍎dmg
✔️ eb90211 #8 2024-12-04 14:13:53 ~15 min tests/nim 📄log
✔️ eb90211 #10 2024-12-04 14:17:54 ~19 min linux/x86_64 📦tgz
✔️ eb90211 #11 2024-12-04 14:19:36 ~21 min tests/ui 📄log
✔️ eb90211 #8 2024-12-04 14:26:32 ~28 min windows/x86_64 💿exe
✔️ e19831a #10 2024-12-04 15:36:49 ~6 min macos/aarch64 🍎dmg
✔️ e19831a #9 2024-12-04 15:41:48 ~11 min tests/nim 📄log
✔️ e19831a #10 2024-12-04 15:41:55 ~11 min macos/x86_64 🍎dmg
✔️ e19831a #10 2024-12-04 15:44:13 ~13 min linux-nix/x86_64 📦tgz
✔️ e19831a #12 2024-12-04 15:48:35 ~17 min tests/ui 📄log
✔️ e19831a #11 2024-12-04 15:50:38 ~20 min linux/x86_64 📦tgz
✔️ e19831a #9 2024-12-04 15:58:55 ~28 min windows/x86_64 💿exe

Copy link
Member

@caybro caybro left a comment

Choose a reason for hiding this comment

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

LGTM in general, apart from the vertical (mis)alignment between the amount and the token selector when looking at the screenshot :)

ui/app/AppLayouts/Chat/popups/RequestPaymentModal.qml Outdated Show resolved Hide resolved
@alexjba
Copy link
Contributor

alexjba commented Nov 19, 2024

Build fails on all platforms

[2024-11-11T14:30:45.449Z] /home/jenkins/workspace/rs_linux_x86_64_package_PR-16744/src/app/global/feature_flags.nim(13, 1) template/generic instantiation of `QtObject` from here
[2024-11-11T14:30:45.450Z] /home/jenkins/workspace/rs_linux_x86_64_package_PR-16744/src/app/global/feature_flags.nim(26, 32) Error: undeclared field: 'requestPaymentEnabled=' for type feature_flags.FeatureFlags [type declared in /home/jenkins/workspace/rs_linux_x86_64_package_PR-16744/src/app/global/feature_flags.nim(14, 8)]

Copy link
Contributor

@alexjba alexjba left a comment

Choose a reason for hiding this comment

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

Nice work! LGTM in general!

A few findings below.

storybook/pages/RequestPaymentModalPage.qml Outdated Show resolved Hide resolved
ui/app/AppLayouts/Chat/popups/RequestPaymentModal.qml Outdated Show resolved Hide resolved
ui/app/AppLayouts/Chat/popups/RequestPaymentModal.qml Outdated Show resolved Hide resolved
ui/imports/shared/status/StatusChatInput.qml Outdated Show resolved Hide resolved
ui/app/AppLayouts/Chat/popups/RequestPaymentModal.qml Outdated Show resolved Hide resolved
Copy link
Member

@micieslak micieslak left a comment

Choose a reason for hiding this comment

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

Definitely good job in general, however I have several concerns regarding the architecture which are worth amending imo:

  1. The modal should be fully decoupled from StatusChatInput. StatusChatInput should only emit signal with request to launch the modal instead of managing it internally, because it causes that StatusChagInput depends on everything the modal depends on now and will depend on in the future. Those two things become tightly coupled unnecessarily.
  2. RequestPaymentStore is probably not needed at all. Broadly speaking, the store is not intended to be a container to move stuff around UI components. It's to expose backend's functionality. And every backend's mode/signal/function should be exposed only once via a single store.
  3. The RequestPaymentModal should be a plain UI component taking some models and emitting some signals with no dependency on any store. Also transformations like that done by TokenSelectorViewAdaptor should not be done internally. Instead the modal should depend on the model. It's up to the caller to compose data using any adaptor that's needed.

In case of any doubts please ping me, I will be happy to discuss about that.

@micieslak micieslak mentioned this pull request Nov 19, 2024
2 tasks
@Cuteivist Cuteivist force-pushed the feat/request-payment-modal-16736 branch from cfc1b4c to 6556a35 Compare November 23, 2024 13:30
@Cuteivist Cuteivist requested a review from a team as a code owner November 26, 2024 20:50
@Cuteivist
Copy link
Contributor Author

@micieslak

I refactored the approach according to your guidelines.

  • Store I added is removed. Only models are passed inside the modal. Even the Adaptor is moved outside the Popup.
  • I moved Modal component to Popups object, so it is not tightly coupled with chat.
  • StatusChatInput now only handles payment requests using the signals

@alexjba @caybro Please have a look too and review it.

Copy link
Member

@caybro caybro left a comment

Choose a reason for hiding this comment

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

LGTM in general, besides the 2 things in Popups.qml

src/app/global/feature_flags.nim Outdated Show resolved Hide resolved
ui/imports/utils/Global.qml Outdated Show resolved Hide resolved
ui/app/mainui/Popups.qml Outdated Show resolved Hide resolved
@Cuteivist Cuteivist force-pushed the feat/request-payment-modal-16736 branch 3 times, most recently from 9ec0703 to 21e7fae Compare December 2, 2024 12:52
Copy link
Contributor

@alexjba alexjba left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

@Cuteivist Cuteivist requested review from caybro and micieslak December 2, 2024 14:12
Copy link
Member

@caybro caybro left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@micieslak micieslak left a comment

Choose a reason for hiding this comment

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

Hey! Thank you for all those alignments you introduced. Looks much better. It's ok in general, just found some minor things that should be quick to fix.

ui/app/AppLayouts/Chat/popups/PaymentRequestModal.qml Outdated Show resolved Hide resolved
ui/app/AppLayouts/Chat/popups/PaymentRequestModal.qml Outdated Show resolved Hide resolved
storybook/pages/PaymentRequestModalPage.qml Outdated Show resolved Hide resolved
ui/imports/shared/popups/send/views/AmountToSend.qml Outdated Show resolved Hide resolved
ui/imports/shared/status/StatusChatInput.qml Outdated Show resolved Hide resolved
ui/imports/shared/status/StatusChatInput.qml Outdated Show resolved Hide resolved
ui/app/mainui/AppMain.qml Outdated Show resolved Hide resolved
ui/imports/utils/Global.qml Show resolved Hide resolved
@micieslak micieslak self-requested a review December 3, 2024 10:47
Copy link

@virginiabalducci virginiabalducci left a comment

Choose a reason for hiding this comment

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

This looks good!
Testing feedback here: #16833
The pending issues are not related to this feature.

@Cuteivist Cuteivist force-pushed the feat/request-payment-modal-16736 branch from 21e7fae to eb90211 Compare December 4, 2024 13:57
@jrainville jrainville force-pushed the feat/request-payment-modal-16736 branch from eb90211 to e19831a Compare December 4, 2024 15:30
@jrainville jrainville merged commit 5bf4ba2 into master Dec 4, 2024
9 checks passed
@jrainville jrainville deleted the feat/request-payment-modal-16736 branch December 4, 2024 16:19
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.

Request payment - modal
7 participants