feat(ui): add tooltip to session progress column

Explain the progress calculation (completed/estimated sessions) when
hovering over the progress bar in the evaluation list.
This commit is contained in:
sinohqb 2026-08-20 17:55:42 +08:00
parent 60981b634d
commit af8c7d6810

View File

@ -1,7 +1,7 @@
import { useState } from 'react'
import { useNavigate } from 'react-router-dom'
import {
Button, Drawer, Empty, Form, Input, InputNumber, Popconfirm, Progress, Select, Space, Spin, Table, Tabs, Tag, message,
Button, Drawer, Empty, Form, Input, InputNumber, Popconfirm, Progress, Select, Space, Spin, Table, Tabs, Tag, Tooltip, message,
} from 'antd'
import type { TabsProps } from 'antd'
import type { ColumnsType } from 'antd/es/table'
@ -165,14 +165,17 @@ export default function IntelligentEvalsPage() {
const estimated = ev.plan?.estimated_sessions ?? ev.session_count
const running = (ev.sessions ?? []).filter((s) => s.status === 'running').length
const pct = estimated ? Math.round((ev.completed_sessions / estimated) * 100) : 0
const tooltipText = `已完成 ${ev.completed_sessions} 个会话 / 预估 ${estimated} 个会话${running > 0 ? `${running} 个进行中)` : ''}`
return (
<Space size={6}>
<Progress percent={pct} size="small" style={{ width: 90 }} />
<span style={{ fontSize: 12, color: colors.textSecondary }}>
{ev.completed_sessions}/{estimated}
{running > 0 && <span style={{ color: statusColors.running, marginLeft: 4 }}>({running} )</span>}
</span>
</Space>
<Tooltip title={tooltipText}>
<Space size={6}>
<Progress percent={pct} size="small" style={{ width: 90 }} />
<span style={{ fontSize: 12, color: colors.textSecondary }}>
{ev.completed_sessions}/{estimated}
{running > 0 && <span style={{ color: statusColors.running, marginLeft: 4 }}>({running} )</span>}
</span>
</Space>
</Tooltip>
)
},
},