{detail?.messages?.map((item: any) =>
- {item.role === 'assistant' ? <> source.chunk_id)} />> : {item.content}}
+ {item.role === 'assistant' ? <>> : {item.content}}
)}
{detail?.runs?.filter((run: any) => run.status !== 'completed' && (run.tool_calls?.length || run.error || run.status === 'running')).map((run: any) =>
智评 {run.status === 'running' ? '生成中' : run.status === 'failed' ? '失败' : '已中断'}}>
{run.error && })}
diff --git a/frontend/src/style.css b/frontend/src/style.css
index 4539b43..8cba1a3 100644
--- a/frontend/src/style.css
+++ b/frontend/src/style.css
@@ -55,8 +55,6 @@ body { margin: 0; }
.citation-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.citation-card p { margin: 5px 0; color: #44566d; white-space: pre-wrap; }
.citation-card summary { cursor: pointer; color: #44566d; overflow-wrap: anywhere; }
-.legacy-evidence { margin-top: 10px; }
-.legacy-evidence .citation-grid { max-height: 300px; overflow-y: auto; }
.chat-tools { margin-bottom: 12px; padding-bottom: 6px; border-bottom: 1px solid #e2eaf3; }
.chat-tool { border: 1px solid #e2e8ef; border-radius: 6px; margin-top: 5px; padding: 6px 9px; }
.chat-tool summary { cursor: pointer; list-style-position: inside; overflow-wrap: anywhere; }
diff --git a/frontend/tests/chat.spec.ts b/frontend/tests/chat.spec.ts
index b9c7786..8048357 100644
--- a/frontend/tests/chat.spec.ts
+++ b/frontend/tests/chat.spec.ts
@@ -11,9 +11,7 @@ async function mockApi(page: Page) {
tool_calls: [{ id: 'call-one', name: 'search_project_material', status: 'completed', arguments: { project_id: 1 },
summary: '找到 1 条引用', result: { found: true, citations: [{ page: 48, quote: '第48页原文片段' }] } },
{ id: 'call-two', name: 'get_scores', status: 'completed', arguments: { batch_id: 3, criterion_offset: 0 },
- summary: '返回 1 项评分', result: { next_criterion_offset: 6, results: [{ rows: [{ criterion_id: 'C1', final_score: 8 }] }] } },
- { id: 'call-legacy', name: 'search_project_material', status: 'completed', arguments: { project_id: 1 },
- summary: '找到 6 条引用', result: { found: true, citations: { count: 6 } } }] }],
+ summary: '返回 1 项评分', result: { next_criterion_offset: 6, results: [{ rows: [{ criterion_id: 'C1', final_score: 8 }] }] } }] }],
actions: [], runs: [{ id: 1, status: 'completed', tool_calls: [] }] },
};
let nextId = 8;
@@ -105,12 +103,10 @@ test('markdown, citations, tool folding and narrow layout are safe', async ({ pa
await expect(page.locator('.tool-detail').first()).toContainText('第48页原文片段');
await page.locator('.chat-tool').nth(1).locator('summary').click();
await expect(page.locator('.chat-tool').nth(1).locator('.tool-detail')).toContainText('C1');
- await page.locator('.chat-tool').nth(2).locator('summary').click();
- await expect(page.locator('.chat-tool').nth(2).locator('.legacy-evidence')).toContainText('第48页原文片段');
- await page.getByRole('button', { name: '查看本轮已核验原文' }).click();
+ await page.locator('.chat-citation-group > summary').click();
await expect(page.locator('.chat-citation-group')).toHaveAttribute('open', '');
await expect(page.getByText('资料.pdf')).toBeVisible();
- await expect(page.getByText('第 48 页').last()).toBeVisible();
+ await expect(page.getByText('第 48 页')).toBeVisible();
const positions = await page.evaluate(() => {
const card = document.querySelector('.chat-assistant .ant-card-body');
return ['.chat-tools', '.chat-markdown', '.chat-citations'].map(selector =>