Skip to content

Fix Threads list stuttering#7070

Open
bxdxnn wants to merge 6 commits into
element-hq:developfrom
bxdxnn:fix/thread-list-stutter
Open

Fix Threads list stuttering#7070
bxdxnn wants to merge 6 commits into
element-hq:developfrom
bxdxnn:fix/thread-list-stutter

Conversation

@bxdxnn

@bxdxnn bxdxnn commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Content

Optimize Threads list:

  • Paginate using the diffs from SDK so that we won't call timelineItemContentFactory.create() on every row again when paginating
  • Move item processing out of the main thread to fix animation stuttering
  • Minor fix in ThreadsListView.kt to fix the effect restarting on every scroll frame
  • Check the Threads availability in the view so that we can show the top bar icon instantly by just checking the feature flag, then show a hint text in the view if there are no threads available. Also improves UX/discoverability (when we roll-out this and the whole Threads feature) IMO, though maybe needs a product decision, but since this is behind a feature flag I guess it's OK.

Motivation and context

Fix the stuttering in the Threads list on opening/scrolling, along with other delays (huge especially on slow network/device).

Screenshots / GIFs

Tests

  • Open Threads list and scroll it, should be much smoother now.

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • I am aware of the etiquette.
  • This PR was made with the help of AI:
    • Yes. In this case, please request a review by Copilot.
    • No.
  • Changes have been tested on an Android device or Android emulator with API 24
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly defines what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • You've made a self review of your PR

@bxdxnn bxdxnn requested a review from a team as a code owner June 21, 2026 21:14
@bxdxnn bxdxnn requested review from bmarty and removed request for a team June 21, 2026 21:14
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Here are a few things to check in the PR to ensure it's reviewed as quickly as possible:

  • If your pull request adds a feature or modifies the UI, this should have an equivalent pull request in the Element X iOS repo unless it only affects an Android-only behaviour or is behind a disabled feature flag, since we need parity in both clients to consider a feature done. It will also need to be approved by our product and design teams before being merged, so it's usually a good idea to discuss the changes in a Github issue first and then start working on them once the approach has been validated.
  • Your branch should be based on origin/develop, at least when it was created.
  • The title of the PR will be used for release notes, so it needs to describe the change visible to the user.
  • The test pass locally running ./gradlew test.
  • The code quality check suite pass locally running ./gradlew runQualityChecks.
  • If you modified anything related to the UI, including previews, you'll have to run the Record screenshots GH action in your forked repo: that will generate compatible new screenshots. However, given Github Actions limitations, it will prevent the CI from running temporarily, until you upload a new commit after that one. To do so, just pull the latest changes and push an empty commit.

@github-actions github-actions Bot added the Z-Community-PR Issue is solved by a community member's PR label Jun 21, 2026

@bmarty bmarty left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR!

I have tested the feature and it's working well.

For the new empty view, I let @mxandreas / @americanrefugee confirm that this is what we want, or provide an alternative design / wording if necessary. The threads icon will be always displayed and in case there are no threads in the room, this view will be displayed:

Image

Thanks!

@jmartinesp jmartinesp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A couple of comments about the changes. Also, if we want to have an empty screen, it might make sense to use an AsyncData wrapper for the thread list, and check whether its dataOrNull() value contains something instead of creating a new variable and exposing it in the state. There are several examples of this in the app.

@bxdxnn

bxdxnn commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

I've reverted the delay optimization as it's too complicated to do it properly ATM, something like matrix-org/matrix-spec-proposals#4360 is needed for it to work fast and correct but it seems to be WIP (?) and doesn't have an implementation yet.

@bxdxnn

bxdxnn commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@bmarty FYI product/deisgn decision isn't required anymore as I've reverted the new screen/UX thing.

@bxdxnn

bxdxnn commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Test failures doesn't seems to be related...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Z-Community-PR Issue is solved by a community member's PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants