fix(web): evaluation detail in workflow log

This commit is contained in:
JzoNg
2026-04-30 17:19:15 +08:00
parent 712aae4d98
commit aa078a854c
2 changed files with 38 additions and 1 deletions

View File

@@ -52,6 +52,11 @@ describe('EvaluationCell', () => {
evaluation={[{
name: 'Faithfulness',
value: 0.98,
details: {
stubbed: true,
source: 'console-evaluation-run',
value_type: 'number',
},
nodeInfo: {
node_id: 'node-1',
title: 'Knowledge Retrieval',
@@ -85,5 +90,30 @@ describe('EvaluationCell', () => {
expect(await screen.findByText('True')).toBeInTheDocument()
})
it('should render evaluation items with null node info', async () => {
const user = userEvent.setup()
render(
<EvaluationCell
evaluation={[{
name: 'custom_score',
value: 0.95,
details: {
stubbed: true,
source: 'console-evaluation-run',
value_type: 'number',
customized: true,
},
nodeInfo: null,
}]}
/>,
)
await user.click(screen.getByRole('button', { name: 'appLog.table.header.evaluation' }))
expect(await screen.findByText('custom_score')).toBeInTheDocument()
expect(screen.getByText('0.95')).toBeInTheDocument()
})
})
})

View File

@@ -259,11 +259,18 @@ type EndUserInfo = {
export type EvaluationLogItem = {
name: string
value: string | number | boolean
details?: {
stubbed?: boolean
source?: string
value_type?: string
customized?: boolean
[key: string]: unknown
} | null
nodeInfo?: {
node_id: string
type: string
title: string
}
} | null
}
export type WorkflowAppLogDetail = {
id: string