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] #3627

Merged

Conversation

saleniuk
Copy link
Contributor

@saleniuk saleniuk commented Nov 13, 2024

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.

@codecov-commenter
Copy link

Codecov Report

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

Project coverage is 45.35%. Comparing base (0390bbf) to head (b0708b3).
Report is 1 commits behind head on release/candidate.

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                  @@
##           release/candidate    #3627      +/-   ##
=====================================================
- Coverage              45.36%   45.35%   -0.01%     
=====================================================
  Files                    471      471              
  Lines                  15843    15845       +2     
  Branches                2655     2655              
=====================================================
  Hits                    7187     7187              
- Misses                  7883     7885       +2     
  Partials                 773      773              
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 0390bbf...b0708b3. Read the comment docs.

Copy link
Contributor

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

Copy link
Contributor

@m-zagorski m-zagorski left a comment

Choose a reason for hiding this comment

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

works great!

@saleniuk saleniuk added this pull request to the merge queue Nov 14, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 14, 2024
@saleniuk saleniuk added this pull request to the merge queue Nov 14, 2024
Merged via the queue into release/candidate with commit 4e756ae Nov 14, 2024
13 of 14 checks passed
@saleniuk saleniuk deleted the fix/blank-conversations-page-wrong-lazyliststates branch November 14, 2024 09:52
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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