diff --git a/web/app/components/app-sidebar/snippet-info/dropdown.tsx b/web/app/components/app-sidebar/snippet-info/dropdown.tsx index 6ddc0d0081d..d582b801baf 100644 --- a/web/app/components/app-sidebar/snippet-info/dropdown.tsx +++ b/web/app/components/app-sidebar/snippet-info/dropdown.tsx @@ -131,7 +131,7 @@ const SnippetInfoDropdown = ({ snippet }: SnippetInfoDropdownProps) => { render={ $['operation.more'], { ns: 'common' })} - className="rounded-md data-popup-open:bg-state-base-hover data-popup-open:text-text-secondary" + className="data-popup-open:bg-state-base-hover data-popup-open:text-text-secondary" > diff --git a/web/app/components/app/configuration/config-var/config-select/index.tsx b/web/app/components/app/configuration/config-var/config-select/index.tsx index ea5606005cb..64495b826e3 100644 --- a/web/app/components/app/configuration/config-var/config-select/index.tsx +++ b/web/app/components/app/configuration/config-var/config-select/index.tsx @@ -60,7 +60,7 @@ const ConfigSelect: FC = ({ options, onChange, errorMessage, > diff --git a/web/app/components/app/configuration/config-var/var-item.tsx b/web/app/components/app/configuration/config-var/var-item.tsx index 5f189876696..5387a7fdbf7 100644 --- a/web/app/components/app/configuration/config-var/var-item.tsx +++ b/web/app/components/app/configuration/config-var/var-item.tsx @@ -59,7 +59,7 @@ const VarItem: FC = ({ diff --git a/web/app/components/apps/creators-filter.tsx b/web/app/components/apps/creators-filter.tsx index 34b3fe906b2..cd348aa4f93 100644 --- a/web/app/components/apps/creators-filter.tsx +++ b/web/app/components/apps/creators-filter.tsx @@ -160,7 +160,7 @@ const CreatorsFilter = ({ value, onChange }: CreatorsFilterProps) => { diff --git a/web/app/components/base/access-point/url.tsx b/web/app/components/base/access-point/url.tsx index 837ac521699..24e102cedd0 100644 --- a/web/app/components/base/access-point/url.tsx +++ b/web/app/components/base/access-point/url.tsx @@ -119,7 +119,6 @@ export function AccessPointUrl({ ) : ( diff --git a/web/app/components/base/form/components/base/__tests__/base-field.spec.tsx b/web/app/components/base/form/components/base/__tests__/base-field.spec.tsx index d448a797b65..8163736c76a 100644 --- a/web/app/components/base/form/components/base/__tests__/base-field.spec.tsx +++ b/web/app/components/base/form/components/base/__tests__/base-field.spec.tsx @@ -7,6 +7,11 @@ import { FormItemValidateStatusEnum, FormTypeEnum } from '@/app/components/base/ import BaseField from '../base-field' const mockDynamicOptions = vi.fn() +const mockCopy = vi.fn() + +vi.mock('foxact/use-clipboard', () => ({ + useClipboard: () => ({ copy: mockCopy, copied: false }), +})) vi.mock('@/hooks/use-i18n', () => ({ useRenderI18nObject: () => (content: Record) => @@ -74,6 +79,30 @@ describe('BaseField', () => { }) }) + it.each([ + { type: FormTypeEnum.textInput, value: 'server-value', copied: 'server-value' }, + { type: FormTypeEnum.textNumber, value: 0, copied: '0' }, + ])( + 'copies the $type field value through its keyboard-accessible action', + async ({ type, value, copied }) => { + const user = userEvent.setup() + renderBaseField({ + formSchema: { type, name: 'value', label: 'Value', required: false, showCopy: true }, + defaultValues: { value }, + }) + + await user.click(screen.getByLabelText('Value')) + await user.tab() + const copyButton = screen.getByRole('button', { name: 'common.operation.copy' }) + expect(copyButton).toHaveFocus() + await user.keyboard('{Enter}') + + expect(mockCopy).toHaveBeenCalledWith(copied) + expect(copyButton).toHaveFocus() + expect(screen.getByLabelText('Value')).toHaveValue(String(value)) + }, + ) + it.each([FormTypeEnum.textInput, FormTypeEnum.secretInput, FormTypeEnum.textNumber])( 'associates the visible label, description and required state for %s', async (type) => { diff --git a/web/app/components/base/form/components/base/base-field.tsx b/web/app/components/base/form/components/base/base-field.tsx index 8de915f833d..66b86fc2488 100644 --- a/web/app/components/base/form/components/base/base-field.tsx +++ b/web/app/components/base/form/components/base/base-field.tsx @@ -337,11 +337,8 @@ const BaseField = ({ )} > - - + + ) : ( @@ -385,7 +382,7 @@ const BaseField = ({ {showCopy && ( )} diff --git a/web/app/components/base/prompt-log-modal/card.tsx b/web/app/components/base/prompt-log-modal/card.tsx index 4ee4984a1fb..0ac4e57d5a4 100644 --- a/web/app/components/base/prompt-log-modal/card.tsx +++ b/web/app/components/base/prompt-log-modal/card.tsx @@ -21,10 +21,7 @@ const Card: FC = ({ log }) => { >
{item.role.toUpperCase()}
- +
{item.text}
diff --git a/web/app/components/base/prompt-log-modal/index.tsx b/web/app/components/base/prompt-log-modal/index.tsx index 9ec9ae954b3..1505911e159 100644 --- a/web/app/components/base/prompt-log-modal/index.tsx +++ b/web/app/components/base/prompt-log-modal/index.tsx @@ -43,7 +43,7 @@ const PromptLogModal: FC = ({ currentLogItem, width, onCanc
{currentLogItem.log?.length === 1 && ( <> - +
)} diff --git a/web/app/components/plugins/marketplace/detail-dialog/frame.tsx b/web/app/components/plugins/marketplace/detail-dialog/frame.tsx index dd7a68f92da..afd671364eb 100644 --- a/web/app/components/plugins/marketplace/detail-dialog/frame.tsx +++ b/web/app/components/plugins/marketplace/detail-dialog/frame.tsx @@ -142,8 +142,8 @@ export default function MarketplaceDetailDialogFrame({ $['operation.close'], { ns: 'common' })} - size="sm" - className="absolute top-5 right-5 z-10 size-8 rounded-lg" + size="lg" + className="absolute top-5 right-5 z-10" > diff --git a/web/app/components/plugins/readme-panel/dialog.tsx b/web/app/components/plugins/readme-panel/dialog.tsx index 9f28fb46802..6f1ed770336 100644 --- a/web/app/components/plugins/readme-panel/dialog.tsx +++ b/web/app/components/plugins/readme-panel/dialog.tsx @@ -30,8 +30,8 @@ export function ReadmeDialog({ detail, open, onOpenChange, triggerId }: ReadmeDi render={ $['operation.close'], { ns: 'common' })} - size="sm" - className="static size-8 rounded-lg" + size="lg" + className="static" > diff --git a/web/app/components/rag-pipeline/components/panel/input-field/field-list/field-item.tsx b/web/app/components/rag-pipeline/components/panel/input-field/field-list/field-item.tsx index d9589333bfd..77545f94299 100644 --- a/web/app/components/rag-pipeline/components/panel/input-field/field-list/field-item.tsx +++ b/web/app/components/rag-pipeline/components/panel/input-field/field-list/field-item.tsx @@ -78,7 +78,7 @@ const FieldItem = ({ {!readonly && dragHandleProps && ( diff --git a/web/app/components/workflow/nodes/_base/components/variable/var-list.tsx b/web/app/components/workflow/nodes/_base/components/variable/var-list.tsx index 65d4feeb276..909ab31815c 100644 --- a/web/app/components/workflow/nodes/_base/components/variable/var-list.tsx +++ b/web/app/components/workflow/nodes/_base/components/variable/var-list.tsx @@ -177,7 +177,7 @@ const VarList: FC = ({ {canDrag && ( diff --git a/web/app/components/workflow/nodes/if-else/components/condition-wrap.tsx b/web/app/components/workflow/nodes/if-else/components/condition-wrap.tsx index a7c2350a60c..e14114b01ad 100644 --- a/web/app/components/workflow/nodes/if-else/components/condition-wrap.tsx +++ b/web/app/components/workflow/nodes/if-else/components/condition-wrap.tsx @@ -140,7 +140,7 @@ const ConditionWrap: FC = ({ {!readOnly && casesLength > 1 && ( diff --git a/web/app/components/workflow/nodes/llm/components/config-prompt.tsx b/web/app/components/workflow/nodes/llm/components/config-prompt.tsx index d9553a02528..2bd7eab6123 100644 --- a/web/app/components/workflow/nodes/llm/components/config-prompt.tsx +++ b/web/app/components/workflow/nodes/llm/components/config-prompt.tsx @@ -221,7 +221,7 @@ const ConfigPrompt: FC = ({ {canDrag && (
-
+
{detail.onDownloadFile && previewTitle && (