Repository navigation
feat(tui): keep fullscreen transcript groups steady and show live progress - #4751
Conversation
🦋 Changeset detectedLatest commit: 50dc93a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
There was a problem hiding this comment.
🟡 Changes recommended
Long Bash commands cause quadratic truncation work that can slow terminal rendering and input, while tool-row toggles leave Ctrl+B hint placement stale.
2 open issues
长 Bash 命令截断按原始宽度逐列尝试,导致平方级开销 · New 切换工具行展开状态后未通知宿主刷新折叠提示 · New
What changed in this PR
此 PR 改进 CLI 全屏模式的 transcript 展示,通过统一时间线驱动分组标题、实时进度和回合计时,并提供可预览的显示密度设置。
Changes:
- 稳定分组标题与进度行布局,新增 balanced 单行工具展示及点击展开。
- 更新全屏 Activity 栏的运行计时、完成摘要和固定占位高度。
- 替换未发布的分组配置键,同步设置预览、测试、中英文文档及发布说明。
| File | Description |
|---|---|
| docs/zh/configuration/config-files.md | 更新中文配置说明。 |
| docs/en/configuration/config-files.md | 同步英文配置说明。 |
| apps/kimi-code/test/tui/signal-handlers.test.ts | 更新配置夹具。 |
| apps/kimi-code/test/tui/reverse-rpc/approval.test.ts | 验证审批结束参数流计时。 |
| apps/kimi-code/test/tui/message-replay.test.ts | 验证历史回放不创建实时计时。 |
| apps/kimi-code/test/tui/kimi-tui-startup.test.ts | 验证启动时 Activity 双行占位。 |
| apps/kimi-code/test/tui/kimi-tui-message-flow.test.ts | 覆盖时间线、提示归属及回合摘要。 |
| apps/kimi-code/test/tui/fullscreen-layout.test.ts | 验证输入框位置和预览高度。 |
| apps/kimi-code/test/tui/create-tui-state.test.ts | 更新状态夹具。 |
| apps/kimi-code/test/tui/controllers/session-event-handler-step-retry.test.ts | 为重试测试补充时间线。 |
| apps/kimi-code/test/tui/controllers/session-event-handler-plugin-updates.test.ts | 为插件事件测试补充时间线。 |
| apps/kimi-code/test/tui/controllers/session-event-handler-notify.test.ts | 为通知测试补充时间线。 |
| apps/kimi-code/test/tui/controllers/session-event-handler-goal-queue.test.ts | 为目标队列测试补充时间线。 |
| apps/kimi-code/test/tui/controllers/session-event-handler-background-task.test.ts | 为后台任务测试补充时间线。 |
| apps/kimi-code/test/tui/config.test.ts | 覆盖新配置值、持久化及无效值回退。 |
| apps/kimi-code/test/tui/components/messages/thinking.test.ts | 更新展开思考标题的预期。 |
| apps/kimi-code/test/tui/components/dialogs/mermaid-preference-selector.test.ts | 覆盖 transcript 选项及预览。 |
| apps/kimi-code/test/tui/components/dialogs/choice-picker.test.ts | 验证预览高度与空间不足时的隐藏。 |
| apps/kimi-code/test/tui/components/chrome/welcome.test.ts | 更新配置夹具。 |
| apps/kimi-code/test/tui/components/chrome/moon-loader.test.ts | 验证动态计时标签。 |
| apps/kimi-code/test/tui/components/chrome/footer.test.ts | 更新分组提示测试配置。 |
| apps/kimi-code/test/tui/components/chrome/footer-status-line.test.ts | 更新状态栏配置夹具。 |
| apps/kimi-code/test/tui/commands/update-preferences.test.ts | 更新偏好保存测试。 |
| apps/kimi-code/test/tui/commands/transcript-preferences.test.ts | 验证新偏好保存和埋点。 |
| apps/kimi-code/test/tui/commands/reload.test.ts | 更新重载配置夹具。 |
| apps/kimi-code/test/tui/activity-pane.test.ts | 更新 Activity 测试配置。 |
| apps/kimi-code/test/cli/update/preflight.test.ts | 更新升级预检配置夹具。 |
| apps/kimi-code/src/tui/utils/turn-timeline.ts | 新增回合、工具和思考时间线。 |
| apps/kimi-code/src/tui/utils/transcript-projection.ts | 实现分组、待定项和单行投影。 |
| apps/kimi-code/src/tui/utils/transcript-items.ts | 提供工具折叠特征与调用标识。 |
| apps/kimi-code/src/tui/utils/group-view.ts | 推导分组标题、状态和进度文本。 |
| apps/kimi-code/src/tui/utils/activity-label.ts | 格式化运行计时和完成摘要。 |
| apps/kimi-code/src/tui/tui-state.ts | 计算设置预览可用高度。 |
| apps/kimi-code/src/tui/reverse-rpc/approval/handler.ts | 将主代理审批接入时间线。 |
| apps/kimi-code/src/tui/kimi-tui.ts | 集成时间线、Activity 展示和埋点。 |
| apps/kimi-code/src/tui/controllers/streaming-ui.ts | 持有时间线并结束回合计时。 |
| apps/kimi-code/src/tui/controllers/session-event-handler.ts | 将流式事件记录到时间线。 |
| apps/kimi-code/src/tui/constant/streaming.ts | 提取未命名工具占位名称。 |
| apps/kimi-code/src/tui/constant/rendering.ts | 定义标题延迟和进度行阈值。 |
| apps/kimi-code/src/tui/config.ts | 定义显示密度及新配置读写。 |
| apps/kimi-code/src/tui/components/panes/activity-pane.ts | 新增上一回合摘要组件。 |
| apps/kimi-code/src/tui/components/messages/transcript-group.ts | 渲染实时分组和可展开工具行。 |
| apps/kimi-code/src/tui/components/messages/transcript-container.ts | 管理新投影、组件及提示归属。 |
| apps/kimi-code/src/tui/components/messages/thinking.ts | 调整展开思考标题的缩进。 |
| apps/kimi-code/src/tui/components/dialogs/transcript-preview.ts | 使用真实组件生成设置预览。 |
| apps/kimi-code/src/tui/components/dialogs/settings-selector.ts | 提供 Tool calls 和 Thinking 选择器。 |
| apps/kimi-code/src/tui/components/dialogs/choice-picker.ts | 支持等高且按空间隐藏的预览。 |
| apps/kimi-code/src/tui/components/chrome/moon-loader.ts | 支持随动画帧更新的标签。 |
| apps/kimi-code/src/tui/commands/session.ts | 记录 /init 完成或中止。 |
| apps/kimi-code/src/tui/commands/config.ts | 接入新设置选择器及保存流程。 |
| .changeset/transcript-display-settings.md | 记录显示设置及预览功能。 |
| .changeset/tidy-transcript-groups.md | 更新恢复旧布局的配置方法。 |
| .changeset/hide-ctrl-o-hint-while-grouping.md | 更新恢复快捷键提示的方法。 |
| .changeset/activity-turn-time.md | 记录全屏 Activity 计时功能。 |
Review effort: Balanced
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8a2664d517
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 379eefd945
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6a22516cd1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
…y and thinking
The fullscreen transcript now reads `tool_call_density` ("compact",
"balanced", "detailed", "ungrouped"; default "compact") and `thinking`
("grouped", "ungrouped"; default "grouped") under `[transcript]` in
tui.toml. An invalid value falls back to the default for that key alone
and prints a warning. The unreleased `[transcript.group]` table is no
longer read or written.
/settings shows the two preferences as "Tool calls" and "Thinking".
Balanced displays like detailed for now.
The TUI now records, as each session event or approval request arrives, when the turn started and ended, when each tool call's arguments were written, when it started running and how it settled, and when thinking and reply text streamed. A turn starts when the request is sent. Calls that never started are marked abandoned at a step retry, a step boundary, or the end of the turn. Replayed history is not recorded, and the record is cleared when the session changes or the transcript is cleared. Nothing is displayed from it yet; the transcript groups will read it next.
… with a tail line Group titles drop the leading marker and sit two columns in. A call counts in the title once it has run for 200 ms or returned, and until something counts the title names the group's category. Thinking stays in its group while it streams and leads the title. The transcript's last group ends with one tail line: the slow calls by name under one timer, the live thought, an argument stream that runs past a second, or a wait for the model, else a blank line. The line keeps the group's height while it works, finishes and when the turn ends, and gives way to the next block's leading blank line, so the transcript does not jump. In balanced and detailed, a command whose arguments are still streaming, or a call that is not named yet, waits in the group right before it without a row, and moves out only when it turns out not to fold. A call cut off before its arguments finish, by a cancel, a step retry, or a truncated reply, takes its place at once. A read-only command no longer starts a group of its own.
With tool_call_density = "balanced", a tool call that does not fold, such as an edit or a command that is not read-only, is drawn as one row like a group row: a leading blank line, then the tool name in bold and its subject, with a timer while it runs. A click opens the row into the full tool card in place and another click closes it; Ctrl+O opens and closes these rows as well.
In fullscreen mode, while the model writes thinking or a reply, the activity bar now reads "Working for 12s", counted from when the request was sent. After a turn completes it reads "Worked for 28s · done 4:32 AM" in dim text. The line stays empty before the first turn and after a turn that was cancelled, failed, or blocked. Waiting for the first token and running tools still show only the moon spinner and the tip. The idle activity bar now keeps the same two rows as a working turn, so the editor and footer stay put at turn boundaries. The finished-turn line is drawn from the current session on every render, so /clear and session switches drop it at once. Regular mode is unchanged.
…ings The Tool calls and Thinking pickers now draw a short finished sample transcript under their options, rendered by the same group, row, and card components as the transcript, so each choice shows what it looks like before it is applied. The preview keeps one height while the highlight moves, and it is left out as a whole when the terminal is too short to fit it next to the rest of the screen.
The thinking text under the last fullscreen group changed only on a 240 ms grid worked out from the 120 ms animation frame, so a different frame length would have changed its pace. The line now changes once at least 150 ms have passed since it last changed on screen. On 120 ms frames that is every 240 ms and on 100 ms frames every 200 ms; renders that land between frames can bring a change forward, never closer than 150 ms. The text is paced before it is cut to the terminal width, so resizing the terminal redraws the line at once.
… fullscreen /settings /settings now names the two transcript options Tool call density and Thinking folding, and offers Fold thinking and Don't fold thinking. The preview leaves a blank line under its label. Its sample thinking is four lines long, so the Don't fold thinking preview shows the two-line preview and the "more lines" hint that a real thinking block gets. In fullscreen the preview scrolls with the wheel or Shift+Up/Down when the terminal is too short for it, instead of disappearing, and the key hint adds "shift+↑/↓ scroll" while it does. A tall terminal shows the whole preview. Moving the highlight scrolls the preview back to its top. Docked panels now redraw once when their body starts or stops overflowing, so a scroll hint is right on the first frame.
… the row when it opens A balanced row now starts with the marker its card draws, so a running, finished, failed, or interrupted call looks the same in every density. A call the turn interrupts before it gets a result, such as one cut off while writing its arguments, shows the failure mark on its row. Opening a row keeps the row in place and adds the card body below it, like an opened row in an expanded group, instead of replacing the row with the whole card. The open row shows the whole command: a long or multi-line command wraps onto more lines aligned under its first, and a command that fits keeps the exact line it showed closed. Closing the row returns it to one line. While the row is open, the Ctrl+B hint for a running command stays in the activity bar.
The grouping changeset on main is not released yet, so it now describes the final behavior: the Tool call density and Thinking folding options in /settings with their previews, and the [transcript] keys that keep the previous layout. The separate /settings changeset folds into it. The turn time changeset drops "fullscreen" because the activity bar shows turn time in regular mode too.
…mmand When a running call's name is wider than the tail row, the tail looked for the widest name that fits by trying every width from the name's full width down. A one-line command thousands of characters long made each try re-clip and re-measure the whole command, so every frame of the tail took up to hundreds of milliseconds and the terminal stalled while it ran. A name wider than the row can never fit, so the search now starts at the row's width. The tail shows the same text.
…scrolls In fullscreen /settings, the Preview label and the blank line under it now stay put while the preview below them scrolls with shift+up/down or the mouse wheel. The wheel also scrolls the preview while the pointer is over the label. The panel keeps the same height as before.
A balanced row for a call the turn interrupts before it gets a result, such as one cut off while writing its arguments, now starts with the same bullet as its card instead of the failure mark. The row text still ends with interrupted.
Balanced and detailed now fold web searches and page fetches into summary groups together with reads and searches, as their /settings descriptions say. Compact already folded them, and ungrouped still shows each one as a card.
…view The Preview label sits in the dialog head, so the wheel over it now does what it does over the rest of the head and leaves the preview alone. The wheel over the preview still scrolls it through the docked scroll view, and shift+up/down still scroll it from the keyboard, as in the other docked dialogs.
List the values and leave what each one looks like to the preview in /settings.
ungrouped stays a tui.toml escape hatch for the previous layout. The docs and the comment written into tui.toml now list only compact, balanced and detailed, the values /settings offers.
Group titles dropped their bullet and moved two columns in, but the rows of an expanded group, their detail lines and Show less stayed at the old column, so their guides stuck out left of the title. They now start under the title text, in line with the tail row.
The preview cached its lines by width only, so a palette change while it was open kept the old colors.
…ndow trims The timeline kept every call until the session changed, so long sessions grew it without bound while the transcript itself stayed within its window.
Reverts the two-column member indent from 6409f0d. A collapsed title keeps its two-column indent. An expanded title draws the dot in those columns, so the title text stays put and the member guides hang under the dot as they do on main.
a045f2b to
50dc93a
Compare
…cked Spell out that MoonshotAI#4876 landed engine-side only: the TUI never consumes availability.session, the preview picker needs MoonshotAI#4751's head/body/foot split, and request_id needs the requestAttribution layer, so the unproduced ExportSessionPreview.requestId is gone until then. Also record that feedback-attachments.ts was split rather than moved, that 4306e83 deliberately raised the sessionEventBroadcaster silent-catch quota from 5 to 8, and that isSensitivePath's case folding is an intentional fork deviation.
…gress Port upstream MoonshotAI#4751. - Add TurnTimeline plus group-view derivation so a running group keeps its member order and title while new tools and steps stream in. - Split the choice picker into head/body/foot and add a preview picker with a scrollable body; the tool-call-density and thinking selectors now show a preview of each choice. - Replace [transcript.group] with [transcript] tool_call_density/thinking, with no migration, matching upstream. - Show live thinking/tool/waiting durations in the activity bar and the last turn's duration and finish time once it completes; retries do not restart the turn clock. - Add the editor slot this fork was missing so a docked panel joins the layout tree and its body ScrollView can scroll; regular mode still mounts through the editor container. - Localize all new copy in English and Chinese, and update the config docs.


Requirement or Bug
全屏模式会把工具调用和思考折进分组,这个功能还没有发布。现在分组标题在调用进行中反复改写,并行调用时布局会跳,也看不出 agent 正在做什么。这个 PR 让分组在消息流里保持稳定,在最后一个分组下面显示当前进度,并让用户选择工具调用显示得多详细。
Bug Reproduction Steps
N/A
Root Cause
N/A
Code Changes
除了 Activity 栏,改动只影响
fullscreen模式。●,缩进两格,●只留给助手消息。展开时标题前显示●,成员行挂在它下面,标题文字不移动。调用拿到结果或开始执行满 200 ms 才算进标题,很快结束的读取直接以过去时出现,不会先闪一下Reading 1 file。还没有调用算进来时,标题写类别,例如Reading files。思考排在最前,写着时是Thinking,写完是Thought for 3s。└,显示下面第一个成立的状态。执行满 1 秒的调用,满 2 秒后带上计时。正在写的思考的最新一段,距上次换内容满 150 ms 才换。正在写参数的调用,例如Preparing Write。超过 1 秒没有新输出时的Waiting for response。刚写完的思考,最多再留 2 秒。都不成立时是空行。下一块出现时,这一行变成下一块前面的空行,分组高度不变。[transcript] tool_call_density取compact(默认)、balanced、detailed或ungrouped。compact把工具调用都折进分组。balanced只折读取、搜索、网页搜索和网页抓取,ls、git status这类只读命令紧跟在分组后面时也折进去,其余每个调用占一行,行首是和卡片一样的状态圆点,点一下在这一行下面展开卡片的内容。detailed折叠同样的调用,其余保持卡片。ungrouped不折叠,只作为回到旧布局的逃生舱,/settings和文档里都不列出。子代理和向用户提问的工具始终是卡片。[transcript] thinking取grouped(默认)或ungrouped。这两个键替换 main 上还没发布的[transcript.group]。Working for 12s。回合正常完成后,空行下面多一行它的用时和完成时刻,例如Worked for 28s · done 4:32 AM。没有这一行时,输入框上面仍是一个空行。取消或失败的回合不显示用时。Tool call density和Thinking folding两项的选项下面画一段示例 transcript,移动高亮时预览跟着换。终端太矮时,可以用滚轮或 shift+↑/↓ 滚动预览,Preview标签留在原处。Screenshots / Recordings
100 列终端里的文字画面,只截提示词到 Activity 栏这一段,省略了中间的空行。
compact,命令执行到第 2 秒:compact,回合结束:balanced,回合结束:Behavior Changes and Affected Users
分组功能还没发布,下表里分组相关的「Before」都是 main 上的未发布版本。
[transcript.group]的tools、group_thinking[transcript]的tool_call_density、thinking,旧键不再读取●,调用一开始就写进标题,动词随调用改写●,结果到了或执行满 200 ms 才算进标题tool_call_density = "ungrouped"和thinking = "ungrouped"Working…,空闲时一行空行Working for 12s。上一回合正常完成时,空行下面多一行用时Tool call folding、Thinking folding两行Tool call density、Thinking folding两行,带预览,矮终端里可滚动transcript_display_settingsgroup_tools、group_thinkingtool_call_density、thinking测试覆盖
balanced的行、圆点和展开:test/tui/components/messages/transcript-container.test.ts、test/tui/utils/transcript-projection.test.ts。test/tui/kimi-tui-message-flow.test.ts、test/tui/fullscreen-layout.test.ts、test/tui/kimi-tui-startup.test.ts。test/tui/config.test.ts、test/tui/commands/transcript-preferences.test.ts、test/tui/components/dialogs/mermaid-preference-selector.test.ts、test/tui/components/dialogs/choice-picker.test.ts、test/tui/fullscreen-layout.test.ts。Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.