Skip to content

Chat: follow the chat to the end after the user's own send #1607

Closed

Description

@devswha

Problem

If the user has scrolled up in a long chat and then sends a message, the view stays where it was. Their message and the agent's reply appear below the fold, so they have to scroll down by hand to see that anything happened.

Proposal

  • PaneTerminal passes ChatView a separate local send receipt signal, independent of the existing sentKey, which keeps its current uses.
  • The signal advances only for this browser's own immediate composer send, and only when the receipt proves the send was accepted with nothing pending, while the PC, pane and connection still match.
  • On that signal ChatView turns follow back on and uses the timeline's existing scroll-to-end path once the new row is laid out.
  • A navigation counter is captured when the send starts. Scrolling up, paging, minimap or find navigation, history changes or leaving the pane invalidate it, so a late receipt can't yank the reader back down.

What not to copy or do

  • agent-of-empires re-pins on a general prompt counter. This bridge has receipts, so the rule here is narrower: only an accepted local send counts.
  • Don't follow remote, restored, queued or "Send now" messages, refused sends or uncertain ones.
  • Don't add a guessed optimistic chat row or match rows by text.
  • Don't move herdr focus, send anything, discard an uncertain draft or override a restored scroll position.

Done when

  • After scrolling away and sending a message that's accepted, the last row is actually on screen, and later agent output keeps following, without stealing focus.
  • Scrolling up before the receipt arrives, or after it but before the transcript row appears, keeps the reader's chosen place.
  • Refused, pending, remote and restored sends leave the scroll position alone.
  • A demo regression covering these cases runs in CI.

Current state

  • Work exists on the local branch fix/chat-local-send-follow (not pushed) with 1 commit. It was independently reviewed and needs fixes:
  • The regression doesn't control the demo's automatic assistant reply, so its cases depend on timing; the two-browser case uses one page instead of two independent clients.
  • The independent visual reviews are still missing.

Part of #1053.

Activity

  1. devswha commented on Oct 25, 2026

    @devswha
    OwnerAuthor

    Fixed by #1831 (8bf031c): after this browser's own accepted send, Chat follows back to the end unless you navigated in the meantime, covered by scripts/chat-local-send-follow-demo-regression.ts in the browser lane (#1916 corrected that regression's payload). Ships in the next release (0.4.15).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions