Repository navigation
fix(tui): follow new content only from the bottom, and steady the chat - #117
Merged
Merged
Conversation
The log screen (F6) and a sub-agent's View details went to new content even while the user read further up. Both now follow new content only while they are at the bottom: a scroll up stops the following, and a scroll back to the bottom resumes it (app/tui/util/bottom_follow.py). Every scroll request starts in Textual's _scroll_to, so the views decide there, by where the scroll heads; a selection dragged past the edge is judged by where the view goes. A following details view waits for the scrolls Textual runs after the next refresh before it moves to new content. Past 1500 lines the log drops its oldest lines without moving the ones a scrolled-up reader is on. The chat panel: - leaves the 1fr bottom spacer out of the arrangement once content fills the viewport, so a scrollbar no longer flashes after tools expand; - while an answer streams, keeps the rows its text took at the same width (an unclosed ** or a link wraps a line for a moment) and the rows a folded tool group gave up, each up to a third of the panel, so a view following the bottom no longer moves down a row and back; - brings a new user message into view with the layout that places it, not a deferred scroll_visible that a held batch_update postpones (on Windows the message stayed below the viewport until the reply came); - counts rows a replay prepends above a revealed message as no reply to follow, and drops a TOC jump still held when a message is sent. The scheduled GC freeze calibration had failed since the chat panel began streaming model text: scripts/profile_chat_panel.py still called add_agent_message(is_final=...). Its workloads move to scripts/chat_panel_workloads.py, which drives the live API and is built by a PR test.
Contributor
|
head_sha: 变更摘要本 PR 统一了 TUI 中“内容增长时是否自动跟随到底部”的行为:新增通用辅助类 主要改动
测试补充: |
Contributor
|
head_sha: 代码审查审查结论
💬 仅评论 |
Contributor
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.
Paired: GitHub #117 ↔ GitCode !84
Summary
Logs (F6) and sub-agent View details follow new content only from the bottom. Before, both jumped to new content even while you were reading further up. Now a scroll up stops the following, and a scroll back to the bottom resumes it.
app/tui/util/bottom_follow.py._scroll_to, so the views decide there, by where the scroll heads. A selection dragged past the edge scrolls with no request, so it is judged by where the view goes.Chat panel:
1frbottom spacer is left out of the arrangement once content fills the viewport.**or a link wraps a line for a moment. It also keeps the rows a folded tool group gave up. Each is limited to a third of the panel, and both are given back once the final text shows.scroll_visiblethat a heldbatch_updatepostponed.GC freeze calibration (scheduled workflow, failing since the chat panel began streaming model text):
scripts/profile_chat_panel.pystill calledadd_agent_message(is_final=...).scripts/chat_panel_workloads.py, which has no import side effects and drives the live API.pull_requestpaths now include both scripts.Docs (en and zh-Hans) describe the View details behaviour.
Known limitations
Test plan
tests/app/tui/screens/test_log_viewer.py,test_tool_view_modal.py) and each chat panel fix (tests/app/tui/widgets/test_chat_panel_scroll.py,chat/test_replay_tail_first.py). Each fails on an in-memory mutant of the rule it covers. The follow tests also pass repeatedly alone and under heavy CPU load.--pathson the changed files: 10302 passed, 6 skipped; architecture 692 passed. The full suite was not run locally.ruff check,ruff format --check,ty check(linux, darwin, win32).gc_calibrationprobes andscripts/calibrate_gc_freeze.py --turns 12(every gate passed).