fix(web): name text generation retry action

This commit is contained in:
yyh
2026-05-10 23:12:36 +08:00
parent 237ee8e695
commit 964bcdba42
2 changed files with 9 additions and 3 deletions

View File

@ -151,10 +151,10 @@ describe('TextGenerationResultPanel', () => {
values: baseProps.exportRes,
}))
expect(screen.getByText('share.generation.batchFailed.info:{"num":1}'))!.toBeInTheDocument()
expect(screen.getByText('share.generation.batchFailed.retry'))!.toBeInTheDocument()
expect(screen.getByRole('button', { name: 'share.generation.batchFailed.retry' }))!.toBeInTheDocument()
expect(screen.getByRole('status', { name: 'appApi.loading' }))!.toBeInTheDocument()
fireEvent.click(screen.getByText('share.generation.batchFailed.retry'))
fireEvent.click(screen.getByRole('button', { name: 'share.generation.batchFailed.retry' }))
expect(handleRetryAllFailedTask).toHaveBeenCalledTimes(1)
})

View File

@ -184,7 +184,13 @@ const TextGenerationResultPanel: FC<TextGenerationResultPanelProps> = ({
<span aria-hidden className="i-ri-error-warning-fill h-4 w-4 text-text-destructive" />
<div className="system-sm-medium text-text-secondary">{t('generation.batchFailed.info', { ns: 'share', num: allFailedTaskList.length })}</div>
<div className="h-3.5 w-px bg-divider-regular"></div>
<div onClick={handleRetryAllFailedTask} className="cursor-pointer system-sm-semibold-uppercase text-text-accent">{t('generation.batchFailed.retry', { ns: 'share' })}</div>
<button
type="button"
className="inline cursor-pointer border-none bg-transparent p-0 text-left system-sm-semibold-uppercase text-text-accent focus-visible:ring-1 focus-visible:ring-components-input-border-active focus-visible:outline-hidden"
onClick={handleRetryAllFailedTask}
>
{t('generation.batchFailed.retry', { ns: 'share' })}
</button>
</div>
)}
</div>