Closed rubenquadros closed 1 month ago
I think the general approach looks reasonable, but it really needs to be able to live inside the top-level CommentsPage
composable and not leak mutable mutable state belonging to that screen into the CommentNode
file.
I think this current version works pretty well, but the scroll position goes completely out of whack when collapsing a comment. Go to any post with a comment tree that has 4-5 nested items and try to collapse the topmost parent, you get scrolled way up far away from where you started.
I don't have a surefire solution at the moment, triggering a delayed scroll back to the comment which was collapsed might be worth looking into but I'm not sure if it's possible.
I think this current version works pretty well, but the scroll position goes completely out of whack when collapsing a comment. Go to any post with a comment tree that has 4-5 nested items and try to collapse the topmost parent, you get scrolled way up far away from where you started.
I don't have a surefire solution at the moment, triggering a delayed scroll back to the comment which was collapsed might be worth looking into but I'm not sure if it's possible.
Yeah i see that. Should be good with AnimatedVisibility
.
Oh can you update the title? If not then I'll do it tomorrow
I found a bug while testing, with these changes I can only collapse the topmost comments and not ones under them which works correctly on the main
branch. Can you take a look?
I found a bug while testing, with these changes I can only collapse the topmost comments and not ones under them which works correctly on the
main
branch. Can you take a look?
Yeah i found the issue. Because when updating the expanded/collapsed state I only do it in the parent. I will have to check for the shortId
in the children as well. See the updateListNode
function.
I found a bug while testing, with these changes I can only collapse the topmost comments and not ones under them which works correctly on the
main
branch. Can you take a look?Yeah i found the issue. Because when updating the expanded/collapsed state I only do it in the parent. I will have to check for the
shortId
in the children as well. See theupdateListNode
function.
Do you wanna try to fix that? If not I can merge this as-is and fix it later myself.
I found a bug while testing, with these changes I can only collapse the topmost comments and not ones under them which works correctly on the
main
branch. Can you take a look?Yeah i found the issue. Because when updating the expanded/collapsed state I only do it in the parent. I will have to check for the
shortId
in the children as well. See theupdateListNode
function.Do you wanna try to fix that? If not I can merge this as-is and fix it later myself.
Yeah maybe a different MR all together. I'm not getting any elegant solution at the moment :P
I've fixed the bug with child comments so everything works perfectly now, thanks again for your PR!
Remember the comment expanded/collapsed state when scrolling. Previously, the state was remembered inside the
Node
composable. When the users scroll, andNode
re-composes, the state was being reset.In this commit, we add the collapsed state into the
CommentNode
. This makes sure that the state is retained even when the UI is re-composed.Fixes #651