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(CommunityOwnership): UI toasts part #12645

Merged
merged 1 commit into from
Nov 10, 2023
Merged

Conversation

noeliaSD
Copy link
Contributor

@noeliaSD noeliaSD commented Nov 6, 2023

Part of #12175.

NOTE: It needs some other backend works in order to fully close it (missing signal communityTokensModuleInst.sendOwnerTokenStateChanged)

What does the PR do

This is a first step to globalize how toasts are treated in the qml layer:

  • Created ToastsManager.qml class to deal with all app toasts generation.
  • Started moving community transfer ownership related toasts to the new manager class.
  • Some small cleanup in AppMain.qml

Nim backend:

  • Created new api method to deal with extended / action toasts.
  • Updated needed model / item with new needed roles.

NOTE: There will be a follow up task to work on the next toasts management unification refactor: #12661

Affected areas

AppMain / Toasts
CommunityTokensStore

Screenshot of functionality

Screenshot 2023-11-06 at 19 55 14

  • Dummy data example and forcing toasts visualization just to play with the UI:
Screen.Recording.2023-11-06.at.19.57.22.mov

@status-im-auto
Copy link
Member

status-im-auto commented Nov 6, 2023

Jenkins Builds

Click to see older builds (42)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 7c782a9 #1 2023-11-06 19:20:04 ~5 min tests/nim 📄log
✔️ 7c782a9 #1 2023-11-06 19:23:01 ~8 min macos/aarch64 🍎dmg
✔️ 7c782a9 #1 2023-11-06 19:24:55 ~10 min macos/x86_64 🍎dmg
7c782a9 #1 2023-11-06 19:25:20 ~10 min tests/ui 📄log
✔️ 7c782a9 #1 2023-11-06 19:30:33 ~15 min linux/x86_64 📦tgz
✔️ 7c782a9 #1 2023-11-06 19:51:29 ~36 min windows/x86_64 💿exe
✖️ 7c782a9 #1 2023-11-06 19:53:25 ~38 min tests/e2e 📄log
✔️ 7dcd209 #2 2023-11-07 10:05:00 ~5 min macos/aarch64 🍎dmg
✔️ 7dcd209 #2 2023-11-07 10:05:32 ~6 min tests/nim 📄log
✔️ 7dcd209 #2 2023-11-07 10:09:33 ~10 min macos/x86_64 🍎dmg
7dcd209 #2 2023-11-07 10:10:05 ~10 min tests/ui 📄log
✔️ 7dcd209 #2 2023-11-07 10:13:24 ~14 min linux/x86_64 📦tgz
✔️ 7dcd209 #2 2023-11-07 10:30:42 ~31 min windows/x86_64 💿exe
✖️ 7dcd209 #2 2023-11-07 10:35:37 ~36 min tests/e2e 📄log
✔️ 7c0818c #3 2023-11-07 11:06:10 ~6 min tests/nim 📄log
✔️ 7c0818c #3 2023-11-07 11:08:18 ~8 min macos/aarch64 🍎dmg
✔️ 7c0818c #3 2023-11-07 11:09:13 ~9 min macos/x86_64 🍎dmg
7c0818c #3 2023-11-07 11:11:22 ~11 min tests/ui 📄log
✔️ 7c0818c #3 2023-11-07 11:16:54 ~17 min linux/x86_64 📦tgz
✔️ 7c0818c #3 2023-11-07 11:30:19 ~30 min windows/x86_64 💿exe
✖️ 7c0818c #3 2023-11-07 11:41:13 ~41 min tests/e2e 📄log
✔️ 083cbdf #4 2023-11-08 09:13:43 ~5 min tests/nim 📄log
✔️ 083cbdf #4 2023-11-08 09:14:30 ~6 min macos/aarch64 🍎dmg
✔️ 083cbdf #4 2023-11-08 09:16:47 ~8 min macos/x86_64 🍎dmg
✔️ 083cbdf #4 2023-11-08 09:19:18 ~11 min tests/ui 📄log
✔️ 083cbdf #4 2023-11-08 09:22:09 ~13 min linux/x86_64 📦tgz
✔️ 083cbdf #4 2023-11-08 09:39:46 ~31 min windows/x86_64 💿exe
✖️ 083cbdf #4 2023-11-08 09:43:11 ~34 min tests/e2e 📄log
✔️ 083cbdf #5 2023-11-08 13:41:13 ~5 min macos/aarch64 🍎dmg
✔️ 083cbdf #5 2023-11-08 13:42:51 ~6 min tests/nim 📄log
✔️ 083cbdf #5 2023-11-08 13:44:29 ~8 min macos/x86_64 🍎dmg
✔️ 083cbdf #5 2023-11-08 13:47:11 ~11 min tests/ui 📄log
✔️ 083cbdf #5 2023-11-08 13:50:14 ~14 min linux/x86_64 📦tgz
✔️ 083cbdf #5 2023-11-08 14:06:27 ~30 min windows/x86_64 💿exe
✖️ 083cbdf #5 2023-11-08 14:14:43 ~38 min tests/e2e 📄log
✔️ a1d8903 #6 2023-11-08 15:22:34 ~5 min macos/aarch64 🍎dmg
✔️ a1d8903 #6 2023-11-08 15:23:01 ~6 min tests/nim 📄log
✔️ a1d8903 #6 2023-11-08 15:25:12 ~8 min macos/x86_64 🍎dmg
✔️ a1d8903 #6 2023-11-08 15:28:01 ~11 min tests/ui 📄log
✔️ a1d8903 #6 2023-11-08 15:32:24 ~15 min linux/x86_64 📦tgz
✔️ a1d8903 #6 2023-11-08 15:50:56 ~34 min windows/x86_64 💿exe
✖️ a1d8903 #6 2023-11-08 15:52:52 ~36 min tests/e2e 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 9cf3088 #7 2023-11-10 12:09:08 ~5 min tests/nim 📄log
✔️ 9cf3088 #7 2023-11-10 12:09:16 ~5 min macos/aarch64 🍎dmg
✔️ 9cf3088 #7 2023-11-10 12:11:39 ~8 min macos/x86_64 🍎dmg
✔️ 9cf3088 #7 2023-11-10 12:14:49 ~11 min tests/ui 📄log
✔️ 9cf3088 #7 2023-11-10 12:17:29 ~14 min linux/x86_64 📦tgz
✔️ 9cf3088 #7 2023-11-10 12:35:21 ~31 min windows/x86_64 💿exe
✖️ 9cf3088 #7 2023-11-10 12:38:36 ~35 min tests/e2e 📄log
✔️ 1b4352f #8 2023-11-10 15:56:36 ~7 min tests/nim 📄log
✔️ 1b4352f #8 2023-11-10 15:57:49 ~8 min macos/aarch64 🍎dmg
✔️ 1b4352f #8 2023-11-10 16:02:07 ~12 min macos/x86_64 🍎dmg
✔️ 1b4352f #8 2023-11-10 16:05:04 ~15 min tests/ui 📄log
✔️ 1b4352f #8 2023-11-10 16:06:10 ~17 min linux/x86_64 📦tgz
✔️ 1b4352f #8 2023-11-10 16:23:34 ~34 min windows/x86_64 💿exe
✔️ 1b4352f #8 2023-11-10 16:24:34 ~35 min tests/e2e 📄log

@noeliaSD noeliaSD force-pushed the feat/toasts-issue-12175 branch 2 times, most recently from 7dcd209 to 7c0818c Compare November 7, 2023 10:59
@noeliaSD noeliaSD marked this pull request as ready for review November 7, 2023 11:04
@noeliaSD
Copy link
Contributor Author

noeliaSD commented Nov 7, 2023

There's an extra commit added to facilitate some pr testing. It will be removed once the review is ready! Steps to test it with the dummy data added in the pr description.

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.

Looks nice and seems to be a step into a right direction :)

However I don't fully understand some nuances here:

  • Why UI intercepts some events notified by the backend, forms messages and calls back to backend in order to display it (e.g. displayEphemeralNotification). Tehn backend exposes notifications via a model - is it necessary to somehow persist state of that model and that's the resaon why it's held on the backend side?
  • Now ToastsManager both emits Global.displayToastWithActionMessage and also handles it internally. Is the intention to finally remove that global signal and listen to all necessary stores inside manager?

ui/app/mainui/ToastsManager.qml Outdated Show resolved Hide resolved
ui/app/mainui/AppMain.qml Outdated Show resolved Hide resolved
@noeliaSD
Copy link
Contributor Author

noeliaSD commented Nov 10, 2023

Looks nice and seems to be a step into a right direction :)

However I don't fully understand some nuances here:

  • Why UI intercepts some events notified by the backend, forms messages and calls back to backend in order to display it (e.g. displayEphemeralNotification). Tehn backend exposes notifications via a model - is it necessary to somehow persist state of that model and that's the resaon why it's held on the backend side?

There is a follow up task to better analyse the current implementation. This is one of the points to work on this mentioned task. If you have other concerns, please add comments in there so we can consider them later.

  • Now ToastsManager both emits Global.displayToastWithActionMessage and also handles it internally. Is the intention to finally remove that global signal and listen to all necessary stores inside manager?

YES! This is the final intention, however nowadays we have other calls using the Global object that have not been refactored in here, so for not introducing confusion I've just moved them to the manager and in the next step, if it's possible, the idea is to just manage everything from there by listening, as you said, to all the needed stores.

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.

A good first step. 👍
Tested and work well. No regressions found.

However, I'm now sure about the actionRequired. IMO it should use the general deep links implementation (https://github.com/status-im/status-desktop/blob/master/src/app/core/custom_urls/urls_manager.nim#L56). The implementation should not be different if I trigger the action from the OS notification or the toast notification.

One other thing I've noticed is that the ToastManager doesn't really manages toasts. Currently it's more of a publisher. Not a big deal, the code is totally reusable whatever the final approach would be and I think it's good to merge as is.

@noeliaSD
Copy link
Contributor Author

A good first step. 👍 Tested and work well. No regressions found.

However, I'm now sure about the actionRequired. IMO it should use the general deep links implementation (https://github.com/status-im/status-desktop/blob/master/src/app/core/custom_urls/urls_manager.nim#L56). The implementation should not be different if I trigger the action from the OS notification or the toast notification.

One other thing I've noticed is that the ToastManager doesn't really manages toasts. Currently it's more of a publisher. Not a big deal, the code is totally reusable whatever the final approach would be and I think it's good to merge as is.

Noted in the follow up task! Thanks for point that points out!

…and new nim backend for special toasts visualization

This is a first step to globalize how toasts are treated in the qml layer:
- Created `ToastsManager.qml` class to deal with all app toasts generation.
- Started moving community transfer ownership related toasts to the new manager class.
- Some small cleanup in `AppMain.qml`

Nim backend:
- Created new api method to deal with extended / action toasts.
- Updated needed model / item with new needed roles.

Closes of #12175
@noeliaSD noeliaSD merged commit 8bede5e into master Nov 10, 2023
8 of 9 checks passed
@noeliaSD noeliaSD deleted the feat/toasts-issue-12175 branch November 10, 2023 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants