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

Refactor various popups #16430

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Refactor various popups #16430

wants to merge 7 commits into from

Conversation

iurimatias
Copy link
Member

What does the PR do

Refactors the various popups to remove logic, make them functional and simplifies the code. Also added storybook pages for each of these components.

Affected areas

Popups affected:

  • Send Contact Request Popup
  • Review Contact Request Popup
  • Remove Contact Popup
  • Mark as Untrusted Popup
  • Add Nickname Popup
  • Block Contact popup
  • Unblock Contact popup

Also affected but not testable right now because this feature is disabled (and likely will be removed):

  • Contact Verification Popup
  • Mark as ID Verified Popup
  • Remove ID verification Popup
  • Outgoing Contact Verification Request Popup

Impact on end user

The behaviour of these popups should remain the same

How to test

Generally, right clicking on the user profile and select the menu item, then test if the functionality still works.

example:

  1. right click on a profile that is already a contact
  2. click remove contact

expectation: the popup should contain the correct data about the user

  1. click remove contact

expectation: contact should be removed

ID verification is less of a concern as this feature is disabled, no testing of this is expected.

Risk

Main risk is one of the popups listed in "Popups affected" no longer working.

@iurimatias iurimatias requested review from glitchminer, a team, jrainville and igor-sirotin and removed request for a team September 30, 2024 14:38
@status-im-auto
Copy link
Member

status-im-auto commented Sep 30, 2024

Jenkins Builds

Click to see older builds (6)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 85f5df9 #1 2024-09-30 14:45:21 ~6 min macos/aarch64 🍎dmg
✔️ 85f5df9 #1 2024-09-30 14:46:04 ~7 min tests/nim 📄log
✔️ 85f5df9 #1 2024-09-30 14:51:03 ~12 min tests/ui 📄log
✔️ 85f5df9 #1 2024-09-30 14:51:21 ~12 min macos/x86_64 🍎dmg
✔️ 85f5df9 #1 2024-09-30 14:54:04 ~15 min linux-nix/x86_64 📦tgz
✔️ 85f5df9 #1 2024-09-30 14:56:55 ~18 min linux/x86_64 📦tgz
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ c508e59 #2 2024-10-07 16:56:37 ~5 min macos/aarch64 🍎dmg
✔️ c508e59 #2 2024-10-07 16:57:43 ~6 min tests/nim 📄log
✔️ c508e59 #2 2024-10-07 17:03:12 ~12 min macos/x86_64 🍎dmg
c508e59 #2 2024-10-07 17:03:43 ~12 min tests/ui 📄log
✔️ c508e59 #2 2024-10-07 17:04:43 ~13 min linux-nix/x86_64 📦tgz
✔️ c508e59 #2 2024-10-07 17:06:03 ~14 min linux/x86_64 📦tgz
✔️ 43dc5d2 #3 2024-10-10 14:44:00 ~4 min macos/aarch64 🍎dmg
✔️ 43dc5d2 #3 2024-10-10 14:46:16 ~6 min tests/nim 📄log
✔️ 43dc5d2 #3 2024-10-10 14:51:21 ~11 min tests/ui 📄log
✔️ 43dc5d2 #3 2024-10-10 14:51:29 ~11 min linux-nix/x86_64 📦tgz
✔️ 43dc5d2 #3 2024-10-10 14:52:19 ~12 min macos/x86_64 🍎dmg
✔️ 43dc5d2 #3 2024-10-10 14:55:16 ~15 min linux/x86_64 📦tgz
✔️ 43dc5d2 #3 2024-10-10 15:04:19 ~24 min windows/x86_64 💿exe

@status-im-auto
Copy link
Member

Copy link
Member

@jrainville jrainville left a comment

Choose a reason for hiding this comment

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

Nice job! It does look way cleaner.

Just small questions and suggestions

isContact: details.isContact,
trustStatus: details.trustStatus,
isBlocked: details.isBlocked
}
Copy link
Member

Choose a reason for hiding this comment

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

I think you can just do

details.publicKey = publicKey

Instead of redefining the object.

ui/app/mainui/Popups.qml Show resolved Hide resolved
ui/app/mainui/Popups.qml Show resolved Hide resolved
ui/app/mainui/Popups.qml Show resolved Hide resolved
@@ -240,7 +269,16 @@ QtObject {
let details = contactDetails ?? Utils.getContactDetailsAsJson(publicKey, false)
const popupProperties = {
publicKey: publicKey,
contactDetails: details
// contactDetails: details
Copy link
Member

Choose a reason for hiding this comment

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

leftover

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.

image

way too much for a single PR; also the individual commits are kinda unrelated to the components

I suggest breaking it down to several PRs, and do one component at a time if possible

@caybro
Copy link
Member

caybro commented Oct 2, 2024

Another point; we used to have all these popups integrated into this SB page:

image

However, after the recent refactorings, this ProfileDialogView page is no longer working at all (including the popups touched here). Perhaps it would be a better idea to fix this page instead as part of the refactor work

@glitchminer
Copy link
Contributor

Test plan to start pending code review: https://ethstatus.testrail.net/index.php?/plans/view/18128

@iurimatias
Copy link
Member Author

image

way too much for a single PR; also the individual commits are kinda unrelated to the components

I suggest breaking it down to several PRs, and do one component at a time if possible

It's a small PR actually, it looks big because it adds a lot of storybook pages, and the components are all related due to a common component and dividing this into separate PRs would severely complicate things

@iurimatias
Copy link
Member Author

to elaborate, CommonContactDialog uses contactDetails, and that affects all components

@status-im-auto
Copy link
Member

Copy link
Member

@jrainville jrainville left a comment

Choose a reason for hiding this comment

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

Looks good code wise. I'll test in a few

Copy link
Member

@jrainville jrainville left a comment

Choose a reason for hiding this comment

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

I tried this PR and sending a contact request seems to be broken:

DBG 2024-10-07 18:06:40.660Z NewBE_callPrivateRPC                       topics="rpc" tid=93126 file=core.nim:27 rpc_method=wakuext_sendContactRequest
ERR 2024-10-07 18:06:40.660Z rpc response error                         topics="rpc" tid=93126 file=core.nim:36 err="\nstatus-go error [methodName:wakuext_sendContactRequest, code:-32000, message:send-contact-request: invalid message ]\n"
ERR 2024-10-07 18:06:40.660Z error doing rpc request                    topics="rpc" tid=93126 file=core.nim:39 methodName=wakuext_sendContactRequest exception="\nstatus-go error [methodName:wakuext_sendContactRequest, code:-32000, message:send-contact-request: invalid message ]\n"
ERR 2024-10-07 18:06:40.660Z an error occurred while sending the contact request topics="contacts-service" tid=93126 file=service.nim:501 msg="\nstatus-go error [methodName:wakuext_sendContactRequest, code:-32000, message:send-contact-request: invalid message ]\n"

Copy link
Member

@jrainville jrainville left a comment

Choose a reason for hiding this comment

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

Issue 1

The popup to review the contact request of someone is empty:
image

The only warning in the logs that is a little suspicious is

WRN 2024-10-10 17:17:34.967Z qt warning                                 topics="qt" tid=763306 text="TypeError: Cannot read property 'chatDetails' of undefined" file=qrc:/app/AppLayouts/Chat/stores/RootStore.qml:26 category=default

but it's about a chat, so it's probably unrelated.

Issue 2

I marked a user as untrustworthy, but after a second, the icon disappeared. I think this is a known issue though : #16392

Issue 3

Probably unrelated to this, but your own context menu doesn't look very good with a big space and a useless separator:
image

Issue 4

Also probably not related, but when someone is blocked, the context menu has a useless separator:
image

@jrainville
Copy link
Member

@iurimatias testing done. The first issue is the only one that is necessary to fix before merging this IMO.

The other 3 are either already opened as issues or can be opened separetely.

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.

5 participants