Skip to content

Chat client: fix scrolling behavior when typing after scroll-up #15

@pavelanni

Description

@pavelanni

Summary

When the user scrolls up in the chat history to read previous messages and then starts typing a new message, the viewport scrolling behaves unexpectedly.

Steps to reproduce

  1. Start a chat session: docsclaw chat --agent-url <url>
  2. Send a message and receive a long response
  3. Scroll up in the viewport to review the response
  4. Start typing a new message
  5. Observe unexpected scroll jumps

Likely cause

The viewport and text input components both receive keyboard events. When the user types after scrolling up, the viewport may be consuming key events or failing to snap back to the bottom properly. The updateViewport() method calls GotoBottom() only when new messages are added, not when the user starts typing.

Possible fix

  • Snap viewport to bottom when text input receives a keypress
  • Disable viewport key navigation while input is focused
  • Or use viewport's SetYOffset to force bottom on input activity

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions