AGC 工具调用组折叠箭头方向反了:展开时仍朝下(组头 chevron 双重 rotate 180°) #617

Closed
opened 2026-10-04 17:01:26 +08:00 by suzmii · 0 comments
Member

现象

AGC 对话里「执行了 N 个操作」工具调用组的组头箭头方向反了:点击展开后箭头仍然朝下,与折叠态看不出区别;而同一块里二级工具行(如 agc_browser_playtest 行尾「已执行」右侧)的箭头展开时朝上,方向正确。反馈截图里红框标出的正是组头这一处。

只影响组头:思考过程块、二级工具行都是对的。

根因(已在真实 Chromium 复现)

组头 chevron 被两次 rotate(180deg),净旋转 360°,等价于没转:

  1. 共享组件 wrapper:packages/shared/src/components/AgentProcessSummary.css:48-51 —— [aria-expanded='true'] > .agent-process-summary .agent-process-summary-chevron { transform: rotate(180deg) };
  2. 传入的图标自带规则:apps/ai-game-creator-shell/src/styles.css:12424-12427 —— .agent-tool-call-group-head[aria-expanded='true'] .agent-tool-call-group-chevron { transform: rotate(180deg) }。
    来源是 apps/ai-game-creator-shell/src/view/project-development/chat/components/ToolCallGroup/ToolCallGroup.tsx:134-138 把 className="agent-tool-call-group-chevron" 的 ChevronDown 传进了 AgentProcessSummary。

两条规则命中不同元素(wrapper span 与内部 svg),各转 180°,叠加成 360°。真实 Chromium 里对 aria-expanded="true" 的组头取计算样式:

.agent-process-summary-chevron        -> matrix(-1, 0, 0, -1, 0, 0)
svg.agent-tool-call-group-chevron     -> matrix(-1, 0, 0, -1, 0, 0)

为什么别处不出问题:AgentReasoning(思考过程)传的是不带自转 class 的裸 <ChevronDown>,只被 wrapper 转一次;二级工具行 ToolCallRow 自己实现 .agent-tool-call-row-chevron、不经过 AgentProcessSummary,也只转一次。组头是唯一「共享 wrapper + 自带 rotate class」双份旋转的组合。

打算怎么改

  • 让换向只有一处来源:移除 styles.css:12424-12427 组头 chevron 的 rotate 规则,展开态交给共享 wrapper 的 [aria-expanded='true'] 规则统一处理;
  • 保留 .agent-tool-call-group-chevron 在 is-direct-codex 布局里的 grid 定位规则(styles.css:12668-12672),DOM 结构、class 名、过渡时长都不动;
  • 不动折叠逻辑、aria-expanded / hidden 语义、组头汇总文案与计时口径。

验收判据

  • 组头箭头:折叠朝下、展开朝上,与思考过程块、二级工具行一致;二态之间无第三态残留;
  • styles.css 中组头 chevron 的 transform 只有一处声明(共享 wrapper),app 侧不再重复旋转;
  • apps/ai-game-creator-shell/tests/appSurface/tool-call-group.suite.ts 保持通过(现有用例只断言 aria-expanded 与 hidden,没覆盖箭头方向),需要时补一条锁换向来源的回归断言;
  • is-direct-codex 布局下组头 grid 定位(chevron 贴右)不回归,桌面端与窄窗口都正常。

影响范围

所有「执行了 N 个操作」工具调用组(ToolCallGroup),不是某个工具独有;与本 Issue 并行的 #563(AGC UI 动效与操作体验)方向不同,这里是确定性缺陷。

## 现象 AGC 对话里「执行了 N 个操作」工具调用组的**组头箭头方向反了**:点击展开后箭头仍然朝下,与折叠态看不出区别;而同一块里二级工具行(如 `agc_browser_playtest` 行尾「已执行」右侧)的箭头展开时朝上,方向正确。反馈截图里红框标出的正是组头这一处。 只影响组头:思考过程块、二级工具行都是对的。 ## 根因(已在真实 Chromium 复现) 组头 chevron 被**两次** `rotate(180deg)`,净旋转 360°,等价于没转: 1. 共享组件 wrapper:`packages/shared/src/components/AgentProcessSummary.css:48-51` —— `[aria-expanded='true'] > .agent-process-summary .agent-process-summary-chevron { transform: rotate(180deg) }`; 2. 传入的图标自带规则:`apps/ai-game-creator-shell/src/styles.css:12424-12427` —— `.agent-tool-call-group-head[aria-expanded='true'] .agent-tool-call-group-chevron { transform: rotate(180deg) }`。 来源是 `apps/ai-game-creator-shell/src/view/project-development/chat/components/ToolCallGroup/ToolCallGroup.tsx:134-138` 把 `className="agent-tool-call-group-chevron"` 的 `ChevronDown` 传进了 `AgentProcessSummary`。 两条规则命中**不同元素**(wrapper span 与内部 svg),各转 180°,叠加成 360°。真实 Chromium 里对 `aria-expanded="true"` 的组头取计算样式: ``` .agent-process-summary-chevron -> matrix(-1, 0, 0, -1, 0, 0) svg.agent-tool-call-group-chevron -> matrix(-1, 0, 0, -1, 0, 0) ``` 为什么别处不出问题:`AgentReasoning`(思考过程)传的是**不带自转 class** 的裸 `<ChevronDown>`,只被 wrapper 转一次;二级工具行 `ToolCallRow` 自己实现 `.agent-tool-call-row-chevron`、不经过 `AgentProcessSummary`,也只转一次。组头是唯一「共享 wrapper + 自带 rotate class」双份旋转的组合。 ## 打算怎么改 - 让换向只有**一处来源**:移除 `styles.css:12424-12427` 组头 chevron 的 rotate 规则,展开态交给共享 wrapper 的 `[aria-expanded='true']` 规则统一处理; - 保留 `.agent-tool-call-group-chevron` 在 `is-direct-codex` 布局里的 grid 定位规则(`styles.css:12668-12672`),DOM 结构、class 名、过渡时长都不动; - 不动折叠逻辑、`aria-expanded` / `hidden` 语义、组头汇总文案与计时口径。 ## 验收判据 - 组头箭头:折叠朝下、展开朝上,与思考过程块、二级工具行一致;二态之间无第三态残留; - `styles.css` 中组头 chevron 的 transform 只有一处声明(共享 wrapper),app 侧不再重复旋转; - `apps/ai-game-creator-shell/tests/appSurface/tool-call-group.suite.ts` 保持通过(现有用例只断言 `aria-expanded` 与 `hidden`,没覆盖箭头方向),需要时补一条锁换向来源的回归断言; - `is-direct-codex` 布局下组头 grid 定位(chevron 贴右)不回归,桌面端与窄窗口都正常。 ## 影响范围 所有「执行了 N 个操作」工具调用组(`ToolCallGroup`),不是某个工具独有;与本 Issue 并行的 #563(AGC UI 动效与操作体验)方向不同,这里是确定性缺陷。
suzmii added the Kind/Bug
Priority
Medium
3
labels 2026-10-04 17:01:26 +08:00
suzmii self-assigned this 2026-10-04 17:13:42 +08:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GenarrativeAI/Genarrative#617