Skip to content

fix(tui): add regression test verifying viewport auto-follows streaming answer (#5456)#5476

Closed
ttmouse wants to merge 1 commit into
esengine:main-v2from
ttmouse:fix/tui-scroll-output-5456
Closed

fix(tui): add regression test verifying viewport auto-follows streaming answer (#5456)#5476
ttmouse wants to merge 1 commit into
esengine:main-v2from
ttmouse:fix/tui-scroll-output-5456

Conversation

@ttmouse

@ttmouse ttmouse commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

修复内容

为 Issue #5456 添加回归测试,验证视口在流式输出时自动跟随。

变更说明

  • 新增 —
  • 测试序列:填充溢出内容 → 触发流式 event.Text → 验证视口始终保持在底部
  • 补充了现有 的逆命题

验证

  • go test ./internal/cli/ 全部通过
  • 三种代码走查全部通过(内置 review / ponytail-review / pr-review)
  • 最小改动:仅新增一个测试文件(46 行)

@github-actions github-actions Bot added tui Terminal UI / CLI (internal/cli, internal/control) v2 Go rewrite (1.x) — main-v2 branch, active development labels Jun 28, 2026
…ng answer (esengine#5456)

Add a regression test that verifies the transcript viewport auto-follows
streaming answer text when the user is scrolled to the bottom. This
complements the existing TestRunningStreamPreservesScrolledReadingPosition
which asserts the inverse — scrolled-up readers are not yanked back.

The test:
1. Fills the viewport with overflow content (banner + 40 notice lines)
2. Verifies the viewport is at bottom
3. Streams event.Text content (simulating model response)
4. Verifies the viewport stays pinned to the bottom after each chunk
@ttmouse
ttmouse force-pushed the fix/tui-scroll-output-5456 branch from d6b68f0 to 0ff0a74 Compare June 28, 2026 11:30
@SivanCola

Copy link
Copy Markdown
Collaborator

Thanks for adding coverage here.

I do not think this PR should be treated as the fix or regression guard for #5456 in its current form. The issue's root cause was the removal of v.MouseMode = tea.MouseModeCellMotion from the alt-screen TUI path, which prevented terminals from delivering wheel input as MouseWheelMsg events to the transcript viewport. That was restored in #5378 and then hardened further in #5400, both of which are included in v1.13.0.

I also checked the proposed test against the v1.12.0 code plus this test file: it still passes there, so it would not have caught the reported #5456 regression.

If we keep this PR, I think it should be scoped as supplemental coverage for answer-stream auto-follow while already pinned to the bottom, and the title/body should remove the #5456 fix implication. Otherwise, I think it is reasonable to close this as superseded by #5378/#5400.

@SivanCola SivanCola closed this Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tui Terminal UI / CLI (internal/cli, internal/control) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants