mirror of
https://github.com/langgenius/dify.git
synced 2026-09-08 11:04:27 +08:00
fix(knowledge-fs): align evaluation dialog copy
This commit is contained in:
parent
43cf1087cb
commit
4afe80b368
@ -235,7 +235,7 @@ describe('QualityEvaluationPanel', () => {
|
||||
'-translate-y-1/2',
|
||||
)
|
||||
expect(dialog).toHaveAccessibleDescription(
|
||||
'dataset.newKnowledge.qualityPage.evaluation.dialogDescription:{"count":6}',
|
||||
'dataset.newKnowledge.qualityPage.evaluation.dialogDescription_other:{"count":6}',
|
||||
)
|
||||
expect(
|
||||
screen.getByRole('radio', {
|
||||
@ -245,6 +245,30 @@ describe('QualityEvaluationPanel', () => {
|
||||
expect(screen.getAllByRole('radio')).toHaveLength(3)
|
||||
})
|
||||
|
||||
it('uses singular copy for one active golden question', async () => {
|
||||
const user = userEvent.setup()
|
||||
serviceMock.listGoldenQuestions.mockResolvedValue({
|
||||
data: [{ id: 'golden-1', status: 'active' }],
|
||||
next_cursor: null,
|
||||
})
|
||||
renderPanel()
|
||||
|
||||
await screen.findByText('dataset.newKnowledge.qualityPage.evaluation.emptyTitle')
|
||||
await user.click(
|
||||
screen.getByRole('button', {
|
||||
name: 'dataset.newKnowledge.qualityPage.evaluation.run',
|
||||
}),
|
||||
)
|
||||
|
||||
expect(
|
||||
screen.getByRole('dialog', {
|
||||
name: 'dataset.newKnowledge.qualityPage.evaluation.dialogTitle',
|
||||
}),
|
||||
).toHaveAccessibleDescription(
|
||||
'dataset.newKnowledge.qualityPage.evaluation.dialogDescription_one:{"count":1}',
|
||||
)
|
||||
})
|
||||
|
||||
it('queues every active golden question and opens the persisted evidence report', async () => {
|
||||
const user = userEvent.setup()
|
||||
renderPanel()
|
||||
|
||||
@ -583,9 +583,15 @@ export function QualityEvaluationPanel({
|
||||
{t(($) => $['newKnowledge.qualityPage.evaluation.dialogTitle'])}
|
||||
</DialogTitle>
|
||||
<DialogDescription className="mt-2 pr-8 system-sm-regular text-text-tertiary">
|
||||
{t(($) => $['newKnowledge.qualityPage.evaluation.dialogDescription'], {
|
||||
count: activeGoldenQuestionCount,
|
||||
})}
|
||||
{t(
|
||||
($) =>
|
||||
$[
|
||||
activeGoldenQuestionCount === 1
|
||||
? 'newKnowledge.qualityPage.evaluation.dialogDescription_one'
|
||||
: 'newKnowledge.qualityPage.evaluation.dialogDescription_other'
|
||||
],
|
||||
{ count: activeGoldenQuestionCount },
|
||||
)}
|
||||
</DialogDescription>
|
||||
<DialogClose
|
||||
render={
|
||||
|
||||
@ -498,7 +498,8 @@
|
||||
"newKnowledge.qualityPage.evaluation.back": "Back to runs",
|
||||
"newKnowledge.qualityPage.evaluation.createdAt": "Created",
|
||||
"newKnowledge.qualityPage.evaluation.description": "Run every active golden question asynchronously and verify that the current retrieval profile finds the expected evidence.",
|
||||
"newKnowledge.qualityPage.evaluation.dialogDescription": "Replays your active golden questions in the background — {{count}} in total. Drafts and stale questions are skipped.",
|
||||
"newKnowledge.qualityPage.evaluation.dialogDescription_one": "Replays your {{count}} active golden question in the background. Drafts and stale questions are skipped.",
|
||||
"newKnowledge.qualityPage.evaluation.dialogDescription_other": "Replays your {{count}} active golden questions in the background. Drafts and stale questions are skipped.",
|
||||
"newKnowledge.qualityPage.evaluation.dialogTitle": "Run quality evaluation",
|
||||
"newKnowledge.qualityPage.evaluation.duration": "Duration",
|
||||
"newKnowledge.qualityPage.evaluation.emptyDescription": "Replay every active golden question against the current retrieval profile to see which expected evidence is still found.",
|
||||
|
||||
@ -498,7 +498,8 @@
|
||||
"newKnowledge.qualityPage.evaluation.back": "返回任务列表",
|
||||
"newKnowledge.qualityPage.evaluation.createdAt": "创建时间",
|
||||
"newKnowledge.qualityPage.evaluation.description": "异步运行全部有效参考问题,检查当前检索配置是否能够命中预期证据。",
|
||||
"newKnowledge.qualityPage.evaluation.dialogDescription": "系统会在后台重放有效参考问题,共 {{count}} 个。草稿和已过时问题会被跳过。",
|
||||
"newKnowledge.qualityPage.evaluation.dialogDescription_one": "系统会在后台重放 {{count}} 个有效参考问题。草稿和已过时问题会被跳过。",
|
||||
"newKnowledge.qualityPage.evaluation.dialogDescription_other": "系统会在后台重放 {{count}} 个有效参考问题。草稿和已过时问题会被跳过。",
|
||||
"newKnowledge.qualityPage.evaluation.dialogTitle": "运行质量评测",
|
||||
"newKnowledge.qualityPage.evaluation.duration": "耗时",
|
||||
"newKnowledge.qualityPage.evaluation.emptyDescription": "针对当前检索配置重放每个有效参考问题,查看仍能命中的预期证据。",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user