-
Notifications
You must be signed in to change notification settings - Fork 86
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
Improve list updates #522
Improve list updates #522
Conversation
…ssage list changes in specific cases
3cff593
to
e487386
Compare
…ot rediplay it when text changes
let message: ChatMessage | ||
private let adjustedText: String | ||
|
||
init(message: ChatMessage) { | ||
self.message = message | ||
adjustedText = message.adjustedText | ||
} |
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.
I don't know why exactly but SwiftUI does not redisplay the view when message.adjustedText
changes. Did a workaround fix here.
Case of editing an existing message.
Sources/StreamChatSwiftUI/ChatChannel/ChatChannelViewModel.swift
Outdated
Show resolved
Hide resolved
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.
I think we should limit it to these changes and any possible bug fixes.
…iftui into list-improvements
…am-chat-swiftui into list-improvements
Sources/StreamChatSwiftUI/ChatChannel/MessageList/MessageIdBuilder.swift
Show resolved
Hide resolved
message.reactionScoresId != messages[index.row].reactionScoresId | ||
&& utils.messageListConfig.messageDisplayOptions.shouldAnimateReactions | ||
) { | ||
&& animateReactions { |
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.
Reverted the extra animation of reactions, didn't look good after all.
This reverts commit 85eca88.
…geAppear requires it to be set
scrolledId = nil | ||
return true | ||
} | ||
let alreadyLoaded = messages.map(\.id).contains(baseId) | ||
if alreadyLoaded && baseId != messageId { |
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.
Removed this check since before it was always the case, baseId was never equal to messageId
@martinmitrevski I have been testing message list quite a bit today and there seems to be separate issue with jumping to a message. It is also not working correctly in develop. Therefore, I am proposing limiting changes in this PR to the ones we have and I will work in a separate PR to fix jump to message (it seems that scroll id is not used as it should be). e.g. if I change the limit to 50 in ChatChannelDataSource.swift:147 then it is visible that after jumping, view is scrolled to the last loaded message, not to the middle message what should happen when jumping to the unread message. Steps:
|
Quality Gate passedIssues Measures |
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.
LGTM ✅
🔗 Issue Link
Resolves PBE-4291
🎯 Goal
Smoother and more performant channel and message list updates
🛠 Implementation
messageId
change)🧪 Testing
Smoke testing of channel and message list (e.g. what we do for regression testing)
☑️ Checklist