iansinnott / prompta

ChatGPT UI that is keyboard-centric, mobile friendly, and searchable.
https://chat.prompta.dev
MIT License
154 stars 13 forks source link

Prevent unnecessary scrolling to bottom while streaming a response #34

Open struanb opened 7 months ago

struanb commented 7 months ago

When Prompta is streaming a long response, it is currently necessary to wait until the whole response has been streamed before one can begin reading from the top as, despite manually scrolling to the top, the client repeatedly scrolls back down to the bottom with each additional piece of response added.

This is not a show-stopper at all, but it is mildly frustrating as one has to wait until the response is finished before one can start reading (and knowing that one's reading speed is much slower than the speed at which the response is being written, this shouldn't be a problem.

Please arrange that, once the user has manually scrolled up from the bottom, the client will not reset the scroll position as the response is being streamed. This behaviour would be consistent with e.g. Mac OS Terminal.

iansinnott commented 7 months ago

Must be a bug. I added this when first creating prompta but haven't revisited in a while. it also never worked very well (at all?) on mobile safari if I remember correctly. The code in question uses this function: https://github.com/iansinnott/prompta/blob/59a7982c3b7fa376a45a18115fd780eb3c2da12a/src/lib/components/ChatMessageList.svelte#L18

struanb commented 7 months ago

Sorry, should have made clear I'm experiencing this on iOS PWA.

jacksongoode commented 6 months ago

There's definitely a bug. Seeing jumps up and down when code is written.

iansinnott commented 6 months ago

@jacksongoode what platform / os are you on?

jacksongoode commented 6 months ago

macOS 14