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

Refresh control test #19831

Merged
merged 11 commits into from May 9, 2024
Merged

Refresh control test #19831

merged 11 commits into from May 9, 2024

Conversation

mmilad75
Copy link
Contributor

@mmilad75 mmilad75 commented Apr 29, 2024

fixes #19820

UPDATED:

Screen.Recording.2024-05-06.at.19.17.59.mov

Android:

** note that the list of tokens have been tripled manually for test purposes.

Screen.Recording.2024-05-07.at.22.33.17.mov

@status-github-bot status-github-bot bot added this to REVIEW in Pipeline for QA Apr 29, 2024
@status-im-auto
Copy link
Member

status-im-auto commented Apr 29, 2024

Jenkins Builds

Click to see older builds (47)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 71d54e3 #1 2024-04-29 18:31:39 ~7 min tests 📄log
✔️ 71d54e3 #1 2024-04-29 18:33:55 ~9 min ios 📱ipa 📲
✔️ 71d54e3 #1 2024-04-29 18:37:02 ~12 min android-e2e 🤖apk 📲
✔️ 71d54e3 #1 2024-04-29 18:37:08 ~12 min android 🤖apk 📲
✔️ d4646d7 #2 2024-04-30 12:40:57 ~6 min tests 📄log
✔️ d4646d7 #2 2024-04-30 12:43:54 ~9 min ios 📱ipa 📲
✔️ d4646d7 #2 2024-04-30 12:46:27 ~12 min android-e2e 🤖apk 📲
✔️ d4646d7 #2 2024-04-30 12:46:43 ~12 min android 🤖apk 📲
✔️ 23d10cc #3 2024-05-01 12:27:23 ~7 min tests 📄log
✔️ 23d10cc #3 2024-05-01 12:29:44 ~9 min ios 📱ipa 📲
✔️ 23d10cc #3 2024-05-01 12:33:15 ~12 min android-e2e 🤖apk 📲
✔️ 23d10cc #3 2024-05-01 12:33:18 ~12 min android 🤖apk 📲
✔️ 76399af #5 2024-05-02 12:06:40 ~7 min tests 📄log
✔️ 76399af #5 2024-05-02 12:07:32 ~8 min android 🤖apk 📲
✔️ 76399af #5 2024-05-02 12:09:08 ~10 min ios 📱ipa 📲
✔️ 76399af #5 2024-05-02 12:10:15 ~11 min android-e2e 🤖apk 📲
✔️ 86d2978 #6 2024-05-02 13:02:24 ~7 min tests 📄log
✔️ 86d2978 #6 2024-05-02 13:04:56 ~9 min ios 📱ipa 📲
✔️ 86d2978 #6 2024-05-02 13:08:15 ~12 min android-e2e 🤖apk 📲
✔️ 86d2978 #6 2024-05-02 13:10:07 ~14 min android 🤖apk 📲
✔️ 319a601 #7 2024-05-03 12:24:35 ~6 min tests 📄log
✔️ 319a601 #7 2024-05-03 12:30:16 ~12 min ios 📱ipa 📲
✔️ 319a601 #7 2024-05-03 12:30:28 ~12 min android-e2e 🤖apk 📲
✔️ 319a601 #7 2024-05-03 12:30:35 ~12 min android 🤖apk 📲
✔️ 57b1364 #8 2024-05-06 16:06:09 ~6 min tests 📄log
✔️ 57b1364 #8 2024-05-06 16:08:39 ~9 min ios 📱ipa 📲
✔️ 920a198 #9 2024-05-06 16:16:18 ~5 min tests 📄log
✔️ 920a198 #9 2024-05-06 16:19:04 ~8 min android 🤖apk 📲
✔️ 920a198 #9 2024-05-06 16:20:05 ~9 min ios 📱ipa 📲
✔️ 920a198 #9 2024-05-06 16:20:13 ~9 min android-e2e 🤖apk 📲
✔️ ef0d376 #10 2024-05-06 17:25:38 ~5 min tests 📄log
✔️ ef0d376 #10 2024-05-06 17:28:06 ~8 min android-e2e 🤖apk 📲
✔️ ef0d376 #10 2024-05-06 17:29:07 ~9 min android 🤖apk 📲
✔️ ef0d376 #10 2024-05-06 17:29:16 ~9 min ios 📱ipa 📲
✔️ cb94709 #11 2024-05-07 19:10:40 ~5 min tests 📄log
✔️ cb94709 #11 2024-05-07 19:13:38 ~8 min android 🤖apk 📲
✔️ cb94709 #11 2024-05-07 19:14:00 ~9 min android-e2e 🤖apk 📲
✔️ cb94709 #11 2024-05-07 19:14:17 ~9 min ios 📱ipa 📲
✔️ 6899ccb #12 2024-05-08 09:40:25 ~7 min tests 📄log
✔️ 6899ccb #12 2024-05-08 09:43:01 ~10 min android 🤖apk 📲
✔️ 6899ccb #12 2024-05-08 09:43:39 ~11 min ios 📱ipa 📲
✔️ 6899ccb #12 2024-05-08 09:44:17 ~11 min android-e2e 🤖apk 📲
✔️ bdb3f47 #13 2024-05-08 21:17:48 ~7 min tests 📄log
✔️ bdb3f47 #13 2024-05-08 21:23:02 ~12 min android-e2e 🤖apk 📲
✔️ bdb3f47 #13 2024-05-08 21:23:11 ~12 min ios 📱ipa 📲
✔️ bdb3f47 #13 2024-05-08 21:23:13 ~12 min android 🤖apk 📲
✔️ 5194cc4 #14 2024-05-09 12:48:20 ~7 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ be2d405 #16 2024-05-09 12:56:01 ~4 min tests 📄log
✔️ be2d405 #16 2024-05-09 12:57:13 ~6 min android-e2e 🤖apk 📲
✔️ be2d405 #16 2024-05-09 13:00:21 ~9 min android 🤖apk 📲
✔️ be2d405 #16 2024-05-09 13:00:42 ~9 min ios 📱ipa 📲
✔️ 96c8e5e #17 2024-05-09 13:48:54 ~7 min tests 📄log
✔️ 96c8e5e #17 2024-05-09 13:53:17 ~11 min ios 📱ipa 📲
✔️ 96c8e5e #17 2024-05-09 13:54:23 ~12 min android-e2e 🤖apk 📲
✔️ 96c8e5e #17 2024-05-09 13:54:33 ~12 min android 🤖apk 📲

@mmilad75 mmilad75 marked this pull request as ready for review April 30, 2024 12:33
{:refresh-control (reagent/as-element
[rn/refresh-control
{:refreshing (and tokens-loading? init-loaded?)
:colors colors/neutral-40
Copy link
Member

Choose a reason for hiding this comment

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

should these colors be themed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I couldn't find the design for dark theme, so I used this for both, and it looked visible and good

:on-change #(set-selected-tab %)}]
[tabs/view {:selected-tab selected-tab}]]))
[rn/scroll-view
{:refresh-control (reagent/as-element
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 can we abstract this as-element away?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed it but I got errors. @ulisesmac added this and I kept it.

Copy link
Member

Choose a reason for hiding this comment

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

Im not saying to remove it, I mean to abstract it away so we don't need to add this method each time we use the pull to refresh, there is many other uses of pull to refresh in the designs so it's nice to take steps like this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, right. We can create a new refresh-control component and add this there

Copy link
Member

Choose a reason for hiding this comment

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

nice yeah that sounds good to me!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -0,0 +1,11 @@
(ns quo.components.scroll-view.view
Copy link
Member

Choose a reason for hiding this comment

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

nit: maybe refreshable-scroll-view?
or add some description of what is different from regular ScrollView

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@briansztamfater
Copy link
Member

briansztamfater commented May 2, 2024

I think it is a UX redundancy to show the activity loading indicator and the whole screen loading skeleton while refreshing. IMO the loading skeleton should only be shown the first time because there is no data to show at that time, for refreshing we could just should the activity indicator from refresh control component.

@mmilad75
Copy link
Contributor Author

mmilad75 commented May 2, 2024

I think it is a UX redundancy to show the activity loading indicator and the whole screen loading skeleton while refreshing. IMO the loading skeleton should only be shown the first time because there is no data to show at that time, for refreshing we could just should the activity indicator from refresh control component.

When trying to re-fetch the accounts using :wallet/get-accounts, the accounts balance and other props will be reset and will be 0 in the ui. If we want to skip resetting them, it will require more job. While, @J-Son89 suggested me to do the ticket with minimal changes and efforts. I think it's better to show both the loading indicator and the loading status of the accounts for now.

@briansztamfater
Copy link
Member

I think it is a UX redundancy to show the activity loading indicator and the whole screen loading skeleton while refreshing. IMO the loading skeleton should only be shown the first time because there is no data to show at that time, for refreshing we could just should the activity indicator from refresh control component.

When trying to re-fetch the accounts using :wallet/get-accounts, the accounts balance and other props will be reset and will be 0 in the ui. If we want to skip resetting them, it will require more job. While, @J-Son89 suggested me to do the ticket with minimal changes and efforts. I think it's better to show both the loading indicator and the loading status of the accounts for now.

Sounds good, maybe we should confirm with the design team if they are okay with this behavior for our release or if we need a follow up issue for prioritize and implement in the future.

@mmilad75
Copy link
Contributor Author

mmilad75 commented May 3, 2024

I think it is a UX redundancy to show the activity loading indicator and the whole screen loading skeleton while refreshing. IMO the loading skeleton should only be shown the first time because there is no data to show at that time, for refreshing we could just should the activity indicator from refresh control component.

When trying to re-fetch the accounts using :wallet/get-accounts, the accounts balance and other props will be reset and will be 0 in the ui. If we want to skip resetting them, it will require more job. While, @J-Son89 suggested me to do the ticket with minimal changes and efforts. I think it's better to show both the loading indicator and the loading status of the accounts for now.

Sounds good, maybe we should confirm with the design team if they are okay with this behavior for our release or if we need a follow up issue for prioritize and implement in the future.

I checked with the design team and they approved it (https://discord.com/channels/624634427930312714/928625369542713396/1235661790109503589). But they asked for replacing the default spinner with the one in the designs. However, @J-Son89 suggested me to skip it since it will take time

Copy link
Member

@OmarBasem OmarBasem 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, but VirtualizedLists (FlatLists) should never be nested inside plain ScrollViews.

The component needs to be a FlatList where the assets items are the data and the rest of the components above it are the FlatList header

FYI, when nesting FlatList inside a ScrollView, the FlatList optimizations regarding rendering children will not be applied and will be treated as a ScrollView. (also you should be getting a warning from react-native in metro about this)

@mmilad75
Copy link
Contributor Author

mmilad75 commented May 3, 2024

Looks nice, but VirtualizedLists (FlatLists) should never be nested inside plain ScrollViews.

The component needs to be a FlatList where the assets items are the data and the rest of the components above it are the FlatList header

FYI, when nesting FlatList inside a ScrollView, the FlatList optimizations regarding rendering children will not be applied and will be treated as a ScrollView

The data in the scroll view has different render options
In these cases, it should be scroll view
And besides that, @ulisesmac had started this component, and he used scroll view
I don't think it's a good idea to go with FlatList

Copy link
Member

@briansztamfater briansztamfater 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 for me, FlatList is horizontal to display account cards so I think it is fine to use ScrollView

@OmarBasem
Copy link
Member

Looks good for me, FlatList is horizontal to display account cards so I think it is fine to use ScrollView

The problem is not the account cards. We have the ScrollView is vertical and the assets list is vertical.

@OmarBasem
Copy link
Member

OmarBasem commented May 6, 2024

Looks nice, but VirtualizedLists (FlatLists) should never be nested inside plain ScrollViews.
The component needs to be a FlatList where the assets items are the data and the rest of the components above it are the FlatList header
FYI, when nesting FlatList inside a ScrollView, the FlatList optimizations regarding rendering children will not be applied and will be treated as a ScrollView

The data in the scroll view has different render options In these cases, it should be scroll view And besides that, @ulisesmac had started this component, and he used scroll view I don't think it's a good idea to go with FlatList

@mmilad75 as I discussed with you earlier using a FlatList inside a ScrollView will render the FlatList optimizations useless, consume more RAM, and have a negative effect on the scrolling performance with large lists:

https://stackoverflow.com/a/55256341.

https://reactnative.dev/docs/performance#listview-initial-rendering-is-too-slow-or-scroll-performance-is-bad-for-large-lists.

We plan to make the wallet home our landing page, so let's not rush into a sub-optimal solution. We can discuss this further with other devs.

cc @J-Son89 @ulisesmac

@@ -0,0 +1,11 @@
(ns quo.components.refreshable-scroll-view.view
Copy link
Member

Choose a reason for hiding this comment

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

Quo components should really be only things related to the design system file.

Imo this seems better to have in status-im.common... ns

@mmilad75
Copy link
Contributor Author

mmilad75 commented May 6, 2024

Looks nice, but VirtualizedLists (FlatLists) should never be nested inside plain ScrollViews.
The component needs to be a FlatList where the assets items are the data and the rest of the components above it are the FlatList header
FYI, when nesting FlatList inside a ScrollView, the FlatList optimizations regarding rendering children will not be applied and will be treated as a ScrollView

The data in the scroll view has different render options In these cases, it should be scroll view And besides that, @ulisesmac had started this component, and he used scroll view I don't think it's a good idea to go with FlatList

@mmilad75 as I discussed with you earlier using a FlatList inside a ScrollView will render the FlatList optimizations useless, consume more RAM, and have a negative effect on the scrolling performance with large lists:

https://stackoverflow.com/a/55256341.

https://reactnative.dev/docs/performance#listview-initial-rendering-is-too-slow-or-scroll-performance-is-bad-for-large-lists.

We plan to make the wallet home our landing page, so let's not rush into a sub-optimal solution. We can discuss this further with other devs.

cc @J-Son89 @ulisesmac

I have converted it (not pushed yet), and the result will be like this. Is this acceptable?

Screen_Recording_2024-05-03_at_17.12.16.mov

@OmarBasem
Copy link
Member

I have converted it (not pushed yet), and the result will be like this. Is this acceptable?

Looks good @mmilad75!

I think we can move the bar at the top that has the total balance out of the list header and it would be good. Wdyt @J-Son89 ?

Also, I think it was said that we will remove the graph @J-Son89 ?

@qoqobolo qoqobolo self-assigned this May 8, 2024
@qoqobolo qoqobolo moved this from E2E Tests to IN TESTING in Pipeline for QA May 8, 2024
@qoqobolo
Copy link
Contributor

qoqobolo commented May 8, 2024

Hi @mmilad75 , nice job, thank you!
Take a look at the issue below please:

ISSUE 1: Assets order changes every time when you refresh the page

IMG_4690.MP4

@mmilad75
Copy link
Contributor Author

mmilad75 commented May 8, 2024

Hi @mmilad75 , nice job, thank you! Take a look at the issue below please:

ISSUE 1: Assets order changes every time when you refresh the page

IMG_4690.MP4

The order is not handled on the front end side. I don't think there is anything we can do about it. Backend side should fix it. @qoqobolo

cc @J-Son89 Please correct me if I'm wrong

@OmarBasem
Copy link
Member

Hi @mmilad75 , nice job, thank you! Take a look at the issue below please:

ISSUE 1: Assets order changes every time when you refresh the page

IMG_4690.MP4

The order is not handled on the front end side. I don't think there is anything we can do about it. Backend side should fix it. @qoqobolo

cc @J-Son89 Please correct me if I'm wrong

We can handle the ordering on the front end if we want to. But is this change of ordering after refresh happening on this branch only?

@qoqobolo
Copy link
Contributor

qoqobolo commented May 8, 2024

But is this change of ordering after refresh happening on this branch only?

Ah you're right! It's also happening on develop when I reopen the app, I just didn't pay attention to it before tbh.
Sorry for the false alarm then @OmarBasem @mmilad75, please ignore that issue!
I'll continue testing tomorrow.

@qoqobolo
Copy link
Contributor

qoqobolo commented May 8, 2024

We can handle the ordering on the front end if we want to.

So according to design, it looks like we should control the order: from larger to smaller amount of tokens, I guess

Screenshot 2024-05-08 at 21 19 02

Which doesn't happen now

Screenshot 2024-05-08 at 21 24 33

But this is an issue that should be logged separately (if it hasn't been already), and I'm not sure about the priority.
@J-Son89 just let me know if we want to include it in the scope

@J-Son89
Copy link
Member

J-Son89 commented May 8, 2024

Thanks @qoqobolo - let's keep this separate!
It should be fine for someone to take provided there is no more high priority bugs.
We are very close to finishing feature development of the wallet for 2.30 release (July).
So beyond a few feature prs we are mostly focusing on bugs and polishing details such as this :)

@qoqobolo
Copy link
Contributor

qoqobolo commented May 9, 2024

Everything looks good to me, thanks for your work @mmilad75!
PR can be merged.

@qoqobolo qoqobolo moved this from IN TESTING to MERGE in Pipeline for QA May 9, 2024
@mmilad75 mmilad75 merged commit 14aa9e1 into develop May 9, 2024
6 checks passed
Pipeline for QA automation moved this from MERGE to DONE May 9, 2024
@mmilad75 mmilad75 deleted the refresh-control-test branch May 9, 2024 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

Wallet: Pull to refresh - Home Page
7 participants