Hi am trying to create an application that has a chat feature in Rails 7.
I am using the pagy gem for lazy loading. When I implement this so that the results appear on top and the additional items are added on the bottom, all seems to work.
However, the expected behaviour of a chat feature is that the message would be added at the bottom and that as you scroll up the additional items would be added in the order newest to oldest above.
I have seen implementations of this, but was not able to get them working in my application.
I have made a test version of this here:
https://github.com/ie-inertia/tester
I would like the newest message to appear at the bottom of the screen and all additional messages to be added when I scroll up in the box. Any idea how to do this?