Open RenanLukas opened 1 year ago
I investigated it for a bit and I think the problem might be in the CardsAdapter
Diff check. The update
function below is called multiple times too fast, so not sure if the dispatchUpdatesTo
function is being called way too often and too close to each other, causing issues in the instructions to update the list state.
Also, the DashboardCardsDiffUtil
doesn't seem to be doing a good job of checking if items are the same, which could also be contributing to the issue (many of those items hold references to anonymous functions and not all are data classes
so this could be causing issues when checking with ==
).
I did a quick test to introduce some 500ms debouncing (throwaway code)in the update
function and the issue went away, which means the problem is definitely related to what I said above.
Not sure if it's the same kind of flickering, but I get some flickering due to the "View all responses" text wrapping and not wrapping. I do find it a bit distracting and lowers the perceived quality since it's on the main screen without having to scroll. Can we elevate its priority?
Here's a video from my phone, flickering without having to switch sites, just by returning to the home screen:
@hypest I believe the flickering that @RenanLukas is referring to is the card disappearing/reappearing a few times before "stabilizing" and staying on screen. But I've also seen the behavior you are describing before and it's VERY distracting.
I believe the root cause is similar (multiple update
calls) but there are probably other ways of fixing this visual text-wrapping bug without having to dive deep into the DiffUtil
and dashboard update logic, which seems to be a bigger effort and might affect other cards.
Do you think we should open a different ticket for that text-wrapping flickering or just include it as part of this one and raise its priority?
Hey @thomashorta, thanks for checking this out! Feel free to move the text-wrapping issue in a separate ticket 👍
Expected behavior
There is no flickering on the prompt card while switching sites.
Actual behavior
There is some flickering on the prompt card while switching sites.
Steps to reproduce the behavior
1 - Install Jetpack and log in; 2 - Select a site that is a blog (which means the prompt card will be shown on "My Site" -> "HOME"); 3 - Observe the dashboard: prompt card should be shown; 4 - Select a site that is not a blog (prompt card not shown); 5 - Select a site that is a blog and observe: there's some flickering with the prompt card (and also with the label next to the avatars after the card is loaded); 6 - Select a site that is not a blog again: there's some flickering that appears to happen when trying to hide the prompt card.
Tested on emulator, Android 12, WPAndroid 21.6