airmessage-web
airmessage-web copied to clipboard
need an additional scrollToBottom on incoming messages
Thanks for putting this together -- it's awesome!
One annoyance I've noticed: When sending messages, the scrollToBottom calls successfully scroll the div containing messages to the bottom. However, this is not true when you're in an existing chat and receive messages from the other party. For instance:
It would be great if incoming messages would trigger a scrollToBottom event as well. I haven't had the time to dig into the code to put together a PR yet, but I imagine this is a relatively simple fix.
Thanks for opening this issue!
AirMessage for web doesn't call scrollToBottom()
for incoming messages, since if the conversation list is already scrolled to the bottom, the browser should scroll down to reveal any newly added items automatically:
https://user-images.githubusercontent.com/13751213/126004241-c53451a0-2158-4bd4-bcd7-71fa61876466.mov
Is this not the behaviour you're experiencing?
Hi @tagavari!
You're very welcome, and thanks for the reply!
I think I need to clarify my original post: I do experience the behavior you showed in your movie most of the time, but occasionally not.
Sometimes -- perhaps when the airmessage tab has been out of focus, but I'm still confirming -- received messages, along with the first outbound message, will fail to scroll to the bottom as expected.
I'm not able to recreate it at the moment, but I will try to create a video of it once I can show how to reproduce.
EDIT: Here's a demonstration of the issue with incoming messages. It can also occur with outbound messages sent very quickly (before the server has time to update it would seem). Notice in the clip, I'm receiving inbound messages (three in this case), and the scrollbar is moving, but the initial message is cut off, along with all subsequent ones.
To create the situation, I switched between two conversations and also backgrounded the tab briefly (I'm not yet 100% sure what causes it, but I encounter it pretty frequently).
https://user-images.githubusercontent.com/4490587/126012212-4fca1c28-95f2-4106-aaf1-14db621a457f.mp4
i fixed this issue here: https://github.com/Geczy/airmessage-web/commit/c8b26ec49725d37f246945cbf21ee22e110a17e9 feel free to cherry pick !
@Geczy Thanks a lot! I tried this out, but it seems to trigger even if I've scrolled far up in the conversation. Am I missing something?
@Geczy Thanks a lot! I tried this out, but it seems to trigger even if I've scrolled far up in the conversation. Am I missing something?
can you share the branch you tried this in?
nvm i can see this happening in mine too, will think of a fix
okay this commit fixes it for sure https://github.com/Geczy/airmessage-web/commit/5856eb0c42367bb93a14d60a2a553f447762f0e7
Thank you @Geczy, I will try this out later this week!
hi,
I've tried that function, but images are downloaded again-and-again every time I click on the chat. The loading takes 8-10 seconds, and sometimes I get 'Couldn't load this conversation'. It this the normal behaviour? Or should I deploy this repo for myself, and it would be faster?:)