Skip to content

fix(macapp): stop transcript autoscroll when the user reads earlier messages #992

Description

@dennisonbertram

Parent: #991

Summary

The transcript claims to autoscroll only while the user is at the bottom, but pinnedToBottom is initialized to true and never changes. Every appended item and every streamed assistant-text delta therefore calls scrollTo(bottomAnchor), pulling the viewport away from older content the user is reading.

Evidence

  • macapp/Sources/GoCodeUI/ChatView.swift:88-114 — pin state is declared and every stream mutation calls scrollIfPinned.
  • macapp/Sources/GoCodeUI/ChatView.swift:127-131 — the only pin-state consumer; no writer exists.
  • Repository search finds no assignment that can make pinnedToBottom false.

Impact

A long-running response makes earlier transcript content effectively unreadable until streaming ends. This violates the view's own documented behavior and removes user control during the app's primary workflow.

Scope

  • Track whether the bottom anchor is actually visible (or within a small semantic threshold).
  • Pause autoscroll as soon as the user scrolls upward.
  • Resume when the user returns to the bottom.
  • Show a keyboard-accessible “Jump to Latest” affordance while new content arrives off-screen.
  • Respect Reduce Motion for programmatic scrolling.

Out of scope

  • Changing transcript row styling or storage.
  • Replacing the whole transcript renderer.

Tests first

  • Extract/test a small scroll-pin state reducer covering: initially pinned, user leaves bottom, streamed delta while unpinned, user returns to bottom.
  • Production-reachability test proving the scroll-position signal writes the pin state.
  • Manual smoke with a real streaming run: scroll upward mid-response and verify the viewport stays put; activate Jump to Latest and verify following resumes.

Acceptance criteria

  • Streaming never changes the visible region while the user is reading above the bottom.
  • Appended items and in-place deltas follow only when pinned.
  • Jump to Latest is keyboard and VoiceOver operable.
  • Reduced Motion avoids animated forced scrolling.
  • swift test, Swift build, formatting, and strict format lint pass.

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

    bugSomething isn't workingcorrectnessCorrectness bugs and logic errorsmacappNative macOS app (macapp/)mediumMedium effort: 1-3 daysuxUser experience improvementswell-specifiedIssue is clear, scoped, and ready to implement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions