Skip to content

fix(ui): restore TurnCollapse step-based rendering, batch read-only in sub-agents#4200

Closed
CVEngineer66 wants to merge 1 commit into
esengine:main-v2from
CVEngineer66:fix/restore-turn-collapse
Closed

fix(ui): restore TurnCollapse step-based rendering, batch read-only in sub-agents#4200
CVEngineer66 wants to merge 1 commit into
esengine:main-v2from
CVEngineer66:fix/restore-turn-collapse

Conversation

@CVEngineer66

Copy link
Copy Markdown
Contributor

摘要

恢复被上游删除的步骤折叠渲染和「已处理 Xs」折叠线(TurnCollapse),三种展示模式现在有可见的视觉差异。

改动

1. TurnCollapse 恢复

  • 重新添加 stepGroups 记忆计算、collapseBatch/flushCollapseBatch 管线以及紧凑/极简模式下的步骤分组渲染
  • 标准模式:扁平渲染(不变)
  • 紧凑模式:中间步骤折叠成「已处理 Xs」,只读工具在折叠内归入 ReadOnlyBatch
  • 极简模式:同紧凑模式,但折叠内不显示 reasoning 和 phase
  • 现在默认为标准模式

2. 子代理嵌套内的只读批处理

  • explore/research/task 等子代理卡片内部的工具调用同样获得 ReadOnlyBatch 折叠,连续完成的只读工具自动归并

3. 状态图标

  • 工具名左侧显示状态:绿色 ✓(成功)、红色 ✗(错误)、—(停止)
  • 子代理调用计数 ⊞N 移到工具名左侧

4. UI 优化

  • Shimmer 动效覆盖整个工具头部(工具名 + command),不再只作用于 command
  • 思考过程在流式结束后自动折叠(尊重用户手动打开操作)
  • 默认展示模式从 minimal 改为 standard

5. 上下文压缩提示

  • "context reached X%" 提示改为 agent 生命周期内仅显示一次(原因为 softCompactNoticed 在每次工具循环中被错误重置)

6. 代码质量

  • isReadOnlyTool() 提取到共享模块 useController.ts,不再在 ToolCard.tsx 和 Transcript.tsx 中重复定义
  • 修复重复 useEffect 导致用户手动打开思考后仍被自动关闭的 bug
  • 删除冗余条件判断

涉及文件(11 个,+331/-91)

File Change
ToolCard.tsx Status icons, ⊞ left, shimmer uniformity
Transcript.tsx TurnCollapse + stepGroups + ReadOnlyBatch batching
Message.tsx Reasoning auto-close (respects user toggle)
styles.css turn-collapse body, status icons
displayMode.ts Default: minimal → standard
locales/en.ts, zh.ts transcript.processed keys
config.go, settings_app.go Default: minimal → standard
compact.go Remove softCompactNoticed reset
useController.ts Export isReadOnlyTool()

@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development desktop Wails desktop app (desktop/**) agent Core agent loop (internal/agent, internal/control) config Configuration & setup (internal/config) labels Jun 12, 2026
…n sub-agents

- Re-add TurnCollapse component and stepGroups/collapseBatch rendering
  that upstream removed, restoring visual distinction between standard,
  compact, and minimal display modes
- Batch completed read-only tools into ReadOnlyBatch inside sub-agent
  nested areas (tool__nested)
- Status icons on tool names: green ✓ for done, red ✗ for errors
- Move ⊞N sub-agent call count to left of tool name
- Shimmer animation covers tool names uniformly (not just subject)
- Auto-close reasoning when streaming finishes (respects user toggle)
- Remove softCompactNoticed reset to suppress compaction notice spam
- Default display mode: minimal → standard
- Add back i18n keys for transcript.processed/processedDuration
- Extract isReadOnlyTool() to shared module (useController.ts)
@esengine

Copy link
Copy Markdown
Owner

Thanks — the rebase and the improvements look good. Landed it as #4206 on current main-v2 (running CI on our branch since fork CI wasn't triggered). Credit kept to you.

Two things I flagged on #4206 as follow-ups rather than blockers: the default display mode now flips minimal → standard, and compact.go drops the softCompactNoticed re-arm (so the "context reached X%" notice shows once per lifetime instead of re-arming after the context drops back down — the original re-arm was deliberate, worth a second look). Merging once CI is green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Core agent loop (internal/agent, internal/control) config Configuration & setup (internal/config) desktop Wails desktop app (desktop/**) 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