-
Notifications
You must be signed in to change notification settings - Fork 96
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
Jumping to an unread message did not keep scroll location #534
Conversation
@@ -230,8 +230,8 @@ public struct MessageListView<Factory: ViewFactory>: View, KeyboardReadable { | |||
} else if diff < 0 && scrollDirection == .down { | |||
scrollDirection = .up | |||
} | |||
utils.messageCachingUtils.scrollOffset = offsetValue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we had an issue where if you scroll extra slowly, the scroll direction argument in the view model is incorrect. Makes the check for load more older/newer messages incorrect in the view model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's still one issue here - when you mark unread an older message (e.g. unread count > 30), and you come back, sometimes it marks the chat as read.
dbb9afa
to
e8bfae0
Compare
543a51b
to
ebe8904
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well now ✅
🔗 Issue Link
Resolves PBE-5003
🎯 Goal
Fix an issue where scroll location was not kept after jumping to a message
🛠 Implementation
Note: In general, the ChatChannelViewModel would benefit from the state layer API a lot since then we would not have cases where we call load more messages, wait for completion handler AND then also need to wait when the delegate callback comes (delay comes from database observer).
🧪 Testing
Chewbacca has some test channels useful here.
Verification checks
Case 1: Jumping to unread message
Case 2: Jumping to some other message
🎨 Changes
I marked the message "A" as unread.
☑️ Checklist