Skip to content

Reading older TUI chat stays responsive as the transcript grows #3309

Description

@jsmestad

Type: Bug

Severity: High. Warm updates while reading older chat scale with the complete transcript. A local production-path benchmark took about 91 ms at 1,000 messages and 906 ms at 10,000, even when the frame changed no transcript content.

What

The TUI lays out and styles every retained chat message on each update while the reader is scrolled away from the bottom. Reading older messages makes unrelated updates and input increasingly expensive as the conversation grows.

Why

Local transcript retention should let the reader navigate without waiting for Elixir. Rebuilding the complete transcript on the UI loop defeats that benefit and causes large allocation spikes.

Acceptance Criteria

  1. ✅ Warm unchanged updates and local scrolling render only the visible transcript rows and a finite overscan region, independent of the total number of retained messages. PR #3386
  2. ✅ An offscreen streaming update preserves the reader's anchor and does not rerender unchanged offscreen messages. Visible streaming, animations, collapse changes, theme changes, and width changes remain correct. PR #3386
  3. ✅ Layout metadata stays proportional to resident messages; retained styled output has explicit row and byte caps and is evicted as the viewport moves. PR #3386
  4. ✅ Trim, suffix replacement, same-epoch full replacement, and epoch change preserve the specified scroll/pin behavior. Messages without a stable wire ID remain distinguishable for local layout. PR #3386
  5. ✅ Production Update-plus-View benchmarks and deterministic work counters demonstrate the new bound, with exact visual output checked against the current renderer on small fixtures. PR #3386

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

    area: go-tuiGo TUI frontendarea: performancePerformance optimizations and concurrency improvementsbugSomething isn't workingpriority: highImportant for usabilityseverity: highWrong-target changes, lost input, unusable recovery, or substantial interaction degradation

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions