Skip to content
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

Add settings to disable autoscroll during reply #3815

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

movalex
Copy link

@movalex movalex commented Jan 10, 2024

Regarding #3324 and #3780
Auto-scroll is enabled by default, but now you can disable scrolling during GPT reply.

Current behavior: scrolling always enabled, so on a small screen the text scrolls too fast to be readable.
What's changed: With Autoscroll Message disabled, the generation would continue beyond the screen, while you can read and scroll the text as you'd like. Ideally would be better to stop the scrolling by dragging up/down. But I guess this also works.

Please also check the menu translation, I've just asked GPT to translate those.

@movalex movalex changed the title use config to drive autoscroll state Add settinngs to disable autoscroll during reply Jan 10, 2024
@movalex movalex changed the title Add settinngs to disable autoscroll during reply Add settings to disable autoscroll during reply Jan 10, 2024
@m0rg5
Copy link

m0rg5 commented Feb 7, 2024

This behaviour persists in latest 2.10.3, mac m1 Sonoma 14.2.1

@movalex
Copy link
Author

movalex commented Feb 7, 2024

This behaviour persists in latest 2.10.3, mac m1 Sonoma 14.2.1

Yep, this will persist until this PR is merged or until the authors implement their own scroll controller.
If you need that right now, feel free to try and test it in my fork.
https://github.com/movalex/ChatGPT-Next-Web/tree/develop

@H0llyW00dzZ
Copy link
Contributor

tbh this pretty useful but, I don't think so this pr will be merged, since the owner of this repository has changed.

Copy link
Contributor

@H0llyW00dzZ H0llyW00dzZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just info

@@ -379,12 +379,13 @@ function useScrollToBottom() {
// for auto-scroll
const scrollRef = useRef<HTMLDivElement>(null);
const [autoScroll, setAutoScroll] = useState(true);

const config = useAppConfig();
let isAutoScrollEnabled: boolean = config.autoScrollMessage;
function scrollDomToBottom() {
const dom = scrollRef.current;
if (dom) {
requestAnimationFrame(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just info
this requestAnimationFrame stupid complex that made performance in browser bad when there is lots of messages

Copy link
Author

@movalex movalex Feb 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know this repo much, but I think they've added this recently to make the show text animation smoother. If this impacts performance so bad, I guess it should be either an option or omitted completely.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know this repo much, but I think they've added this recently to make the show text animation smoother. If this impacts performance so bad, I guess it should be either an option or omitted completely.

nah this already useful which can customize the only things need to improvement it's only requestAnimationFrame << stupid typescript function

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking around it yesterday trying to Improve it

@movalex
Copy link
Author

movalex commented Feb 8, 2024

tbh this pretty useful but, I don't think so this pr will be merged, since the owner of this repository has changed.

Why does the owner change would prevent them from merging it?

@H0llyW00dzZ
Copy link
Contributor

tbh this pretty useful but, I don't think so this pr will be merged, since the owner of this repository has changed.

Why does the owner change would prevent them from merging it?

I have no idea

@movalex
Copy link
Author

movalex commented Feb 8, 2024

Btw you did a great work with your fork. I like the search bar in the chat list!
I added a few changes to my repo recently too. I use Upstash to sync the chats, so I added a Force Push option to replace data on remote.
https://github.com/movalex/ChatGPT-Next-Web/tree/feat/add-force-sync-Upstash-option

@H0llyW00dzZ
Copy link
Contributor

H0llyW00dzZ commented Feb 8, 2024

Btw you did a great work with your fork. I like the search bar in the chat list! I added a few changes to my repo recently too. I use Upstash to sync the chats, so I added a Force Push option to replace data on remote. https://github.com/movalex/ChatGPT-Next-Web/tree/feat/add-force-sync-Upstash-option

it was created by Andision about search bar. Also, I might add my own chat synchronization feature later, which will be written in Go.

now still focusing to improve a local storage in browser

@m0rg5
Copy link

m0rg5 commented Feb 8, 2024

This behaviour persists in latest 2.10.3, mac m1 Sonoma 14.2.1

Yep, this will persist until this PR is merged or until the authors implement their own scroll controller. If you need that right now, feel free to try and test it in my fork. https://github.com/movalex/ChatGPT-Next-Web/tree/develop

Thx! Can you clarify/link to how? Im asking CGPT and getting a bit lost

@H0llyW00dzZ
Copy link
Contributor

@movalex I've cherry-picked your PR into my fork. It's quite useful.

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


@movalex I've cherry-picked your PR into my fork. It's quite useful.

H0llyW00dzZ added a commit to H0llyW00dzZ/ChatGPT-Next-Web that referenced this pull request Feb 10, 2024
* add menu settings and a rough translation

* autoscroll enabled by default

* update autoscroll config

* use config to drive autoscroll state

* update locales

* Update pt.ts

* check scroll on hit bottom

* Feat [UI/UX] [Front End] [Chat] smooth scrolling

- [+] feat(chat.tsx): implement smooth scrolling behavior in chat component

Note: This adding back smooth scrolling

---------

Co-authored-by: movalex <mail@abogomolov.com>
Co-authored-by: movalex <11698866+movalex@users.noreply.github.com>
Copy link

vercel bot commented Feb 16, 2024

@movalex is attempting to deploy a commit to the NextChat Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

Your build has completed!

Preview deployment

@fred-bf fred-bf mentioned this pull request Feb 27, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants