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: Manage Collectibles panel UI component & model #12671

Merged

Conversation

caybro
Copy link
Member

@caybro caybro commented Nov 9, 2023

Fixes: #12379

What does the PR do

Adds a Manage Collectibles UI panel component to storybook

Affected areas

storybook

Screenshot of functionality (including design for comparison)

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

image

@caybro caybro linked an issue Nov 9, 2023 that may be closed by this pull request
@status-im-auto
Copy link
Member

status-im-auto commented Nov 9, 2023

Jenkins Builds

Click to see older builds (82)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ ab4faca #1 2023-11-09 11:32:37 ~5 min tests/nim 📄log
✔️ ab4faca #1 2023-11-09 11:35:22 ~8 min macos/aarch64 🍎dmg
✔️ ab4faca #1 2023-11-09 11:37:35 ~10 min macos/x86_64 🍎dmg
ab4faca #1 2023-11-09 11:39:03 ~11 min tests/ui 📄log
✔️ ab4faca #1 2023-11-09 11:42:44 ~15 min linux/x86_64 📦tgz
✔️ ab4faca #1 2023-11-09 11:53:52 ~26 min windows/x86_64 💿exe
✔️ ab4faca #1 2023-11-09 11:59:24 ~32 min tests/e2e 📄log
✔️ 28d0c7c #2 2023-11-09 12:27:59 ~5 min macos/aarch64 🍎dmg
✔️ 28d0c7c #2 2023-11-09 12:28:19 ~5 min tests/nim 📄log
✔️ 28d0c7c #2 2023-11-09 12:34:13 ~11 min tests/ui 📄log
✔️ 28d0c7c #2 2023-11-09 12:35:35 ~12 min macos/x86_64 🍎dmg
✔️ 28d0c7c #2 2023-11-09 12:36:56 ~14 min linux/x86_64 📦tgz
✔️ 28d0c7c #2 2023-11-09 12:43:32 ~20 min windows/x86_64 💿exe
✔️ 28d0c7c #2 2023-11-09 12:55:22 ~32 min tests/e2e 📄log
✔️ 45dd1a8 #3 2023-11-09 13:18:35 ~5 min macos/aarch64 🍎dmg
✔️ 45dd1a8 #3 2023-11-09 13:18:51 ~5 min tests/nim 📄log
✔️ 45dd1a8 #3 2023-11-09 13:21:23 ~8 min macos/x86_64 🍎dmg
✔️ 45dd1a8 #3 2023-11-09 13:24:45 ~11 min tests/ui 📄log
✔️ 45dd1a8 #3 2023-11-09 13:26:46 ~13 min linux/x86_64 📦tgz
✔️ 45dd1a8 #3 2023-11-09 13:32:55 ~19 min windows/x86_64 💿exe
✔️ 45dd1a8 #3 2023-11-09 13:42:54 ~29 min tests/e2e 📄log
✔️ f79ce6b #4 2023-11-09 14:29:45 ~7 min macos/aarch64 🍎dmg
✔️ f79ce6b #4 2023-11-09 14:32:46 ~10 min macos/x86_64 🍎dmg
✔️ f79ce6b #4 2023-11-09 14:32:46 ~10 min tests/nim 📄log
✔️ f79ce6b #4 2023-11-09 14:36:39 ~14 min linux/x86_64 📦tgz
✔️ f79ce6b #4 2023-11-09 14:37:24 ~14 min tests/ui 📄log
✖️ f79ce6b #4 2023-11-09 14:48:15 ~25 min tests/e2e 📄log
✔️ f79ce6b #4 2023-11-09 14:59:16 ~36 min windows/x86_64 💿exe
✔️ d203087 #5 2023-11-10 17:26:53 ~5 min macos/aarch64 🍎dmg
✔️ d203087 #5 2023-11-10 17:27:53 ~6 min tests/nim 📄log
✔️ d203087 #5 2023-11-10 17:30:37 ~8 min macos/x86_64 🍎dmg
✔️ d203087 #5 2023-11-10 17:33:54 ~12 min tests/ui 📄log
✔️ d203087 #5 2023-11-10 17:39:28 ~17 min linux/x86_64 📦tgz
✔️ d203087 #5 2023-11-10 17:44:21 ~22 min windows/x86_64 💿exe
✖️ d203087 #5 2023-11-10 17:55:57 ~34 min tests/e2e 📄log
✔️ b2716d9 #6 2023-11-11 00:31:42 ~5 min macos/aarch64 🍎dmg
✔️ b2716d9 #6 2023-11-11 00:32:09 ~5 min tests/nim 📄log
✔️ b2716d9 #6 2023-11-11 00:35:00 ~8 min macos/x86_64 🍎dmg
✔️ b2716d9 #6 2023-11-11 00:37:46 ~11 min tests/ui 📄log
✔️ b2716d9 #6 2023-11-11 00:43:12 ~16 min linux/x86_64 📦tgz
✔️ b2716d9 #6 2023-11-11 00:48:25 ~21 min windows/x86_64 💿exe
✔️ b2716d9 #6 2023-11-11 00:55:35 ~29 min tests/e2e 📄log
✔️ 5c62a5c #7 2023-11-13 08:38:11 ~5 min macos/aarch64 🍎dmg
✔️ 5c62a5c #7 2023-11-13 08:39:41 ~6 min tests/nim 📄log
✔️ 5c62a5c #7 2023-11-13 08:41:43 ~8 min macos/x86_64 🍎dmg
✔️ 5c62a5c #7 2023-11-13 08:44:18 ~11 min tests/ui 📄log
✔️ 5c62a5c #7 2023-11-13 08:47:06 ~14 min linux/x86_64 📦tgz
✔️ 5c62a5c #7 2023-11-13 09:02:54 ~29 min tests/e2e 📄log
✔️ 5c62a5c #7 2023-11-13 09:05:09 ~32 min windows/x86_64 💿exe
✔️ 8fe7ed8 #8 2023-11-13 23:09:17 ~5 min macos/aarch64 🍎dmg
✔️ 8fe7ed8 #8 2023-11-13 23:09:26 ~5 min tests/nim 📄log
✔️ 8fe7ed8 #8 2023-11-13 23:12:42 ~8 min macos/x86_64 🍎dmg
✔️ 8fe7ed8 #8 2023-11-13 23:15:32 ~11 min tests/ui 📄log
✔️ 8fe7ed8 #8 2023-11-13 23:18:25 ~14 min linux/x86_64 📦tgz
✔️ 8fe7ed8 #8 2023-11-13 23:27:18 ~23 min windows/x86_64 💿exe
✖️ 8fe7ed8 #8 2023-11-13 23:32:05 ~28 min tests/e2e 📄log
✖️ 8fe7ed8 #9 2023-11-14 00:04:29 ~30 min tests/e2e 📄log
✔️ 8fe7ed8 #10 2023-11-14 00:35:48 ~30 min tests/e2e 📄log
✔️ 129878f #9 2023-11-14 18:07:42 ~6 min tests/nim 📄log
✔️ 129878f #9 2023-11-14 18:09:56 ~8 min macos/x86_64 🍎dmg
✔️ 129878f #9 2023-11-14 18:13:25 ~12 min tests/ui 📄log
✔️ 129878f #9 2023-11-14 18:15:24 ~14 min linux/x86_64 📦tgz
✔️ 129878f #9 2023-11-14 18:24:09 ~22 min windows/x86_64 💿exe
✖️ 129878f #11 2023-11-14 18:26:53 ~25 min tests/e2e 📄log
129878f #10 2023-11-15 09:15:43 ~13 sec macos/aarch64 📄log
✔️ 129878f #11 2023-11-15 09:29:29 ~5 min macos/aarch64 🍎dmg
✔️ 129878f #12 2023-11-15 09:48:23 ~32 min tests/e2e 📄log
✔️ 2d380f7 #12 2023-11-16 00:21:45 ~5 min macos/aarch64 🍎dmg
✔️ 2d380f7 #10 2023-11-16 00:22:20 ~5 min tests/nim 📄log
✔️ 2d380f7 #10 2023-11-16 00:25:07 ~8 min macos/x86_64 🍎dmg
2d380f7 #10 2023-11-16 00:27:06 ~10 min tests/ui 📄log
✔️ 2d380f7 #10 2023-11-16 00:31:45 ~15 min linux/x86_64 📦tgz
✔️ 2d380f7 #10 2023-11-16 00:39:28 ~23 min windows/x86_64 💿exe
✔️ 2d380f7 #13 2023-11-16 00:47:58 ~31 min tests/e2e 📄log
2d380f7 #11 2023-11-16 00:59:46 ~6 min tests/ui 📄log
✔️ 5eb205c #13 2023-11-16 10:09:08 ~4 min macos/aarch64 🍎dmg
✔️ 5eb205c #11 2023-11-16 10:12:40 ~8 min tests/nim 📄log
✔️ 5eb205c #11 2023-11-16 10:12:55 ~8 min macos/x86_64 🍎dmg
✔️ 5eb205c #12 2023-11-16 10:16:55 ~12 min tests/ui 📄log
✔️ 5eb205c #11 2023-11-16 10:18:16 ~14 min linux/x86_64 📦tgz
✔️ 5eb205c #11 2023-11-16 10:25:56 ~21 min windows/x86_64 💿exe
✔️ 5eb205c #14 2023-11-16 10:35:42 ~31 min tests/e2e 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 24f1dc1 #14 2023-11-17 11:08:57 ~5 min macos/aarch64 🍎dmg
✔️ 24f1dc1 #12 2023-11-17 11:09:51 ~6 min tests/nim 📄log
✔️ 24f1dc1 #12 2023-11-17 11:12:10 ~8 min macos/x86_64 🍎dmg
24f1dc1 #13 2023-11-17 11:15:16 ~11 min tests/ui 📄log
✔️ cf4cf90 #15 2023-11-17 11:23:13 ~4 min macos/aarch64 🍎dmg
✔️ cf4cf90 #13 2023-11-17 11:24:23 ~5 min tests/nim 📄log
✔️ cf4cf90 #13 2023-11-17 11:26:04 ~7 min macos/x86_64 🍎dmg
✔️ cf4cf90 #14 2023-11-17 11:30:27 ~11 min tests/ui 📄log
✔️ cf4cf90 #13 2023-11-17 11:32:27 ~14 min linux/x86_64 📦tgz
✔️ cf4cf90 #13 2023-11-17 11:48:08 ~29 min windows/x86_64 💿exe
✔️ cf4cf90 #16 2023-11-17 11:49:03 ~30 min tests/e2e 📄log

@caybro caybro force-pushed the 12379-wallet-token-management-collectibles-tab-ui-panel-poc branch 4 times, most recently from f79ce6b to d203087 Compare November 10, 2023 17:21
@@ -21,6 +22,8 @@ public slots:
engine->addImportPath(path);

qmlRegisterSingletonType<TextUtils>("TextUtils", 1, 0, "TextUtils", &TextUtils::qmlInstance);

QStandardPaths::setTestModeEnabled(true);
Copy link
Member Author

@caybro caybro Nov 10, 2023

Choose a reason for hiding this comment

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

We don't want to overwrite user's actual settings :)

@caybro caybro force-pushed the 12379-wallet-token-management-collectibles-tab-ui-panel-poc branch 2 times, most recently from b2716d9 to 5c62a5c Compare November 13, 2023 08:32
@status-im-auto
Copy link
Member

✔️ status-desktop/prs/linux/x86_64/tests-nim/PR-12671#7 🔹 ~6 min 45 sec 🔹 5c62a5c 🔹 📦 tests/nim package

@caybro caybro marked this pull request as ready for review November 13, 2023 09:52
Copy link
Contributor

@alexandraB99 alexandraB99 left a comment

Choose a reason for hiding this comment

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

massive! is the commented code in ui/app/AppLayouts/Wallet/panels/ManageCollectiblesPanel.qml still there on purpose?

@caybro
Copy link
Member Author

caybro commented Nov 13, 2023

massive! is the commented code in ui/app/AppLayouts/Wallet/panels/ManageCollectiblesPanel.qml still there on purpose?

Yup, I'll create a separate issue to handle/enable that later

Edit: created as #12703

@caybro caybro force-pushed the 12379-wallet-token-management-collectibles-tab-ui-panel-poc branch from 5c62a5c to 8fe7ed8 Compare November 13, 2023 23:03
@caybro caybro force-pushed the 12379-wallet-token-management-collectibles-tab-ui-panel-poc branch from 8fe7ed8 to 129878f Compare November 14, 2023 18:01
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.

LGTM in general, some minor comments mainly. Nice to have some qml tests here :). Regarding models @noeliaSD may want to take a look.

ui/app/AppLayouts/Wallet/controls/ManageTokensDelegate.qml Outdated Show resolved Hide resolved
ui/app/AppLayouts/Wallet/controls/ManageTokensDelegate.qml Outdated Show resolved Hide resolved
verify(!!title1)

// DND one item down (~80px in height)
mouseDrag(delegate0, delegate0.width/2, delegate0.height/2, 0, 80)
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if maybe instead of using fixed value like 80 it could be possible to use value derived from delegate height, to make the test more resistant to pure-ui changes like changing delegate's height.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I was also thinking about that... but it's hard, the height can be variable

Copy link
Member Author

Choose a reason for hiding this comment

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

But it's fine imo... if we ever change the delegate height for whatever reason, this test will start failing so we definitely notice

Copy link
Member

Choose a reason for hiding this comment

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

But it's fine imo... if we ever change the delegate height for whatever reason, this test will start failing so we definitely notice

Yea, we will notice but will need to fix. But if it's problematic, than ok, nothing important.

Comment on lines +19 to +20
communityImage: "https://pbs.twimg.com/profile_images/1599347398769143808/C6qG3RQv_400x400.jpg",
imageUrl: "https://i.seadn.io/gae/qPfQjj4P1w0xVQXAmQJLmQ4ZtLFAJU6oiH69Lsny82LFbipLAgXhHKrcLBx2U09SmRnzeHY0ygz-3NIb-JegE_hWrZquFeL-qUPXPdw",
Copy link
Member

Choose a reason for hiding this comment

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

  1. Referring to some external resources is a bit risky, the page may become unavailable, the content may change and copyrights may be violated. So ideally we should refer to some owned resources.
  2. We keep some longer resources in ModelData, maybe putting some images here as base64 would be a solution.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmmm... it's definitely not a (c) violation, it would be if we included it which I didn't want (in order not to bloat the already big sources). True that it might disappear any time bug really not a big deal imo

Copy link
Member

Choose a reason for hiding this comment

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

As you prefer. I'm just pointing out that there is already a certain convention for this type of thing.

@caybro caybro force-pushed the 12379-wallet-token-management-collectibles-tab-ui-panel-poc branch 2 times, most recently from 2d380f7 to 5eb205c Compare November 16, 2023 10:03
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.

LGTM, but please ask @noeliaSD if she wants to review as well before merging :)

Copy link
Contributor

@noeliaSD noeliaSD left a comment

Choose a reason for hiding this comment

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

Hey, I've done a visual / testing review first and meanwhile, I leave some comments / questions.. Following with the code review!

  1. I found some issues with the reordering of the group community and hidding / showing individual community collectibles.
    There isn't a pattern I can define but here there is 1 video where the issue happens. The origin can be, from hide to show or the other way around.
  • Second 8 to 12 --> Group Pandas is in the last position, there's a collectible from this group that we hide, then the group is moved to the top position.

  • Second 20 to 25 --> Group Bearz is on top, there's a collectible from this group that is hidden and we show it, then the group is moved to the last position.

Screen.Recording.2023-11-16.at.16.11.17.mov
  1. Question: Looking at design there's this requirement:

`Arranging by community groups all collectibles into their respective communities:

  • Collections with most collectibles are placed first
  • Collectibles retain their respective order from previous view (we can’t assume the user wants to change respective ordering)`

Following this requirement, I understand that we should always place on top of the groups list, the one that has more collectibles each time the arrenge by community is switched on. Here, I don't see it's done like this, but by using the first collectible found in the flat collectibles list order. See video for better understanding:

Screen.Recording.2023-11-16.at.16.31.11.mov

@caybro
Copy link
Member Author

caybro commented Nov 16, 2023

Hey, I've done a visual / testing review first and meanwhile, I leave some comments / questions.. Following with the code review!

  1. I found some issues with the reordering of the group community and hidding / showing individual community collectibles.
    There isn't a pattern I can define but here there is 1 video where the issue happens. The origin can be, from hide to show or the other way around.
  • Second 8 to 12 --> Group Pandas is in the last position, there's a collectible from this group that we hide, then the group is moved to the top position.
  • Second 20 to 25 --> Group Bearz is on top, there's a collectible from this group that is hidden and we show it, then the group is moved to the last position.

Yeah, I can reproduce, will fix and add a test, thanks! :)

`Arranging by community groups all collectibles into their respective communities:

  • Collections with most collectibles are placed first
  • Collectibles retain their respective order from previous view (we can’t assume the user wants to change respective ordering)`

Following this requirement, I understand that we should always place on top of the groups list, the one that has more collectibles each time the arrenge by community is switched on. Here, I don't see it's done like this, but by using the first collectible found in the flat collectibles list order. See video for better understanding:

So the requirement is that this applies only the first time user enters the screen (before any changes are made); after that, it's the custom order that the user sets. And yeah, it's true that currently we don't (pre)sort the community collectibles that way, can you pls file a separate issue? I'll handle it in the followup PR

Copy link
Contributor

@noeliaSD noeliaSD left a comment

Choose a reason for hiding this comment

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

Code review done!

Overall LGTM, just left some comments / questions!

ui/StatusQ/src/wallet/managetokensmodel.h Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

It'd be nice to have it in storybook!

Copy link
Member Author

Choose a reason for hiding this comment

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

It already is, via both ManageTokensPanel.qml and ManageCollectiblesPanel.qml, doesn't make much sense to have it standalone imo

Copy link
Contributor

Choose a reason for hiding this comment

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

Up to you! May be used in some point in other context!

sourceModel: root.baseModel

mapping: [
RoleRename {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure about that.. Isn't the base model going to have a role called symbol yet? Is / should this uid be the key role to uniqually identify the item?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope, the collectibles model doesn't have a symbol role; uid is our key here

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok so.. uid contains information about the symbol, so we should also keep the key and the symbol. The key(although in the major cases will be == tosymbol value) will uniqualy identify the element as said before!

Copy link
Member Author

Choose a reason for hiding this comment

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

There's no symbol in collectibles

Copy link
Member Author

Choose a reason for hiding this comment

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

So we take the uid as the unique key (aka symbol) :)

@noeliaSD
Copy link
Contributor

So the requirement is that this applies only the first time user enters the screen (before any changes are made); after that, it's the custom order that the user sets. And yeah, it's true that currently we don't (pre)sort the community collectibles that way, can you pls file a separate issue? I'll handle it in the followup PR

Here the task: #12766

@caybro caybro force-pushed the 12379-wallet-token-management-collectibles-tab-ui-panel-poc branch from 5eb205c to 24f1dc1 Compare November 17, 2023 11:03
@caybro caybro requested a review from noeliaSD November 17, 2023 11:07
- implements a QML panel to organize collectibles
- factors out the delegates to separate files to be reusable with the
Assets tab
- adds QML tests to assess the UI functionality (move, show/hide, save/load)
- does not cover the problematic "Arrange by collection" switch (TBD
later)

Fixes: #12379
@caybro caybro force-pushed the 12379-wallet-token-management-collectibles-tab-ui-panel-poc branch from 24f1dc1 to cf4cf90 Compare November 17, 2023 11:18
Copy link
Contributor

@noeliaSD noeliaSD left a comment

Choose a reason for hiding this comment

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

LGTM!! Thanks for addressing the comments!

Tested again and the issue has been solved!!

id: root
objectName: "manageTokensDelegate-%1".arg(index)

// expected roles: symbol, name, communityId, communityName, communityImage, collectionName, imageUrl
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd add a TODO or just a reminder here about these 2 (they are now used but will be dropped/renamed/refactored soon):

  • enabledNetworkBalance
  • enabledNetworkCurrencyBalance

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the review! Added the TODO, will be in the next PR :)

@caybro caybro merged commit ba30afd into master Nov 17, 2023
8 of 9 checks passed
@caybro caybro deleted the 12379-wallet-token-management-collectibles-tab-ui-panel-poc branch November 17, 2023 13:12
friofry added a commit that referenced this pull request May 16, 2024
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.

[Wallet - Token management] Collectibles tab UI panel
5 participants