bedrock-claude-chat icon indicating copy to clipboard operation
bedrock-claude-chat copied to clipboard

[BUG] Stuttery auto-scroll to the bottom of the page when outputting code

Open conradg opened this issue 1 year ago • 5 comments

Describe the bug

When writing long multi-line code blocks, the interface stutters a lot.

Filling out this field will help us investigate the issue efficiently. Providing detailed information allows us to set the appropriate priority. We appreciate your cooperation.
A clear and concise description of what the bug is.

To Reproduce

Filling out this field will help us investigate the issue efficiently. Providing detailed information allows us to set the appropriate priority. We appreciate your cooperation.
Steps to reproduce the behavior:

  1. Start a new chat
  2. Ask a question that invokes a code response.

screen recording

https://github.com/user-attachments/assets/438a05ca-8c48-4a72-8ef2-c5205533b667

Additional context

It seems like this bug occurs more often on my 2nd monitor than on my my Macbook screen..

conradg avatar Jul 16 '24 10:07 conradg

@conradg Is the version of the application you are checking the latest?

k70suK3-k06a7ash1 avatar Jul 16 '24 14:07 k70suK3-k06a7ash1

スクリーンショット 2024-07-16 23 52 01

k70suK3-k06a7ash1 avatar Jul 16 '24 14:07 k70suK3-k06a7ash1

Hmm, no this is from a forked repo forked at this commit about 2 months ago. https://github.com/aws-samples/bedrock-claude-chat/pull/303

I can see a lot has happened since then, so I will try and upgrade to the latest changes

conradg avatar Jul 16 '24 15:07 conradg

The following code is the relevant section The useLayoutEffect is used so that the chat no longer bounces while it is being generated.

However, they are no longer followed during chat generation.

If you need this, modify it to scroll with delayed evaluation.

frontend/src/pages/ChatPage.tsx

  useLayoutEffect(() => {
    if (messages.length > 0) {
      scrollToBottom();
    } else {
      scrollToTop();
    }
  }, [messages, scrollToBottom, scrollToTop]);

k70suK3-k06a7ash1 avatar Jul 16 '24 15:07 k70suK3-k06a7ash1

@conradg https://github.com/aws-samples/bedrock-claude-chat/pull/450 Improved. would you check this PR ?

k70suK3-k06a7ash1 avatar Jul 16 '24 15:07 k70suK3-k06a7ash1

This issue has been labeled as "stale" due to no response by the reporter within 1 month (and 14 days after last commented by someone). And it will be closed automatically 14 days later if not responded.

github-actions[bot] avatar Aug 16 '24 01:08 github-actions[bot]

Close issue because fixed by #450

statefb avatar Aug 16 '24 01:08 statefb