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

fix: blank lists or flickering on Home Destinations - wrong lazyListStates [WPB-14276] 🍒 #3633

Merged

Conversation

github-actions[bot]
Copy link
Contributor

This PR was automatically cherry-picked based on the following PR:

Original PR description:


BugWPB-14276 [Android] Conversation screen is not visible when navigating between screens


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

When we navigate around screens sometimes the conversations are not visible until we scroll the list manually.
It looks like there are three different scenarios:
-the full list disappears for a moment when navigating back
-the list blinks quickly and then again blinks quickly when scrolling
-the list doesn't blink but then it disappears when scrolling

Causes (Optional)

Each scrollable screen from "home" graph in theory has its own LazyListState, but each view for its own purposes gets it through the currentLazyListState. Now, when app executes navigation and changes the currentNavigationItem, if the screen that's being closed still needs to recompose during the transition animation or quickly before that, then it again gets the LazyListState for itself using currentLazyListState but now it returns the LazyListState for the new screen that's being navigated to, because currentNavigationItem is already changed, so it recomposes with wrong LazyListState.

Solutions

Make each screen in the "home" graph to always and only use its dedicated LazyListState.

Thanks to that, it's finally possible to make HomeStateHolder not being remembered with key currentNavigationItem thus recreated each time the app navigates, but instead there is only one instance of it remembered and the same one is used in each screen from "home" graph.

Testing

How to Test

  • Open navigation drawer
  • Open settings
  • Open account details
  • Get back to conversation list

Attachments (Optional)

Before After
Screen_recording_20241113_151711.mp4
fixed.mp4

PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@github-actions github-actions bot added cherry-pick PR is cherry-picking changes from another banch size/XS labels Nov 14, 2024
@saleniuk saleniuk requested review from a team, m-zagorski, borichellow, MohamadJaara, vitorhugods and mathias-niboulies and removed request for a team November 14, 2024 09:57
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 46.00%. Comparing base (46fabe7) to head (331f87c).

Files with missing lines Patch % Lines
...kotlin/com/wire/android/ui/home/HomeStateHolder.kt 0.00% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3633      +/-   ##
===========================================
- Coverage    46.00%   46.00%   -0.01%     
===========================================
  Files          473      473              
  Lines        16074    16076       +2     
  Branches      2660     2660              
===========================================
  Hits          7395     7395              
- Misses        7898     7900       +2     
  Partials       781      781              
Files with missing lines Coverage Δ
...kotlin/com/wire/android/ui/home/HomeStateHolder.kt 0.00% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 46fabe7...331f87c. Read the comment docs.

Copy link
Contributor Author

Built wire-android-staging-compat-pr-3633.apk is available for download

Copy link
Contributor Author

Built wire-android-dev-debug-pr-3633.apk is available for download

@saleniuk saleniuk enabled auto-merge November 14, 2024 14:12
@echoes-hq echoes-hq bot added the echoes: product-roadmap/bug Work contributing to resolve a bug not critical enough to have raised an incident. label Nov 14, 2024
@saleniuk saleniuk added this pull request to the merge queue Nov 15, 2024
Merged via the queue into develop with commit 59e5fec Nov 15, 2024
11 of 12 checks passed
@saleniuk saleniuk deleted the fix/blank-conversations-page-wrong-lazyliststates-cherry-pick branch November 15, 2024 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick PR is cherry-picking changes from another banch echoes: product-roadmap/bug Work contributing to resolve a bug not critical enough to have raised an incident. size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants