-
-
Notifications
You must be signed in to change notification settings - Fork 645
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
Only Live Scrolling when at Page Bottom and Add Button to Scroll to Page Bottom on Web App #923
Only Live Scrolling when at Page Bottom and Add Button to Scroll to Page Bottom on Web App #923
Conversation
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.
Hey @shantanuSakpal, thanks a ton for creating these changes! I've pushed some changes:
- Fixes to the auto-scroll logic
- Styling Improvements to the scroll to bottom button
- Clean up the old code to detect when at bottom of screen
Please have a look and try them out to verify these changes works for you as well
hey @debanjum , umm, there is a slight problem , i am having issues running the offline model, and when i use the open ai gpt-4o, it gives the whole result in one go, so i cannot test the live scrolling feature. |
@shantanuSakpal, oh yeah to test streaming related changes you'd need to use Note: |
- Improve function names - Order state updates to be more readable, logical
Use `requestAnimationFrame' to ensure scrollToBottom called after page content is rendered. Previously the page wouldn't always scroll to the bottom of the page on conversation first load
Khoj paginates fetching older messages in conversation on scroll up. Previously the older chat message fetch and render on scroll would lose the earlier scroll position and message in focus. This was very disorienting.
Use refs to anchor scroll on oldest previously fetched message. This improves reliability on scroll across different screen widths Render empty chat messages div to get stable message index to scroll to. Set the display to none to keep view same as before, as chat message box shouldn't be visible while Khoj is thinking
Awesome! Thanks for verifying that. I've added a few other scroll improvements for the web app as well inspired by your PR 😄 (namely, point 3., 4. and 5. mentioned in the PR Details heading). Let me know if you see any issues in the code? I'll merge these changes by tomorrow if no issues are found.
Yeah, first run with yarn dev takes time because it compiles the changes on page load (or when page is open). Whereas
Thanks! The 2 PRs should be merged separately. But PR #925 seems to contain changes from this PR (#923). Could you update PR #925 to just contain the changes meant for fixing that issue (e.g keeping only the tooltip delayDuration code)? Of course, it's a small change so we can merge that after verifying fix works soon |
i am having some issue. When i run |
I'll typically quickly prototype anything I need to with Are you seeing the logs indicate re-builds being triggered in your front-end server? |
Yes, I do see that it rebuilds the app, but still I don't see the changes. |
Just tested this out! This is awesome, it makes the chat experiences so much smoother. Thanks @shantanuSakpal ! 🎊 To see the changes, you'll also have to refresh the page on |
This should ease scrolling up to disable auto scroll when Khoj response being streamed
Overview
i have modified the
chatHistory.tsx
and added the following things:useEffect
to monitor if auto-scroll is neededDetails
Allows scrolling to other messages in conversation while Khoj is formulating and streaming its response
It's a better default to anchor to most recent conversation turn (i.e most recent user message)
Previously the scroll would jitter during response streaming
Allow users to keep their scroll position when older messages are fetched from server and rendered
Resolves #758