Reduce recompositions in the comments#1979
Merged
Merged
Conversation
dessalines
approved these changes
Oct 3, 2025
dessalines
left a comment
Member
There was a problem hiding this comment.
What a weird hidden behavior.... Its probably a good practice then to always create new composables whenever padding is used.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Well I have reduced the recompositions in the comments, it no longer recomposes while it scrolls.
Cause was the topbar, the padding constantly changes, by moving the body into a separate composable I create a new "root" composable, This composable skips recompositions due to its params never changing. Before it everytime it would recreate everything below when the padding changed. It would recreate the commentsTreeList, the lambda, ... bc of that those comments all had changed params. and thus the whole tree down recomposed.
As you can see from the video when you do any action though, it fully recomposes the entire comments. To achieve only the vote itself recomposing, it would need to refactored to use something similar like we did for the postfeed. But thats too much work for now. Cuz currently it creates a new list each time an actions happens upon the comments. Thus they arent equal anymore.
Sadly this did not end up fixing #1711
So there is still something else going on that makes those images pop in and pop out constantly.
before (whole tree recomposes on every scroll)
eROqbNoO0l.mp4
after (only the pulldownrefresh recomposes because padding changes, and mainbody skips every recompose)
studio64_KtNoOoh3X8.mp4