Compare commits

...

2 Commits

Author SHA1 Message Date
yyh
a214c48448 refactor(web): use css icon for generated result copy 2026-08-09 15:45:04 +08:00
yyh
e00847974a fix(web): name generated result copy action 2026-08-09 14:44:45 +08:00
2 changed files with 3 additions and 3 deletions

View File

@@ -83,7 +83,7 @@ describe('Result', () => {
expect(screen.getByTestId('prompt-res'))!.toHaveTextContent('generated output')
fireEvent.click(screen.getByTestId('version-selector'))
fireEvent.click(screen.getAllByRole('button')[1]!)
fireEvent.click(screen.getByRole('button', { name: 'common.operation.copy' }))
fireEvent.click(screen.getByText(/(?:^|\.)generate\.apply(?=$|:)/))
expect(mockSetCurrentVersionIndex).toHaveBeenCalledWith(1)

View File

@@ -2,7 +2,6 @@
import type { FC } from 'react'
import type { GenRes } from '@/service/debug'
import { Button } from '@langgenius/dify-ui/button'
import { RiClipboardLine } from '@remixicon/react'
import copy from 'copy-to-clipboard'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
@@ -53,13 +52,14 @@ const Result: FC<Props> = ({
</div>
<div className="flex items-center space-x-2">
<Button
aria-label={t(($) => $['operation.copy'], { ns: 'common' })}
className="px-2"
onClick={() => {
copy(current.modified)
toast.success(t(($) => $['actionMsg.copySuccessfully'], { ns: 'common' }))
}}
>
<RiClipboardLine className="size-4 text-text-secondary" />
<span aria-hidden className="i-ri-clipboard-line size-4 text-text-secondary" />
</Button>
<Button variant="primary" onClick={onApply}>
{t(($) => $['generate.apply'], { ns: 'appDebug' })}