Skip to content

Composer: bring an off-screen caret into view immediately after editing long pasted text #356

Description

@Tryanks

Reported reproduction

  1. Paste text long enough to overflow the composer viewport.
  2. With the caret at the final character, leave or scroll the viewport at the top.
  3. Type one character, then continue typing.

Actual: each keystroke moves the viewport down only a small amount; the active caret remains out of view.

Expected: the first edit scrolls far enough to reveal the caret line, and subsequent edits keep it visible. Reading older text without editing should still allow independent scrolling.

Code context and investigation boundary

The composer uses TextareaState; tcode's input wrapper re-exports it from gpui_base and renders it through InputBase. Inspect the dependency's caret-reveal/layout behavior together with tcode's composer sizing and draft/paste selection updates. Do not assume that the application's chat autoscroll is the owner of text-input scrolling.

This is a user-reported behavior, not a GUI reproduction established by this audit. OS, app revision, input method and a minimal triggering text sample remain to be captured.

Acceptance criteria

  • One edit reveals a far-off caret after a long paste, both for newline-heavy text and visually wrapped long lines.
  • Caret visibility works after replacement, deletion and IME composition without disturbing text or selection.
  • Manual scrolling while not editing remains possible; resizing the composer does not cause oscillation.
  • Exercise the real input component at normal and narrow widths and record a before/after reproduction. Put any regression at the actual owner of caret visibility.

Code context

Reviewed against main at b4c549787da6 (2026-09-08).

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions