feat(tui): empty enter scrolls viewport to bottom#3553
Merged
SivanCola merged 3 commits intoJun 9, 2026
Conversation
SivanCola
previously requested changes
Jun 8, 2026
SivanCola
left a comment
Collaborator
There was a problem hiding this comment.
谢谢,这个改动方向是对的,空输入 Enter 用来回到底部很符合 #3550 的诉求。不过现在只覆盖了 idle 分支,运行中的分支还是会提前返回:
if m.state == tuiRunning {
line := strings.TrimSpace(m.input.Value())
if line == "" {
return m, nil
}
...
}这样在模型流式输出或长任务运行时,用户滚上去看内容后按空 Enter 仍然不会回到底部;这恰好是最需要 tail-follow 的场景。建议在这个 line == "" 分支里也调用 m.viewport.GotoBottom(),并补一个回归测试:先让 transcript 溢出、滚上去、设置 m.state = tuiRunning,再按空 Enter,断言 viewport.AtBottom()。
我本地验证过:go test ./internal/cli 通过;临时加上述 running 场景测试时当前 PR 会失败。
esengine
approved these changes
Jun 8, 2026
esengine
left a comment
Owner
There was a problem hiding this comment.
Nice quality-of-life fix — empty Enter snapping to bottom is the expected behavior. Verified build + cli tests locally. Thanks!
auto-merge was automatically disabled
June 8, 2026 09:35
Head branch was pushed to by a user without write access
0576a00 to
82dc750
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
小改动:在 TUI 中,输入框为空时按 Enter 不再是无操作,而是自动将 viewport 滚到最底部(tail-follow)。
之前空输入按 Enter 直接 return,改了之后加了一行
m.viewport.GotoBottom()。Closes #3550