fix(chat): 处理记录复用回复头像列

伙伴处理过程保留回复列占位,不再独立显示头像;回复继续承载伙伴身份。更新真实组件场景,覆盖运行、完成、展开收起与正文对齐。

Assisted-by: Cindy (https://cindy.app)
Signed-off-by: nana <823073145@qq.com>
This commit is contained in:
nana
2026-11-09 14:07:44 +08:00
parent 0fd7b1629a
commit acfb642c0d
2 changed files with 10 additions and 8 deletions

View File

@@ -240,11 +240,11 @@ export default {
const journal = page.locator('[data-teammate-process]');
await journal.waitFor();
assert.equal(await journal.count(), 1, 'One disclosure owns all intermediate notes');
// Visible UI regression: process and reply each own a portrait; expansion
// must not repeat it in tool details. Hidden spacers failed this check.
// 2026-11-09 screenshot and cindy-bots-runtime: work belongs to the reply
// below, not a separate speaker. Actual MessageStream covers live/completed UI.
const processPortrait = journal.locator('xpath=../..').getByTestId('fixture-partner-avatar');
assert.equal(await processPortrait.count(), 1);
assert.equal(await processPortrait.isVisible(), true, 'The process portrait is visible');
assert.equal(await processPortrait.isVisible(), false, 'The process leaves the portrait column empty');
const heading = journal.locator(':scope > button');
if (definition.data.retry) {
const action = journal.locator('[data-teammate-segment] > button');
@@ -286,8 +286,10 @@ export default {
assert.equal(await heading.getAttribute('aria-expanded'), 'true', 'Keep inspected work open on completion');
}
await ui.capture('records');
assert.equal(await page.getByTestId('fixture-partner-avatar').count(), 2, 'Expanded process and final reply each have one portrait');
assert.equal(await processPortrait.isVisible(), true);
assert.equal(await page.locator('[data-testid="fixture-partner-avatar"]:visible').count(), 1, 'The completed process shares the final reply identity');
assert.equal(await processPortrait.isVisible(), false, 'Expanding completed details never adds another portrait');
const reply = page.locator('[data-bot-reply-bubble]').last();
assert.ok(Math.abs((await journal.boundingBox()).x - (await reply.boundingBox()).x) <= 0.5, 'The record aligns with its reply column');
await heading.click();
assert.equal(await heading.getAttribute('aria-expanded'), 'false');
},

View File

@@ -2876,7 +2876,7 @@ export const WorkGroupRenderItemView = memo(function WorkGroupRenderItemView({
item: Extract<RenderItem, { type: 'work_group' }>;
context: WorkGroupRenderContext;
compact: boolean;
/** 伙伴聊天:过程区与最终回复各显示一个头像,正文保持同列。 */
/** 伙伴聊天:沿用回复头像列;过程只占位,头像归下方回复。 */
companionAvatar?: ReactNode;
}) {
// 完成态外层时间线可包含内层 work_group。递归只负责形状映射,
@@ -6308,7 +6308,7 @@ export function MessageStream({
previousLocalFileRefsRef.current = localFileRefs;
}, [localFileRefs]);
// 成果与回复正文同列,只占头像宽度;过程区单独显示伙伴头像。
// 成果与处理记录和回复正文同列,复用头像占位,不重复显示伙伴头像。
const botReplyColumnSpacer = useMemo(
() =>
simplifiedBotConversation && assistantAvatar ? (
@@ -6645,7 +6645,7 @@ export function MessageStream({
// 伙伴聊天与普通任务同一套工作过程:运行中露最近 5 条活动与计时,
// 组头按内容宽;最终答复后保留折叠过程,按需展开。
compact={false}
companionAvatar={simplifiedBotConversation ? assistantAvatar : undefined}
companionAvatar={botReplyColumnSpacer}
/>
);
}