-
Notifications
You must be signed in to change notification settings - Fork 450
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
fix(MessagesList): fix resizeObserver and scrolledToBottom state update #14327
base: main
Are you sure you want to change the base?
Conversation
Could you explain the change? |
4729338
to
b6dcc12
Compare
@@ -932,24 +934,25 @@ export default { | |||
return | |||
} | |||
|
|||
this.setChatScrolledToBottom(false) |
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.
After swtiching to conversation, handleScroll is triggered. Regardless of container height, it sets value to false (whereas it shouldn't for non-scrollable chats)
For scrollable chats it also shouldn't set to false, when receiiving message (handleScroll is triggered with 'down' direction)
For just opened chats, however, it should still set to 'false', if chat is not at the bottom (we know that from previous 'if' block'
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.
Sthg is wrong, chat is sticky when document is not focused and it scrolls to bottom
b6dcc12
to
b38f22a
Compare
- covered by hard update of list in messagesList watcher Signed-off-by: Maksim Sukharev <[email protected]>
Signed-off-by: Maksim Sukharev <[email protected]>
… scroll up Signed-off-by: Maksim Sukharev <[email protected]>
Signed-off-by: Maksim Sukharev <[email protected]>
62f0414
to
3f15670
Compare
Rebased, see last 3 commits:
|
… actual scroll up, or chat is opened not at the bottom Signed-off-by: Maksim Sukharev <[email protected]>
- text messages already covered in postNewMessage - this fix is for file shares (we wait for server response to replace local temp messages) Signed-off-by: Maksim Sukharev <[email protected]>
3f15670
to
0d2ea65
Compare
const tempMessages = context.getters.getTemporaryReferences(token, message.referenceId) | ||
tempMessages.forEach(tempMessage => { | ||
context.commit('deleteMessage', { token, id: tempMessage.id }) | ||
}) | ||
if (tempMessages.length > 0) { |
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.
// If successful, deletes the temporary message from the store context.dispatch('removeTemporaryMessageFromStore', { token, id: temporaryMessage.id })
temp message is removed before processing the message in postNewMessage
Also, processMessage
in multiple points, I wouldn't risk updating the last read message there. As suggested before, it should rather focus on post new message only. What's odd is that the current addition already exists there but it wasn't working efficiently
https://github.com/nextcloud/spreed/blob/main/src/store/messagesStore.js#L1276-L1291
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.
it exists and works for text messages only. File share (with /without caption) is a one-way, a we will receive a feedback only from message polling
postNewMessage can do it, as we receive a message object as a response and can replace it safely
☑️ Resolves
setChatScrolledToBottom(false)
should be only set on scroll up (if we're scrolling down. it should be already set)🖌️ UI Checklist
🖼️ Screenshots / Screencasts
🏡 After
2025-02-10_09h13_03.mp4
🔬 Test
:key
:🏁 Checklist