Closed msfjarvis closed 2 months ago
Hey there! Can you provide a bit more context? This is my first time coming across this app! The users should be able to expand/collapse a comment? And when scrolling this state should be retained? Okay I installed the apk.. So you do not retain the collapsed/expanded state when the user scrolls and you would want to do so but without introducing any jank/jumpiness?
Pretty much, yeah. You can probably try to implement this via hoisting a list of expanded/collapsed comment IDs at the screen level but if I remember correctly it introduces jumpiness into the scrolling because of the layout size changing on the fly.
Hmmm let me give it a try!
Quick question - why is CommentNode
a class? Can it be a data class? I have made some changes and it seems to work for me. I can raise a MR and we can discuss on that.
Quick question - why is
CommentNode
a class? Can it be a data class? I have made some changes and it seems to work for me. I can raise a MR and we can discuss on that.
It can be a data class
, there are no API stability considerations here. Feel free to raise the PR, I'm around for the next couple hours to review.
There is an unwanted side-effect because of the implementation. You can checkout the draft MR and also the commit message and we can brainstorm on how to solve it. https://github.com/msfjarvis/compose-lobsters/pull/673
Since the fix for #584 landed we no longer retain the collapsed state of individual comments which eliminates the jumpiness during rendering by always rendering expanded comments. It might be useful to find a way of remembering collapsed comments without reintroducing that problem.