Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix(web): align icon picker with updated design (#42636)

Stephen Zhoubbaaaf980fae
diff --git a/web/app/components/app/configuration/tools/__tests__/external-data-tool-modal.spec.tsx b/web/app/components/app/configuration/tools/__tests__/external-data-tool-modal.spec.tsx
index 099c7305771..bb3bcffa0f0 100644
--- a/web/app/components/app/configuration/tools/__tests__/external-data-tool-modal.spec.tsx
+++ b/web/app/components/app/configuration/tools/__tests__/external-data-tool-modal.spec.tsx
@@ -136,12 +136,12 @@ describe('ExternalDataToolModal', () => {
fireEvent.click(screen.getByText('pick-extension'))
fireEvent.click(screen.getByText('open-emoji-picker'))
await waitFor(() => {
- expect(screen.getByPlaceholderText('common.operation.search')).toBeInTheDocument()
+ expect(screen.getByPlaceholderText('app.iconPicker.search')).toBeInTheDocument()
})
const emojiButton = await screen.findByRole('gridcell', { name: 'Grinning face' })
expect(emojiButton).toBeTruthy()
fireEvent.click(emojiButton!)
- fireEvent.click(screen.getByRole('button', { name: '#E4FBCC' }))
+ fireEvent.click(screen.getByRole('button', { name: '#F3FEE7' }))
fireEvent.click(screen.getByRole('button', { name: /iconPicker\.ok/ }))
fireEvent.click(screen.getByText(/(?:^|\.)operation\.save(?=$|:)/))
@@ -153,7 +153,7 @@ describe('ExternalDataToolModal', () => {
},
enabled: true,
icon: expect.any(String),
- icon_background: '#E4FBCC',
+ icon_background: '#F3FEE7',
label: 'Search',
type: 'api',
variable: 'search_api',
@@ -168,7 +168,7 @@ describe('ExternalDataToolModal', () => {
},
enabled: true,
icon: expect.any(String),
- icon_background: '#E4FBCC',
+ icon_background: '#F3FEE7',
label: 'Search',
type: 'api',
variable: 'search_api',
diff --git a/web/app/components/app/create-app-modal/__tests__/index.spec.tsx b/web/app/components/app/create-app-modal/__tests__/index.spec.tsx
index 9f011a711de..c27f08220d0 100644
--- a/web/app/components/app/create-app-modal/__tests__/index.spec.tsx
+++ b/web/app/components/app/create-app-modal/__tests__/index.spec.tsx
@@ -1,6 +1,7 @@
import type { ReactElement } from 'react'
import type { App } from '@/types/app'
import { fireEvent, screen, waitFor } from '@testing-library/react'
+import userEvent from '@testing-library/user-event'
import { beforeEach, describe, expect, it, vi } from 'vite-plus/test'
import { useRouter } from '@/next/navigation'
import { renderWithConsoleQuery } from '@/test/console/query-data'
@@ -266,12 +267,12 @@ describe('CreateAppModal', () => {
fireEvent.click(screen.getByText('app.types.chatbot'))
fireEvent.click(screen.getByText('open-icon-picker'))
await waitFor(() => {
- expect(screen.getByPlaceholderText('common.operation.search')).toBeInTheDocument()
+ expect(screen.getByPlaceholderText('app.iconPicker.search')).toBeInTheDocument()
})
- fireEvent.click(screen.getByRole('button', { name: '#E4FBCC' }))
+ fireEvent.click(screen.getByRole('button', { name: '#F3FEE7' }))
fireEvent.click(screen.getByRole('button', { name: /iconPicker\.ok/ }))
await waitFor(() => {
- expect(screen.queryByPlaceholderText('common.operation.search')).not.toBeInTheDocument()
+ expect(screen.queryByPlaceholderText('app.iconPicker.search')).not.toBeInTheDocument()
})
fireEvent.change(screen.getByPlaceholderText('app.newApp.appNamePlaceholder'), {
target: { value: 'Keyboard App' },
@@ -288,7 +289,7 @@ describe('CreateAppModal', () => {
description: 'Created from shortcut',
icon_type: 'emoji',
icon: '🤖',
- icon_background: '#E4FBCC',
+ icon_background: '#F3FEE7',
mode: AppModeEnum.CHAT,
})
})
@@ -310,14 +311,14 @@ describe('CreateAppModal', () => {
fireEvent.click(screen.getByText('open-icon-picker'))
await waitFor(() => {
- expect(screen.getByPlaceholderText('common.operation.search')).toBeInTheDocument()
+ expect(screen.getByPlaceholderText('app.iconPicker.search')).toBeInTheDocument()
})
- fireEvent.click(screen.getByRole('button', { name: /iconPicker\.cancel/ }))
+ await userEvent.setup().keyboard('{Escape}')
await waitFor(() => {
- expect(screen.queryByPlaceholderText('common.operation.search')).not.toBeInTheDocument()
+ expect(screen.queryByPlaceholderText('app.iconPicker.search')).not.toBeInTheDocument()
})
- expect(screen.queryByPlaceholderText('common.operation.search')).not.toBeInTheDocument()
+ expect(screen.queryByPlaceholderText('app.iconPicker.search')).not.toBeInTheDocument()
ahooksMocks.keyPressHandlers.at(-1)?.()
diff --git a/web/app/components/app/switch-app-modal/__tests__/index.spec.tsx b/web/app/components/app/switch-app-modal/__tests__/index.spec.tsx
index 9ce404cad91..a45e7ecea8a 100644
--- a/web/app/components/app/switch-app-modal/__tests__/index.spec.tsx
+++ b/web/app/components/app/switch-app-modal/__tests__/index.spec.tsx
@@ -296,13 +296,13 @@ describe('SwitchAppModal', () => {
await user.click(screen.getByText('open-icon-picker'))
await waitFor(() => {
- expect(screen.getByPlaceholderText('common.operation.search')).toBeInTheDocument()
+ expect(screen.getByPlaceholderText('app.iconPicker.search')).toBeInTheDocument()
})
- await user.click(screen.getByRole('button', { name: '#E4FBCC' }))
+ await user.click(screen.getByRole('button', { name: '#F3FEE7' }))
await user.click(screen.getByRole('button', { name: /iconPicker\.ok/ }))
await waitFor(() => {
- expect(screen.queryByPlaceholderText('common.operation.search')).not.toBeInTheDocument()
+ expect(screen.queryByPlaceholderText('app.iconPicker.search')).not.toBeInTheDocument()
})
await user.click(screen.getByRole('button', { name: 'app.switchStart' }))
@@ -313,7 +313,7 @@ describe('SwitchAppModal', () => {
body: expect.objectContaining({
icon_type: 'emoji',
icon: '🚀',
- icon_background: '#E4FBCC',
+ icon_background: '#F3FEE7',
}),
}),
)
@@ -326,13 +326,13 @@ describe('SwitchAppModal', () => {
await user.click(screen.getByText('open-icon-picker'))
await waitFor(() => {
- expect(screen.getByPlaceholderText('common.operation.search')).toBeInTheDocument()
+ expect(screen.getByPlaceholderText('app.iconPicker.search')).toBeInTheDocument()
})
- await user.click(screen.getByRole('button', { name: /iconPicker\.cancel/ }))
+ await user.keyboard('{Escape}')
await waitFor(() => {
- expect(screen.queryByPlaceholderText('common.operation.search')).not.toBeInTheDocument()
+ expect(screen.queryByPlaceholderText('app.iconPicker.search')).not.toBeInTheDocument()
})
- expect(screen.queryByPlaceholderText('common.operation.search')).not.toBeInTheDocument()
+ expect(screen.queryByPlaceholderText('app.iconPicker.search')).not.toBeInTheDocument()
await user.click(screen.getByText('app.removeOriginal'))
expect(screen.getByRole('button', { name: 'common.operation.cancel' })).toBeInTheDocument()
diff --git a/web/app/components/base/app-icon-picker/ImageInput.tsx b/web/app/components/base/app-icon-picker/ImageInput.tsx
index 8d0e5ec278c..65996087b9d 100644
--- a/web/app/components/base/app-icon-picker/ImageInput.tsx
+++ b/web/app/components/base/app-icon-picker/ImageInput.tsx
@@ -7,7 +7,6 @@ import { createRef, useEffect, useState } from 'react'
import Cropper from 'react-easy-crop'
import { useTranslation } from 'react-i18next'
import { ALLOW_FILE_EXTENSIONS } from '@/types/app'
-import { ImagePlus } from '../icons/src/vender/line/images'
import { useDraggableUploader } from './hooks'
import { checkIsAnimatedImage } from './utils'
@@ -59,7 +58,14 @@ const ImageInput: FC<UploaderProps> = ({ className, cropShape, onImageInput }) =
const handleShowImage = () => {
if (isAnimatedImage) {
- return <img src={inputImage?.url} alt="" data-testid="animated-image" />
+ return (
+ <img
+ src={inputImage?.url}
+ alt=""
+ className="h-full w-full object-contain"
+ data-testid="animated-image"
+ />
+ )
}
return (
@@ -77,11 +83,12 @@ const ImageInput: FC<UploaderProps> = ({ className, cropShape, onImageInput }) =
}
return (
- <div className={cn(className, 'w-full px-3 py-1.5')}>
+ <div className={cn(className, 'w-full p-3')}>
<div
className={cn(
- 'relative flex aspect-square flex-col items-center justify-center rounded-lg border-[1.5px] border-dashed border-components-input-border-hover text-gray-500',
- isDragActive && 'border-primary-600',
+ 'relative flex h-60 flex-col items-center justify-center gap-2 overflow-hidden rounded-[10px] border border-dashed border-components-dropzone-border bg-components-dropzone-bg px-4 py-3 text-center text-text-secondary',
+ isDragActive &&
+ 'border-components-dropzone-border-accent bg-components-dropzone-bg-accent',
)}
onDragEnter={handleDragEnter}
onDragOver={handleDragOver}
@@ -90,15 +97,18 @@ const ImageInput: FC<UploaderProps> = ({ className, cropShape, onImageInput }) =
>
{!inputImage ? (
<>
- <ImagePlus className="pointer-events-none mb-3 h-7.5 w-7.5" />
- <div className="mb-0.5 text-sm font-medium">
+ <span
+ className="pointer-events-none i-ri-image-add-line size-5 text-text-tertiary"
+ aria-hidden="true"
+ />
+ <div className="system-sm-medium">
<span className="pointer-events-none">
{t(($) => $['imageInput.dropImageHere'], { ns: 'common' })}
&nbsp;
</span>
<button
type="button"
- className="text-components-button-primary-bg"
+ className="rounded-sm text-text-accent focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-state-accent-solid"
onClick={() => inputRef.current?.click()}
>
{t(($) => $['imageInput.browse'], { ns: 'common' })}
@@ -113,7 +123,7 @@ const ImageInput: FC<UploaderProps> = ({ className, cropShape, onImageInput }) =
data-testid="image-input"
/>
</div>
- <div className="pointer-events-none">
+ <div className="pointer-events-none system-xs-regular text-text-tertiary">
{t(($) => $['imageInput.supportedFormats'], { ns: 'common' })}
</div>
</>
diff --git a/web/app/components/base/app-icon-picker/__tests__/index.spec.tsx b/web/app/components/base/app-icon-picker/__tests__/index.spec.tsx
index 53dac2f3771..9afb29abfe2 100644
--- a/web/app/components/base/app-icon-picker/__tests__/index.spec.tsx
+++ b/web/app/components/base/app-icon-picker/__tests__/index.spec.tsx
@@ -1,7 +1,7 @@
import type { ComponentProps } from 'react'
import type { Area } from 'react-easy-crop'
import type { ImageFile } from '@/types/app'
-import { fireEvent, render, screen, waitFor } from '@testing-library/react'
+import { fireEvent, render, screen, waitFor, within } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { mockEmojiData } from '@/test/emoji-picker'
import { TransferMethod } from '@/types/app'
@@ -165,9 +165,9 @@ describe('AppIconPicker', () => {
renderPicker()
expect(screen.getByRole('dialog', { name: /emoji/i })).toBeInTheDocument()
- expect(await screen.findByRole('button', { name: /emoji/i }))!.toBeInTheDocument()
- expect(screen.getByRole('button', { name: /image/i }))!.toBeInTheDocument()
- expect(screen.getByText(/cancel/i))!.toBeInTheDocument()
+ expect(await screen.findByRole('radio', { name: /emoji/i }))!.toBeInTheDocument()
+ expect(screen.getByRole('radio', { name: /image/i }))!.toBeInTheDocument()
+ expect(screen.getByText(/tryYourLuck/i))!.toBeInTheDocument()
expect(screen.getByText(/ok/i))!.toBeInTheDocument()
})
@@ -181,12 +181,66 @@ describe('AppIconPicker', () => {
})
describe('User Interactions', () => {
- it('should close when cancel is clicked', async () => {
- const { onOpenChange } = renderPicker()
+ it('records only confirmed selections and restores them when reopened', async () => {
+ const user = userEvent.setup()
+ const onSelect = vi.fn()
+ const onOpenChange = vi.fn()
+ const { rerender } = render(
+ <AppIconPicker open onOpenChange={onOpenChange} onSelect={onSelect} />,
+ )
+ await user.click(
+ within(screen.getByRole('region', { name: 'app.iconPicker.recommend' })).getByRole(
+ 'button',
+ { name: '😆' },
+ ),
+ )
+ expect(onSelect).not.toHaveBeenCalled()
+ await user.click(screen.getByRole('button', { name: 'app.iconPicker.ok' }))
+ expect(onSelect).toHaveBeenCalledWith({ type: 'emoji', icon: '😆', background: '#FEF3F2' })
+ rerender(<AppIconPicker open={false} onOpenChange={onOpenChange} onSelect={onSelect} />)
+ rerender(<AppIconPicker open onOpenChange={onOpenChange} onSelect={onSelect} />)
+ const recent = await screen.findByRole('region', { name: 'app.iconPicker.recent' })
+ await user.click(within(recent).getByRole('button', { name: '😆' }))
+ await user.click(screen.getByRole('button', { name: 'app.iconPicker.ok' }))
+ expect(onSelect).toHaveBeenCalledTimes(2)
+ })
- await userEvent.click(screen.getByText(/cancel/i))
+ it('randomizes both emoji and background before confirmation', async () => {
+ vi.spyOn(Math, 'random').mockReturnValue(0)
+ const user = userEvent.setup()
+ const { onSelect } = renderPicker({ initialEmoji: { icon: '😃', background: '#FEF3F2' } })
+ await user.click(screen.getByRole('button', { name: 'app.iconPicker.tryYourLuck' }))
+ expect(screen.getByRole('button', { name: '#FFF1F3' })).toHaveAttribute(
+ 'aria-pressed',
+ 'true',
+ )
+ expect(onSelect).not.toHaveBeenCalled()
+ await user.click(screen.getByRole('button', { name: 'app.iconPicker.ok' }))
+ expect(onSelect).toHaveBeenCalledWith({ type: 'emoji', icon: '😆', background: '#FFF1F3' })
+ })
- expect(onOpenChange).toHaveBeenCalledWith(false)
+ it('shows styles after selecting an emoji and confirms the selected background', async () => {
+ const user = userEvent.setup()
+ const { onSelect } = renderPicker()
+ expect(
+ screen.queryByRole('region', { name: 'app.iconPicker.chooseStyle' }),
+ ).not.toBeInTheDocument()
+ await user.click(
+ within(screen.getByRole('region', { name: 'app.iconPicker.recommend' })).getByRole(
+ 'button',
+ { name: '😃' },
+ ),
+ )
+ const style = screen.getByRole('button', { name: '#F0F2F5' })
+ await user.click(style)
+ expect(style).toHaveAttribute('aria-pressed', 'true')
+ expect(screen.getByRole('gridcell', { name: 'Grinning face with big eyes' })).toHaveAttribute(
+ 'aria-pressed',
+ 'true',
+ )
+ expect(onSelect).not.toHaveBeenCalled()
+ await user.click(screen.getByRole('button', { name: 'app.iconPicker.ok' }))
+ expect(onSelect).toHaveBeenCalledWith({ type: 'emoji', icon: '😃', background: '#F0F2F5' })
})
it('should switch between emoji and image tabs', async () => {
@@ -195,7 +249,7 @@ describe('AppIconPicker', () => {
await userEvent.click(screen.getByText(/image/i))
expect(screen.getByText(/drop.*here/i))!.toBeInTheDocument()
- await userEvent.click(screen.getByRole('button', { name: /emoji/i }))
+ await userEvent.click(screen.getByRole('radio', { name: /emoji/i }))
expect(screen.getByPlaceholderText(/search/i))!.toBeInTheDocument()
})
@@ -247,7 +301,7 @@ describe('AppIconPicker', () => {
await waitFor(() => {
expect(onSelect).toHaveBeenCalledWith({
type: 'emoji',
- icon: 'rabbit',
+ icon: '🐰',
background: '#E4FBCC',
})
})
@@ -255,11 +309,14 @@ describe('AppIconPicker', () => {
})
describe('Image Upload', () => {
- it('should return early when image tab is active and no file has been selected', async () => {
+ it('hides confirmation actions in the empty image state', async () => {
const { onSelect } = renderPicker()
await userEvent.click(screen.getByText(/image/i))
- await userEvent.click(screen.getByText(/ok/i))
+ expect(screen.queryByRole('button', { name: 'app.iconPicker.ok' })).not.toBeInTheDocument()
+ expect(
+ screen.queryByRole('button', { name: 'app.iconPicker.cancel' }),
+ ).not.toBeInTheDocument()
expect(mocks.handleLocalFileUpload).not.toHaveBeenCalled()
expect(onSelect).not.toHaveBeenCalled()
diff --git a/web/app/components/base/app-icon-picker/index.tsx b/web/app/components/base/app-icon-picker/index.tsx
index 36d52b78660..c87ffd44578 100644
--- a/web/app/components/base/app-icon-picker/index.tsx
+++ b/web/app/components/base/app-icon-picker/index.tsx
@@ -4,16 +4,21 @@ import type { AppIconType, ImageFile } from '@/types/app'
import { Button } from '@langgenius/dify-ui/button'
import { cn } from '@langgenius/dify-ui/cn'
import { Dialog, DialogContent, DialogTitle } from '@langgenius/dify-ui/dialog'
+import { SegmentedControl, SegmentedControlItem } from '@langgenius/dify-ui/segmented-control'
import { Separator } from '@langgenius/dify-ui/separator'
-import { RiImageCircleAiLine } from '@remixicon/react'
import { useState } from 'react'
import { useTranslation } from 'react-i18next'
import { DISABLE_UPLOAD_IMAGE_AS_ICON } from '@/config'
-import { defaultEmojiBackground } from '../emoji-picker/constants'
+import { resolveEmoji } from '@/utils/emoji'
+import {
+ defaultEmojiBackground,
+ getRandomEmoji,
+ getRandomEmojiBackground,
+} from '../emoji-picker/constants'
import EmojiPickerInner from '../emoji-picker/Inner'
+import { addRecentEmoji, useRecentEmojis } from '../emoji-picker/storage'
import { useLocalFileUploader } from '../image-uploader/hooks'
import ImageInput from './ImageInput'
-import s from './style.module.css'
import getCroppedImg from './utils'
export type AppIconEmojiSelection = {
@@ -90,12 +95,12 @@ function AppIconPickerContent({
{
key: 'emoji',
label: t(($) => $['iconPicker.emoji'], { ns: 'app' }),
- icon: <span className="text-lg">🤖</span>,
+ icon: <span className="text-base">🤖</span>,
},
{
key: 'image',
label: t(($) => $['iconPicker.image'], { ns: 'app' }),
- icon: <RiImageCircleAiLine className="size-4" />,
+ icon: <span className="i-ri-image-circle-ai-line size-4" />,
},
]
const [activeTab, setActiveTab] = useState<AppIconType>('emoji')
@@ -105,11 +110,13 @@ function AppIconPickerContent({
if (!initialEmoji?.icon) return undefined
return {
- emoji: initialEmoji.icon,
+ emoji: resolveEmoji(initialEmoji.icon),
background: initialEmoji.background ?? defaultEmojiBackground,
}
})
+ const [, setRecentEmojis] = useRecentEmojis()
+
const [uploading, setUploading] = useState<boolean>()
const { handleLocalFileUpload } = useLocalFileUploader({
@@ -153,6 +160,7 @@ function AppIconPickerContent({
const handleSelect = async () => {
if (activeTab === 'emoji') {
if (emoji) {
+ setRecentEmojis((recent) => addRecentEmoji(recent, emoji.emoji))
onSelect?.({
type: 'emoji',
icon: emoji.emoji,
@@ -181,9 +189,8 @@ function AppIconPickerContent({
<DialogContent
backdropProps={{ forceRender: true }}
className={cn(
- 'w-full overflow-hidden! border-none text-left align-middle',
- s.container,
- 'h-[min(462px,calc(100dvh-2rem))]! max-h-none! w-90.5! p-0!',
+ 'flex max-h-[calc(100dvh-2rem)] w-80.5 flex-col overflow-hidden p-0 text-left',
+ activeTab === 'emoji' && 'h-[min(480px,calc(100dvh-2rem))]',
className,
)}
>
@@ -192,49 +199,80 @@ function AppIconPickerContent({
</DialogTitle>
{showImageUpload && (
- <div className="w-full p-2 pb-0">
- <div className="flex items-center justify-center gap-2 rounded-xl bg-background-body p-1 text-text-primary">
+ <div
+ className={cn(
+ 'w-full shrink-0 px-3 pt-3 pb-2',
+ activeTab === 'image' && 'border-b border-divider-subtle',
+ )}
+ >
+ <SegmentedControl
+ className="flex w-full"
+ aria-label={t(($) => $['iconPicker.emoji'], { ns: 'app' })}
+ value={activeTab}
+ onValueChange={(value) => {
+ setActiveTab(value)
+ setInputImageInfo(undefined)
+ }}
+ >
{tabs.map((tab) => (
- <button
- type="button"
- key={tab.key}
- className={cn(
- 'flex h-8 flex-1 shrink-0 items-center justify-center rounded-lg p-2 system-sm-medium text-text-tertiary',
- activeTab === tab.key &&
- 'bg-components-main-nav-nav-button-bg-active text-text-accent shadow-md',
- )}
- onClick={() => setActiveTab(tab.key as AppIconType)}
- >
- {tab.icon} &nbsp;
- {tab.label}
- </button>
+ <SegmentedControlItem key={tab.key} value={tab.key} className="flex-1">
+ <span className="flex size-5 items-center justify-center" aria-hidden="true">
+ {tab.icon}
+ </span>
+ <span className="p-0.5">{tab.label}</span>
+ </SegmentedControlItem>
))}
- </div>
+ </SegmentedControl>
</div>
)}
{activeTab === 'emoji' && (
<EmojiPickerInner
- className={cn('flex-1 overflow-hidden pt-2')}
- emoji={initialEmoji?.icon}
- background={initialEmoji?.background ?? undefined}
+ className={cn('flex-1 overflow-hidden', !showImageUpload && 'pt-3')}
+ emoji={emoji?.emoji}
+ background={emoji?.background}
onSelect={(emoji, background) => setEmoji({ emoji, background })}
/>
)}
{activeTab === 'image' && (
- <ImageInput className={cn('flex-1 overflow-hidden')} onImageInput={handleImageInput} />
+ <ImageInput className="min-h-0 overflow-y-auto" onImageInput={handleImageInput} />
)}
- <Separator decorative className="m-0 h-[0.5px]" />
- <div className="flex w-full items-center justify-center gap-2 p-3">
- <Button className="w-full" onClick={() => onOpenChange(false)}>
- {t(($) => $['iconPicker.cancel'], { ns: 'app' })}
- </Button>
+ {(activeTab === 'emoji' || inputImageInfo) && (
+ <>
+ <Separator decorative className="m-0 h-[0.5px]" />
+ <div className="flex w-full shrink-0 items-center justify-center gap-2 bg-components-panel-bg-blur p-3 backdrop-blur-sm">
+ {activeTab === 'emoji' ? (
+ <Button
+ className="min-w-0 flex-1"
+ onClick={() =>
+ setEmoji({
+ emoji: getRandomEmoji(emoji?.emoji),
+ background: getRandomEmojiBackground(emoji?.background),
+ })
+ }
+ >
+ <span className="i-ri-dice-line size-4" aria-hidden="true" />
+ {t(($) => $['iconPicker.tryYourLuck'], { ns: 'app' })}
+ </Button>
+ ) : (
+ <Button className="min-w-0 flex-1" onClick={() => onOpenChange(false)}>
+ {t(($) => $['iconPicker.cancel'], { ns: 'app' })}
+ </Button>
+ )}
- <Button variant="primary" className="w-full" loading={uploading} onClick={handleSelect}>
- {t(($) => $['iconPicker.ok'], { ns: 'app' })}
- </Button>
- </div>
+ <Button
+ variant="primary"
+ className="min-w-0 flex-1"
+ disabled={activeTab === 'emoji' ? !emoji : !inputImageInfo}
+ loading={uploading}
+ onClick={handleSelect}
+ >
+ {t(($) => $['iconPicker.ok'], { ns: 'app' })}
+ </Button>
+ </div>
+ </>
+ )}
</DialogContent>
)
}
diff --git a/web/app/components/base/app-icon-picker/style.module.css b/web/app/components/base/app-icon-picker/style.module.css
deleted file mode 100644
index e995275846e..00000000000
--- a/web/app/components/base/app-icon-picker/style.module.css
+++ /dev/null
@@ -1,11 +0,0 @@
-.container {
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- width: 362px;
- max-height: 552px;
- box-shadow:
- 0px 12px 16px -4px rgba(16, 24, 40, 0.08),
- 0px 4px 6px -2px rgba(16, 24, 40, 0.03);
- border-radius: 12px;
-}
diff --git a/web/app/components/base/emoji-picker/Inner.stories.tsx b/web/app/components/base/emoji-picker/Inner.stories.tsx
index 4a630ee0168..14bfd976896 100644
--- a/web/app/components/base/emoji-picker/Inner.stories.tsx
+++ b/web/app/components/base/emoji-picker/Inner.stories.tsx
@@ -10,7 +10,7 @@ const meta = {
docs: {
description: {
component:
- 'Core emoji grid with search and style swatches. Use this when embedding the selector inline without a modal frame.',
+ 'Core emoji grid with search, recent selections, and recommendations. Use this when embedding the selector inline without a modal frame.',
},
},
},
@@ -26,15 +26,14 @@ const InnerDemo = () => {
return (
<div className="flex h-130 flex-col gap-4 rounded-xl border border-divider-subtle bg-components-panel-bg p-6 shadow-lg">
<EmojiPickerInner
+ emoji={selection?.emoji}
onSelect={(emoji, background) => setSelection({ emoji, background })}
className="flex-1 overflow-hidden rounded-xl border border-divider-subtle bg-white"
/>
<div className="rounded-lg border border-divider-subtle bg-background-default-subtle p-3 text-xs text-text-secondary">
<div className="font-medium text-text-primary">Latest selection</div>
<pre className="mt-1 max-h-40 overflow-auto font-mono">
- {selection
- ? JSON.stringify(selection, null, 2)
- : 'Tap an emoji to set background options.'}
+ {selection ? JSON.stringify(selection, null, 2) : 'Tap an emoji to select it.'}
</pre>
</div>
</div>
diff --git a/web/app/components/base/emoji-picker/Inner.tsx b/web/app/components/base/emoji-picker/Inner.tsx
index 89b6addc49e..4feeda8108b 100644
--- a/web/app/components/base/emoji-picker/Inner.tsx
+++ b/web/app/components/base/emoji-picker/Inner.tsx
@@ -1,14 +1,14 @@
'use client'
+import type { EmojiPickerListEmojiProps } from 'frimousse'
import { cn } from '@langgenius/dify-ui/cn'
-import { InputGroup, InputGroupAddon } from '@langgenius/dify-ui/input-group'
-import { Separator } from '@langgenius/dify-ui/separator'
import { EmojiPicker } from 'frimousse'
import * as React from 'react'
-import { useState } from 'react'
+import { createContext, use, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { resolveEmoji } from '@/utils/emoji'
import { basePath } from '@/utils/var'
-import { backgroundColors, defaultEmojiBackground } from './constants'
+import { defaultEmojiBackground, emojiStyles, recommendedEmojis } from './constants'
+import { useRecentEmojisValue } from './storage'
type IEmojiPickerInnerProps = {
emoji?: string
@@ -17,142 +17,190 @@ type IEmojiPickerInnerProps = {
className?: string
}
+const emojiButtonClassName =
+ 'flex h-8 w-full min-w-0 max-w-8 flex-1 items-center justify-center rounded-lg text-2xl leading-none hover:bg-state-base-hover focus-visible:outline-2 focus-visible:outline-state-accent-solid data-[active]:bg-state-base-hover aria-pressed:ring-[1.5px] aria-pressed:ring-components-option-card-option-selected-border aria-pressed:ring-inset'
+
+const SelectedEmojiContext = createContext('')
+
+function EmojiButton({ emoji, ...props }: EmojiPickerListEmojiProps) {
+ const selectedEmoji = use(SelectedEmojiContext)
+ return (
+ <button
+ {...props}
+ type="button"
+ aria-pressed={selectedEmoji === emoji.emoji}
+ className={emojiButtonClassName}
+ >
+ {emoji.emoji}
+ </button>
+ )
+}
+
const listComponents: NonNullable<React.ComponentProps<typeof EmojiPicker.List>['components']> = {
CategoryHeader: ({ category, ...props }) => (
<div
{...props}
- className="bg-components-panel-bg px-3 pb-1 system-xs-medium-uppercase text-text-primary"
+ className="bg-components-panel-bg px-3.5 py-1 system-xs-medium-uppercase text-text-tertiary"
>
{category.label}
</div>
),
Row: ({ children, ...props }) => (
- <div {...props} className="scroll-my-1 gap-1 px-3 pb-1">
+ <div {...props} className="scroll-my-1 gap-px px-3 pb-px">
{children}
</div>
),
- Emoji: ({ emoji, ...props }) => (
- <button
- {...props}
- type="button"
- className="flex h-10 min-w-0 flex-1 items-center justify-center rounded-lg text-xl focus-visible:outline-2 focus-visible:outline-offset-2 data-[active]:bg-state-base-hover"
- >
- {emoji.emoji}
- </button>
- ),
+ Emoji: EmojiButton,
}
function EmojiPickerInner({ emoji, background, onSelect, className }: IEmojiPickerInnerProps) {
const { t } = useTranslation()
- const [selectedEmoji, setSelectedEmoji] = useState(() => (emoji ? resolveEmoji(emoji) : ''))
- const [selectedBackground, setSelectedBackground] = useState(background || defaultEmojiBackground)
- const [showStyleColors, setShowStyleColors] = useState(!!emoji)
-
- const styleColorsLabelId = React.useId()
+ const [search, setSearch] = useState('')
+ const scrollRef = useRef<HTMLDivElement>(null)
+ const recentEmojis = useRecentEmojisValue()
+ const selectedEmoji = emoji ? resolveEmoji(emoji) : ''
+ const handleEmojiSelect = (value: string) =>
+ onSelect?.(value, background || defaultEmojiBackground)
- const handleEmojiSelect = (emoji: string) => {
- setSelectedEmoji(emoji)
- setShowStyleColors(true)
- onSelect?.(emoji, selectedBackground)
- }
-
- const handleBackgroundSelect = (background: string) => {
- setSelectedBackground(background)
- if (selectedEmoji) onSelect?.(selectedEmoji, background)
- }
-
- return (
- <div className={cn(className, 'flex min-h-0 w-full min-w-0 flex-col')}>
- <EmojiPicker.Root
- className="flex min-h-0 flex-1 flex-col"
- locale="en"
- columns={8}
- emojibaseUrl={`${basePath}/emoji/emojibase-17.0.0`}
- onEmojiSelect={({ emoji }) => handleEmojiSelect(emoji)}
- >
- <div className="px-3 pb-2">
- <InputGroup>
- <EmojiPicker.Search
- aria-label={t(($) => $['operation.search'], { ns: 'common' })}
- placeholder={t(($) => $['operation.search'], { ns: 'common' })}
- className="h-8 min-w-0 flex-1 bg-transparent px-3 text-sm outline-none focus-visible:ring-2 focus-visible:ring-components-input-border-hover"
- />
- <InputGroupAddon className="ps-3 pe-2">
- <span
- className="i-heroicons-magnifying-glass size-5 text-text-quaternary"
- aria-hidden="true"
- />
- </InputGroupAddon>
- </InputGroup>
- </div>
- <Separator decorative className="my-3 h-[0.5px]" />
- <EmojiPicker.Viewport className="relative h-50 min-h-0 w-full overflow-x-hidden overflow-y-auto">
- <EmojiPicker.Loading className="block p-3 text-text-tertiary">
- {t(($) => $.loading, { ns: 'common' })}
- </EmojiPicker.Loading>
- <EmojiPicker.Empty className="block p-3 text-text-tertiary">
- {t(($) => $.noData, { ns: 'common' })}
- </EmojiPicker.Empty>
- <EmojiPicker.List components={listComponents} />
- </EmojiPicker.Viewport>
- </EmojiPicker.Root>
-
- {/* Color Select */}
- <div className={cn('flex shrink-0 items-center justify-between p-3 pb-0')}>
- <p id={styleColorsLabelId} className="mb-2 system-xs-medium-uppercase text-text-primary">
- Choose Style
- </p>
- {showStyleColors ? (
+ const renderGroup = (label: string, emojis: string[]) => (
+ <section aria-label={label} className="px-3 pb-2">
+ <h3 className="px-0.5 py-1 system-xs-medium-uppercase text-text-tertiary">{label}</h3>
+ <div className="grid grid-cols-9 gap-px">
+ {emojis.map((value) => (
<button
+ key={value}
type="button"
- aria-labelledby={styleColorsLabelId}
- aria-expanded="true"
- className="i-heroicons-chevron-down size-4 cursor-pointer border-none bg-transparent p-0 text-text-quaternary focus-visible:outline-2 focus-visible:outline-offset-2"
- onClick={() => setShowStyleColors(!showStyleColors)}
+ aria-label={value}
+ aria-pressed={selectedEmoji === value}
+ className={emojiButtonClassName}
+ onClick={() => handleEmojiSelect(value)}
+ >
+ {value}
+ </button>
+ ))}
+ </div>
+ </section>
+ )
+
+ return (
+ <EmojiPicker.Root
+ className={cn('flex min-h-0 w-full min-w-0 flex-col', className)}
+ locale="en"
+ columns={9}
+ emojibaseUrl={`${basePath}/emoji/emojibase-17.0.0`}
+ onEmojiSelect={({ emoji }) => handleEmojiSelect(emoji)}
+ onKeyUp={(event) => {
+ if (
+ ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)
+ ) {
+ scrollRef.current
+ ?.querySelector<HTMLElement>('[frimousse-emoji][data-active]')
+ ?.scrollIntoView({ block: 'nearest' })
+ }
+ }}
+ >
+ <div className="shrink-0 border-b border-divider-subtle px-3 pb-2">
+ <div className="flex h-8 items-center gap-1.5 rounded-lg border border-transparent bg-components-input-bg-normal px-2 focus-within:border-components-input-border-active focus-within:bg-components-input-bg-active">
+ <span
+ className="i-ri-search-line size-4 shrink-0 text-components-input-text-placeholder"
+ aria-hidden="true"
/>
- ) : (
- <button
- type="button"
- aria-labelledby={styleColorsLabelId}
- aria-expanded="false"
- className="i-heroicons-chevron-up size-4 cursor-pointer border-none bg-transparent p-0 text-text-quaternary focus-visible:outline-2 focus-visible:outline-offset-2"
- onClick={() => setShowStyleColors(!showStyleColors)}
+ <EmojiPicker.Search
+ aria-label={t(($) => $['iconPicker.search'], { ns: 'app' })}
+ placeholder={t(($) => $['iconPicker.search'], { ns: 'app' })}
+ value={search}
+ onChange={(event) => {
+ setSearch(event.target.value)
+ scrollRef.current?.scrollTo({ top: 0 })
+ }}
+ className="h-full min-w-0 flex-1 appearance-none border-0 bg-transparent p-0 system-sm-regular text-components-input-text-filled outline-none placeholder:text-components-input-text-placeholder [&::-webkit-search-cancel-button]:appearance-none"
/>
- )}
+ </div>
+ </div>
+ <div
+ ref={scrollRef}
+ role="region"
+ aria-label={t(($) => $['iconPicker.emoji'], { ns: 'app' })}
+ className="min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain"
+ style={{ scrollbarWidth: 'none' }}
+ >
+ <div className="py-2">
+ {!search && (
+ <div className="shrink-0">
+ {!!recentEmojis.length &&
+ renderGroup(
+ t(($) => $['iconPicker.recent'], { ns: 'app' }),
+ recentEmojis,
+ )}
+ {renderGroup(
+ t(($) => $['iconPicker.recommend'], { ns: 'app' }),
+ recommendedEmojis,
+ )}
+ </div>
+ )}
+ <EmojiPicker.Viewport
+ className="relative w-full"
+ // The outer scroller owns all groups; let this viewport grow with its list.
+ style={{
+ contain: 'none',
+ containIntrinsicSize: 'none',
+ overflow: 'visible',
+ scrollbarGutter: 'auto',
+ willChange: 'auto',
+ }}
+ >
+ <EmojiPicker.Loading className="block p-3 text-text-tertiary">
+ {t(($) => $.loading, { ns: 'common' })}
+ </EmojiPicker.Loading>
+ <EmojiPicker.Empty className="block p-3 text-text-tertiary">
+ {t(($) => $.noData, { ns: 'common' })}
+ </EmojiPicker.Empty>
+ <SelectedEmojiContext value={selectedEmoji}>
+ <EmojiPicker.List components={listComponents} />
+ </SelectedEmojiContext>
+ </EmojiPicker.Viewport>
+ </div>
</div>
- {showStyleColors && (
- <div className="grid w-full shrink-0 grid-cols-8 gap-1 px-3">
- {backgroundColors.map((color) => {
- return (
+ {selectedEmoji && (
+ <section
+ aria-label={t(($) => $['iconPicker.chooseStyle'], { ns: 'app' })}
+ className="shrink-0 border-t border-divider-subtle bg-components-panel-bg-blur px-3 pt-2 pb-3 backdrop-blur-sm"
+ >
+ <h3 className="px-0.5 py-1 system-xs-semibold-uppercase text-text-primary">
+ {t(($) => $['iconPicker.chooseStyle'], { ns: 'app' })}
+ </h3>
+ <div className="grid grid-cols-6 justify-items-center gap-0.75 pt-0.5">
+ {emojiStyles.map((style) => (
<button
+ key={style.background}
type="button"
- key={color}
- aria-label={color}
+ aria-label={style.background}
+ aria-pressed={
+ (background || defaultEmojiBackground).toUpperCase() === style.background
+ }
className={cn(
- 'cursor-pointer focus-visible:outline-2 focus-visible:outline-offset-2',
- 'border-none bg-transparent p-0',
- 'ring-components-input-border-hover ring-offset-1 hover:ring-1',
- 'inline-flex h-10 w-full min-w-0 items-center justify-center rounded-lg',
- color === selectedBackground ? 'ring-1 ring-components-input-border-hover' : '',
+ 'flex aspect-square w-full max-w-11.5 items-center justify-center rounded-xl p-0.75 ring-inset focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-state-accent-solid',
+ (background || defaultEmojiBackground).toUpperCase() === style.background && [
+ 'ring-[1.5px]',
+ style.selectedClassName,
+ ],
)}
- onClick={() => {
- handleBackgroundSelect(color)
- }}
+ onClick={() => onSelect?.(selectedEmoji, style.background)}
>
<span
className={cn(
- 'flex size-8 max-w-full items-center justify-center rounded-lg p-1 text-xl',
+ 'flex aspect-square w-full items-center justify-center rounded-[10px] border-[0.5px] border-divider-regular text-2xl leading-none',
+ style.backgroundClassName,
)}
- style={{ background: color }}
>
{selectedEmoji}
</span>
</button>
- )
- })}
- </div>
+ ))}
+ </div>
+ </section>
)}
- </div>
+ </EmojiPicker.Root>
)
}
export default EmojiPickerInner
diff --git a/web/app/components/base/emoji-picker/__tests__/Inner.browser.spec.tsx b/web/app/components/base/emoji-picker/__tests__/Inner.browser.spec.tsx
index 500ec454afe..23ba8215b86 100644
--- a/web/app/components/base/emoji-picker/__tests__/Inner.browser.spec.tsx
+++ b/web/app/components/base/emoji-picker/__tests__/Inner.browser.spec.tsx
@@ -1,14 +1,13 @@
import { page, userEvent } from 'vite-plus/test/browser'
import { render } from 'vitest-browser-react'
import AppIconPicker from '../../app-icon-picker'
-import { backgroundColors } from '../constants'
import EmojiPickerInner from '../Inner'
-// Real layout is needed to verify virtualized rows remain reachable using the keyboard.
-it('selects a searched emoji with the keyboard and keeps style controls usable', async () => {
+// Real layout verifies keyboard navigation scrolls the shared list to the active row.
+it('selects a searched emoji and scrolls to later rows with the keyboard', async () => {
const onSelect = vi.fn()
await render(
- <div style={{ width: 380 }}>
+ <div style={{ width: 322, height: 480, display: 'flex' }}>
<EmojiPickerInner onSelect={onSelect} />
</div>,
)
@@ -16,9 +15,7 @@ it('selects a searched emoji with the keyboard and keeps style controls usable',
await search.fill('rabbit face')
await expect.element(page.getByRole('gridcell', { name: 'Rabbit face' })).toBeVisible()
await userEvent.keyboard('{Enter}')
- await expect.poll(() => onSelect.mock.lastCall).toEqual(['🐰', '#FFEAD5'])
- await page.getByRole('button', { name: '#E4FBCC' }).click()
- expect(onSelect).toHaveBeenLastCalledWith('🐰', '#E4FBCC')
+ await expect.poll(() => onSelect.mock.lastCall).toEqual(['🐰', '#FEF3F2'])
await search.fill('')
await expect
.element(page.getByRole('gridcell', { name: 'Grinning face', exact: true }))
@@ -27,57 +24,48 @@ it('selects a searched emoji with the keyboard and keeps style controls usable',
await userEvent.keyboard(
'{ArrowDown}{ArrowDown}{ArrowDown}{ArrowDown}{ArrowDown}{ArrowDown}{Enter}',
)
- expect(onSelect).toHaveBeenCalledTimes(3)
+ expect(onSelect).toHaveBeenCalledTimes(2)
})
-// The production dialog is narrower than the old fixed-width eight-column grid.
-// Verify every edge option is visible and clickable, rather than hiding overflow.
-it('fits emoji and style options inside the app icon dialog', async () => {
- const originalFontSize = document.documentElement.style.fontSize
- document.documentElement.style.fontSize = '16px'
- onTestFinished(() => {
- document.documentElement.style.fontSize = originalFontSize
- })
+// Guard against the scrollbar clipping the ninth column or the footer obscuring selectable rows.
+it('keeps the rightmost emoji clickable inside the app icon dialog', async () => {
const onSelect = vi.fn()
- await render(
- <AppIconPicker
- open
- onOpenChange={() => {}}
- onSelect={onSelect}
- initialEmoji={{ icon: 'robot_face' }}
- />,
- )
- const dialog = page.getByRole('dialog')
- const firstEmoji = page.getByRole('gridcell', { name: 'Grinning face', exact: true })
- await expect.element(firstEmoji).toBeVisible()
- const bounds = dialog.element().getBoundingClientRect()
- const options = [
- ...dialog.element().querySelectorAll('[role="row"] [role="gridcell"]'),
- ...backgroundColors.map((color) =>
- page.getByRole('button', { name: color, exact: true }).element(),
- ),
- ]
- for (const option of options) {
- const rect = option.getBoundingClientRect()
- expect(rect.left).toBeGreaterThanOrEqual(bounds.left)
- expect(rect.right).toBeLessThanOrEqual(bounds.right)
- }
- const footerTop = page
- .getByRole('button', { name: 'app.iconPicker.ok', exact: true })
- .element()
- .getBoundingClientRect().top
- for (const color of backgroundColors) {
- expect(
- page.getByRole('button', { name: color, exact: true }).element().getBoundingClientRect()
- .bottom,
- ).toBeLessThanOrEqual(footerTop)
- }
- await page.getByRole('gridcell', { name: 'Face with tears of joy', exact: true }).click()
- await page.getByRole('button', { name: backgroundColors.at(-1)!, exact: true }).click()
+ await render(<AppIconPicker open onOpenChange={() => {}} onSelect={onSelect} />)
+ const option = page.getByRole('gridcell', { name: 'Slightly smiling face', exact: true })
+ await expect.element(option).toBeVisible()
+ const dialogBounds = page.getByRole('dialog').element().getBoundingClientRect()
+ const optionBounds = option.element().getBoundingClientRect()
+ expect(optionBounds.right).toBeLessThanOrEqual(dialogBounds.right)
+ await option.click()
await page.getByRole('button', { name: 'app.iconPicker.ok', exact: true }).click()
- expect(onSelect).toHaveBeenCalledWith({
- type: 'emoji',
- icon: '😂',
- background: backgroundColors.at(-1),
- })
+ expect(onSelect).toHaveBeenCalledWith({ type: 'emoji', icon: '🙂', background: '#FEF3F2' })
+})
+
+// The old layout pinned recommendations while only the category grid scrolled.
+it('scrolls recommendations and categories together while keeping search and actions fixed', async () => {
+ await render(<AppIconPicker open onOpenChange={() => {}} initialEmoji={{ icon: '🤖' }} />)
+ await expect
+ .element(page.getByRole('gridcell', { name: 'Grinning face', exact: true }))
+ .toBeVisible()
+ const scroller = page.getByRole('region', { name: 'app.iconPicker.emoji', exact: true }).element()
+ const recommendation = page.getByRole('region', { name: 'app.iconPicker.recommend' }).element()
+ const search = page.getByRole('searchbox').element()
+ const confirm = page.getByRole('button', { name: 'app.iconPicker.ok', exact: true }).element()
+ const styles = page.getByRole('region', { name: 'app.iconPicker.chooseStyle' }).element()
+ const stylesTop = styles.getBoundingClientRect().top
+ const searchTop = search.getBoundingClientRect().top
+ const confirmTop = confirm.getBoundingClientRect().top
+ scroller.scrollTo({ top: 400 })
+ await expect
+ .poll(() => recommendation.getBoundingClientRect().bottom)
+ .toBeLessThan(scroller.getBoundingClientRect().top)
+ const category = page.getByText('Smileys & emotion', { exact: true }).element()
+ expect(category.getBoundingClientRect().top).toBe(scroller.getBoundingClientRect().top)
+ expect(styles.getBoundingClientRect().top).toBe(stylesTop)
+ await page.getByRole('button', { name: '#F0F2F5', exact: true }).click()
+ await expect
+ .element(page.getByRole('button', { name: '#F0F2F5', exact: true }))
+ .toHaveAttribute('aria-pressed', 'true')
+ expect(search.getBoundingClientRect().top).toBe(searchTop)
+ expect(confirm.getBoundingClientRect().top).toBe(confirmTop)
})
diff --git a/web/app/components/base/emoji-picker/__tests__/Inner.spec.tsx b/web/app/components/base/emoji-picker/__tests__/Inner.spec.tsx
index 74b67300aca..850abc333f9 100644
--- a/web/app/components/base/emoji-picker/__tests__/Inner.spec.tsx
+++ b/web/app/components/base/emoji-picker/__tests__/Inner.spec.tsx
@@ -1,55 +1,36 @@
-import { fireEvent, render, screen, waitFor } from '@testing-library/react'
+import { render, screen } from '@testing-library/react'
+import userEvent from '@testing-library/user-event'
import { mockEmojiData } from '@/test/emoji-picker'
import EmojiPickerInner from '../Inner'
vi.mock('@/utils/var', () => ({ basePath: '/console' }))
-
mockEmojiData()
-describe('EmojiPickerInner', () => {
- it('selects Unicode from self-hosted data and preserves the chosen background', async () => {
- const onSelect = vi.fn()
- render(<EmojiPickerInner onSelect={onSelect} />)
- fireEvent.click(await screen.findByRole('gridcell', { name: 'Grinning face' }))
- expect(onSelect).toHaveBeenLastCalledWith('😀', '#FFEAD5')
- fireEvent.click(screen.getByRole('button', { name: '#E4FBCC' }))
- expect(onSelect).toHaveBeenLastCalledWith('😀', '#E4FBCC')
- expect(fetch).toHaveBeenCalledTimes(2)
- expect(fetch).toHaveBeenCalledWith(
- '/console/emoji/emojibase-17.0.0/en/data.json',
- expect.any(Object),
- )
- expect(fetch).toHaveBeenCalledWith(
- '/console/emoji/emojibase-17.0.0/en/messages.json',
- expect.any(Object),
- )
- })
-
- it('filters search, selects a result, shows empty state and restores categories on clear', async () => {
- const onSelect = vi.fn()
- render(<EmojiPickerInner onSelect={onSelect} />)
- await screen.findByRole('gridcell', { name: 'Grinning face' })
- const search = screen.getByRole('searchbox')
- fireEvent.change(search, { target: { value: 'rabbit' } })
- fireEvent.click(await screen.findByRole('gridcell', { name: 'Rabbit face' }))
- expect(onSelect).toHaveBeenLastCalledWith('🐰', '#FFEAD5')
- fireEvent.change(search, { target: { value: 'zzzz-no-emoji' } })
- await screen.findByText('common.noData')
- fireEvent.change(search, { target: { value: '' } })
- await screen.findByRole('gridcell', { name: 'Grinning face' })
- })
+it('selects Unicode from self-hosted data while preserving the existing background', async () => {
+ const user = userEvent.setup()
+ const onSelect = vi.fn()
+ render(<EmojiPickerInner background="#E4FBCC" onSelect={onSelect} />)
+ await user.click(await screen.findByRole('gridcell', { name: 'Grinning face' }))
+ expect(onSelect).toHaveBeenCalledWith('😀', '#E4FBCC')
+ expect(fetch).toHaveBeenCalledWith(
+ '/console/emoji/emojibase-17.0.0/en/data.json',
+ expect.any(Object),
+ )
+})
- it('resolves a saved ID in style previews and only emits after a user action', async () => {
- const onSelect = vi.fn()
- render(<EmojiPickerInner emoji="rabbit" onSelect={onSelect} />)
- const color = screen.getByRole('button', { name: '#E4FBCC' })
- expect(color).toHaveTextContent('🐰')
- expect(onSelect).not.toHaveBeenCalled()
- fireEvent.click(color)
- expect(onSelect).toHaveBeenCalledWith('🐰', '#E4FBCC')
- fireEvent.click(screen.getByRole('button', { name: 'Choose Style' }))
- await waitFor(() =>
- expect(screen.queryByRole('button', { name: '#E4FBCC' })).not.toBeInTheDocument(),
- )
- })
+it('filters search, selects a result, shows empty state and restores recommendations on clear', async () => {
+ const user = userEvent.setup()
+ const onSelect = vi.fn()
+ render(<EmojiPickerInner onSelect={onSelect} />)
+ const search = screen.getByRole('searchbox')
+ await user.type(search, 'rabbit')
+ await user.click(await screen.findByRole('gridcell', { name: 'Rabbit face' }))
+ expect(onSelect).toHaveBeenLastCalledWith('🐰', '#FEF3F2')
+ expect(screen.queryByRole('region', { name: 'app.iconPicker.recommend' })).not.toBeInTheDocument()
+ await user.clear(search)
+ await user.type(search, 'zzzz-no-emoji')
+ await screen.findByText('common.noData')
+ await user.clear(search)
+ expect(screen.getByRole('region', { name: 'app.iconPicker.recommend' })).toBeInTheDocument()
+ await screen.findByRole('gridcell', { name: 'Grinning face' })
})
diff --git a/web/app/components/base/emoji-picker/__tests__/index.spec.tsx b/web/app/components/base/emoji-picker/__tests__/index.spec.tsx
index b0d8d41a7c7..17f8ce27181 100644
--- a/web/app/components/base/emoji-picker/__tests__/index.spec.tsx
+++ b/web/app/components/base/emoji-picker/__tests__/index.spec.tsx
@@ -1,4 +1,5 @@
import { act, fireEvent, render, screen } from '@testing-library/react'
+import userEvent from '@testing-library/user-event'
import { mockEmojiData } from '@/test/emoji-picker'
import EmojiPicker from '../index'
@@ -23,8 +24,8 @@ describe('EmojiPicker', () => {
render(<EmojiPicker open onOpenChange={mockOnOpenChange} />)
})
expect(screen.getByRole('dialog', { name: /Emoji/i }))!.toBeInTheDocument()
- expect(screen.getByPlaceholderText('common.operation.search'))!.toBeInTheDocument()
- expect(screen.getByText(/Cancel/i))!.toBeInTheDocument()
+ expect(screen.getByPlaceholderText('app.iconPicker.search'))!.toBeInTheDocument()
+ expect(screen.getByText(/tryYourLuck/i))!.toBeInTheDocument()
expect(screen.getByText(/OK/i))!.toBeInTheDocument()
})
@@ -55,16 +56,20 @@ describe('EmojiPicker', () => {
expect(mockOnSelect).toHaveBeenCalledWith(expect.any(String), expect.any(String))
})
- it('closes when Cancel is clicked', async () => {
- await act(async () => {
- render(<EmojiPicker open onOpenChange={mockOnOpenChange} />)
- })
-
- const cancelButton = screen.getByText(/Cancel/i)
- await act(async () => {
- fireEvent.click(cancelButton)
- })
-
+ it('randomizes emoji and background without submitting until confirmed', async () => {
+ vi.spyOn(Math, 'random').mockReturnValue(0)
+ const user = userEvent.setup()
+ render(<EmojiPicker open onOpenChange={mockOnOpenChange} onSelect={mockOnSelect} />)
+ await user.click(screen.getByRole('button', { name: /tryYourLuck/i }))
+ expect(mockOnSelect).not.toHaveBeenCalled()
+ expect(mockOnOpenChange).not.toHaveBeenCalled()
+ expect(screen.getByRole('button', { name: /ok/i })).toBeEnabled()
+ await user.click(screen.getByRole('button', { name: /ok/i }))
+ expect(screen.getByRole('button', { name: '#FFF1F3' })).toHaveAttribute(
+ 'aria-pressed',
+ 'true',
+ )
+ expect(mockOnSelect).toHaveBeenCalledWith('😃', '#FFF1F3')
expect(mockOnOpenChange).toHaveBeenCalledWith(false)
})
})
diff --git a/web/app/components/base/emoji-picker/constants.ts b/web/app/components/base/emoji-picker/constants.ts
index 927520cb385..7794604b79f 100644
--- a/web/app/components/base/emoji-picker/constants.ts
+++ b/web/app/components/base/emoji-picker/constants.ts
@@ -1,23 +1,102 @@
-export const backgroundColors = [
- '#FFEAD5',
- '#E4FBCC',
- '#D3F8DF',
- '#E0F2FE',
-
- '#E0EAFF',
- '#EFF1F5',
- '#FBE8FF',
- '#FCE7F6',
+export const emojiStyles = [
+ {
+ background: '#FEF3F2',
+ backgroundClassName: 'bg-components-icon-bg-red-soft',
+ selectedClassName: 'ring-util-colors-red-red-400',
+ },
+ {
+ background: '#FFF1F3',
+ backgroundClassName: 'bg-components-icon-bg-rose-soft',
+ selectedClassName: 'ring-util-colors-rose-rose-400',
+ },
+ {
+ background: '#FDF2FA',
+ backgroundClassName: 'bg-components-icon-bg-pink-soft',
+ selectedClassName: 'ring-util-colors-pink-pink-400',
+ },
+ {
+ background: '#FFF4ED',
+ backgroundClassName: 'bg-components-icon-bg-orange-dark-soft',
+ selectedClassName: 'ring-util-colors-orange-dark-orange-dark-400',
+ },
+ {
+ background: '#FEFBE8',
+ backgroundClassName: 'bg-components-icon-bg-yellow-soft',
+ selectedClassName: 'ring-util-colors-yellow-yellow-400',
+ },
+ {
+ background: '#F3FEE7',
+ backgroundClassName: 'bg-components-icon-bg-green-soft',
+ selectedClassName: 'ring-util-colors-green-green-400',
+ },
+ {
+ background: '#F0FDF9',
+ backgroundClassName: 'bg-components-icon-bg-teal-soft',
+ selectedClassName: 'ring-util-colors-teal-teal-400',
+ },
+ {
+ background: '#F0F9FF',
+ backgroundClassName: 'bg-components-icon-bg-blue-light-soft',
+ selectedClassName: 'ring-util-colors-blue-light-blue-light-400',
+ },
+ {
+ background: '#E9F0FF',
+ backgroundClassName: 'bg-components-icon-bg-blue-soft',
+ selectedClassName: 'ring-util-colors-blue-blue-400',
+ },
+ {
+ background: '#F5F3FF',
+ backgroundClassName: 'bg-components-icon-bg-violet-soft',
+ selectedClassName: 'ring-util-colors-violet-violet-400',
+ },
+ {
+ background: '#EEF4FF',
+ backgroundClassName: 'bg-components-icon-bg-indigo-soft',
+ selectedClassName: 'ring-util-colors-indigo-indigo-400',
+ },
+ {
+ background: '#F0F2F5',
+ backgroundClassName: 'bg-components-icon-bg-midnight-soft',
+ selectedClassName: 'ring-util-colors-midnight-midnight-400',
+ },
+]
- '#FEF7C3',
- '#E6F4D7',
- '#D5F5F6',
- '#D1E9FF',
+export const defaultEmojiBackground = emojiStyles[0]!.background
- '#D1E0FF',
- '#D5D9EB',
- '#ECE9FE',
- '#FFE4E8',
+export const recommendedEmojis = [
+ '😃',
+ '😆',
+ '🥹',
+ '😅',
+ '😂',
+ '🤣',
+ '🥲',
+ '☺️',
+ '😊',
+ '😇',
+ '🙂',
+ '😍',
+ '😘',
+ '😙',
+ '😝',
+ '🤪',
+ '🤓',
+ '😎',
+ '🥸',
+ '🤩',
+ '🥳',
+ '😤',
+ '🤯',
+ '🥵',
+ '🥶',
]
-export const defaultEmojiBackground = backgroundColors[0]!
+export function getRandomEmoji(current?: string) {
+ const candidates = recommendedEmojis.filter((emoji) => emoji !== current)
+ return candidates[Math.floor(Math.random() * candidates.length)]!
+}
+
+export function getRandomEmojiBackground(current = defaultEmojiBackground) {
+ const candidates = emojiStyles.filter((style) => style.background !== current.toUpperCase())
+ return candidates[Math.floor(Math.random() * candidates.length)]!.background
+}
diff --git a/web/app/components/base/emoji-picker/index.stories.tsx b/web/app/components/base/emoji-picker/index.stories.tsx
index e8849ab9f74..94e61e5b167 100644
--- a/web/app/components/base/emoji-picker/index.stories.tsx
+++ b/web/app/components/base/emoji-picker/index.stories.tsx
@@ -10,7 +10,7 @@ const meta = {
docs: {
description: {
component:
- 'Modal-based emoji selector that powers the icon picker. Supports search, background swatches, and confirmation callbacks.',
+ 'Modal-based emoji selector that powers the icon picker. Supports search, recent selections, random selection, and confirmation callbacks.',
},
},
nextjs: {
diff --git a/web/app/components/base/emoji-picker/index.tsx b/web/app/components/base/emoji-picker/index.tsx
index bf40356ccc5..fe00163f1f2 100644
--- a/web/app/components/base/emoji-picker/index.tsx
+++ b/web/app/components/base/emoji-picker/index.tsx
@@ -5,7 +5,9 @@ import { Dialog, DialogContent, DialogTitle } from '@langgenius/dify-ui/dialog'
import { Separator } from '@langgenius/dify-ui/separator'
import { useState } from 'react'
import { useTranslation } from 'react-i18next'
+import { defaultEmojiBackground, getRandomEmoji, getRandomEmojiBackground } from './constants'
import EmojiPickerInner from './Inner'
+import { addRecentEmoji, useRecentEmojis } from './storage'
type EmojiPickerProps = {
open: boolean
@@ -33,13 +35,13 @@ type EmojiPickerContentProps = {
function EmojiPickerContent({ className, onOpenChange, onSelect }: EmojiPickerContentProps) {
const { t } = useTranslation()
const [selectedEmoji, setSelectedEmoji] = useState('')
- const [selectedBackground, setSelectedBackground] = useState<string>()
+ const [selectedBackground, setSelectedBackground] = useState(defaultEmojiBackground)
+ const [, setRecentEmojis] = useRecentEmojis()
return (
<DialogContent
className={cn(
- 'max-h-none w-full overflow-hidden! text-left align-middle',
- 'flex max-h-138 flex-col rounded-xl border-[0.5px] border-divider-subtle p-0 shadow-xl',
+ 'flex h-[min(480px,calc(100dvh-2rem))] max-h-none w-80.5 flex-col overflow-hidden p-0 text-left',
className,
)}
>
@@ -48,23 +50,33 @@ function EmojiPickerContent({ className, onOpenChange, onSelect }: EmojiPickerCo
</DialogTitle>
<EmojiPickerInner
- className="pt-3"
+ className="flex-1 overflow-hidden pt-3"
+ emoji={selectedEmoji}
+ background={selectedBackground}
onSelect={(emoji, background) => {
setSelectedEmoji(emoji)
setSelectedBackground(background)
}}
/>
- <Separator decorative className="mt-3 mb-0 h-[0.5px]" />
- <div className="flex w-full items-center justify-center gap-2 p-3">
- <Button className="w-full" onClick={() => onOpenChange(false)}>
- {t(($) => $['iconPicker.cancel'], { ns: 'app' })}
+ <Separator decorative className="m-0 h-[0.5px]" />
+ <div className="flex w-full shrink-0 items-center justify-center gap-2 bg-components-panel-bg-blur p-3 backdrop-blur-sm">
+ <Button
+ className="min-w-0 flex-1"
+ onClick={() => {
+ setSelectedEmoji(getRandomEmoji(selectedEmoji))
+ setSelectedBackground(getRandomEmojiBackground(selectedBackground))
+ }}
+ >
+ <span className="i-ri-dice-line size-4" aria-hidden="true" />
+ {t(($) => $['iconPicker.tryYourLuck'], { ns: 'app' })}
</Button>
<Button
disabled={selectedEmoji === '' || !selectedBackground}
variant="primary"
- className="w-full"
+ className="min-w-0 flex-1"
onClick={() => {
- onSelect?.(selectedEmoji, selectedBackground!)
+ setRecentEmojis((recent) => addRecentEmoji(recent, selectedEmoji))
+ onSelect?.(selectedEmoji, selectedBackground)
onOpenChange(false)
}}
>
diff --git a/web/app/components/base/emoji-picker/storage.ts b/web/app/components/base/emoji-picker/storage.ts
new file mode 100644
index 00000000000..6912b77838c
--- /dev/null
+++ b/web/app/components/base/emoji-picker/storage.ts
@@ -0,0 +1,10 @@
+import { createLocalStorageState } from 'foxact/create-local-storage-state'
+
+export const [useRecentEmojis, useRecentEmojisValue] = createLocalStorageState<string[]>(
+ 'dify-icon-picker-recent-emojis',
+ [],
+)
+
+export function addRecentEmoji(recent: string[] | null, emoji: string) {
+ return [emoji, ...(recent ?? []).filter((item) => item !== emoji)].slice(0, 9)
+}
diff --git a/web/app/components/datasets/create-from-pipeline/list/template-card/__tests__/edit-pipeline-info.spec.tsx b/web/app/components/datasets/create-from-pipeline/list/template-card/__tests__/edit-pipeline-info.spec.tsx
index 52527e64d48..0764c7f3c72 100644
--- a/web/app/components/datasets/create-from-pipeline/list/template-card/__tests__/edit-pipeline-info.spec.tsx
+++ b/web/app/components/datasets/create-from-pipeline/list/template-card/__tests__/edit-pipeline-info.spec.tsx
@@ -283,7 +283,7 @@ describe('EditPipelineInfo', () => {
// Open icon picker
fireEvent.click(getIconButton())
- expect(screen.getByPlaceholderText('common.operation.search')).toBeInTheDocument()
+ expect(screen.getByPlaceholderText('app.iconPicker.search')).toBeInTheDocument()
})
it('should save correct icon_info when starting with image icon type', async () => {
@@ -347,13 +347,13 @@ describe('EditPipelineInfo', () => {
// Open picker
fireEvent.click(getIconButton())
- expect(screen.getByPlaceholderText('common.operation.search')).toBeInTheDocument()
+ expect(screen.getByPlaceholderText('app.iconPicker.search')).toBeInTheDocument()
// Close without selection - should revert to original image icon
- fireEvent.click(screen.getByRole('button', { name: /iconPicker\.cancel/ }))
+ await userEvent.setup().keyboard('{Escape}')
await waitFor(() => {
- expect(screen.queryByPlaceholderText('common.operation.search')).not.toBeInTheDocument()
+ expect(screen.queryByPlaceholderText('app.iconPicker.search')).not.toBeInTheDocument()
})
})
@@ -374,7 +374,7 @@ describe('EditPipelineInfo', () => {
const emojiButton = await screen.findByRole('gridcell', { name: 'Grinning face' })
expect(emojiButton).toBeTruthy()
fireEvent.click(emojiButton!)
- fireEvent.click(screen.getByRole('button', { name: '#E4FBCC' }))
+ fireEvent.click(screen.getByRole('button', { name: '#F3FEE7' }))
fireEvent.click(screen.getByRole('button', { name: /iconPicker\.ok/ }))
const saveButton = screen.getByText(/operation\.save/i)
@@ -386,7 +386,7 @@ describe('EditPipelineInfo', () => {
icon_info: expect.objectContaining({
icon_type: 'emoji',
icon: expect.any(String),
- icon_background: '#E4FBCC',
+ icon_background: '#F3FEE7',
}),
}),
expect.any(Object),
@@ -398,9 +398,10 @@ describe('EditPipelineInfo', () => {
render(<EditPipelineInfo {...defaultProps} />)
fireEvent.click(getIconButton())
- fireEvent.click(screen.getByRole('button', { name: /iconPicker\.image/ }))
+ fireEvent.click(screen.getByRole('radio', { name: /iconPicker\.image/ }))
- expect(screen.getByRole('button', { name: /iconPicker\.ok/ })).toBeInTheDocument()
+ expect(screen.getByRole('radio', { name: /iconPicker\.image/ })).toBeChecked()
+ expect(screen.queryByRole('button', { name: /iconPicker\.ok/ })).not.toBeInTheDocument()
})
})
@@ -408,25 +409,25 @@ describe('EditPipelineInfo', () => {
describe('AppIconPicker', () => {
it('should not show picker initially', () => {
render(<EditPipelineInfo {...defaultProps} />)
- expect(screen.queryByPlaceholderText('common.operation.search')).not.toBeInTheDocument()
+ expect(screen.queryByPlaceholderText('app.iconPicker.search')).not.toBeInTheDocument()
})
it('should open picker when icon is clicked', () => {
render(<EditPipelineInfo {...defaultProps} />)
fireEvent.click(getIconButton())
- expect(screen.getByPlaceholderText('common.operation.search')).toBeInTheDocument()
+ expect(screen.getByPlaceholderText('app.iconPicker.search')).toBeInTheDocument()
})
it('should close picker and update icon when emoji style is selected', async () => {
render(<EditPipelineInfo {...defaultProps} />)
fireEvent.click(getIconButton())
- fireEvent.click(screen.getByRole('button', { name: '#E4FBCC' }))
+ fireEvent.click(screen.getByRole('button', { name: '#F3FEE7' }))
fireEvent.click(screen.getByRole('button', { name: /iconPicker\.ok/ }))
await waitFor(() => {
- expect(screen.queryByPlaceholderText('common.operation.search')).not.toBeInTheDocument()
+ expect(screen.queryByPlaceholderText('app.iconPicker.search')).not.toBeInTheDocument()
})
})
@@ -434,19 +435,20 @@ describe('EditPipelineInfo', () => {
render(<EditPipelineInfo {...defaultProps} />)
fireEvent.click(getIconButton())
- fireEvent.click(screen.getByRole('button', { name: /iconPicker\.image/ }))
+ fireEvent.click(screen.getByRole('radio', { name: /iconPicker\.image/ }))
- expect(screen.getByRole('button', { name: /iconPicker\.ok/ })).toBeInTheDocument()
+ expect(screen.getByRole('radio', { name: /iconPicker\.image/ })).toBeChecked()
+ expect(screen.queryByRole('button', { name: /iconPicker\.ok/ })).not.toBeInTheDocument()
})
it('should revert icon when picker is closed without selection', async () => {
render(<EditPipelineInfo {...defaultProps} />)
fireEvent.click(getIconButton())
- fireEvent.click(screen.getByRole('button', { name: /iconPicker\.cancel/ }))
+ await userEvent.setup().keyboard('{Escape}')
await waitFor(() => {
- expect(screen.queryByPlaceholderText('common.operation.search')).not.toBeInTheDocument()
+ expect(screen.queryByPlaceholderText('app.iconPicker.search')).not.toBeInTheDocument()
})
})
@@ -460,7 +462,7 @@ describe('EditPipelineInfo', () => {
// Open picker and select new emoji
fireEvent.click(getIconButton())
- fireEvent.click(screen.getByRole('button', { name: '#E4FBCC' }))
+ fireEvent.click(screen.getByRole('button', { name: '#F3FEE7' }))
fireEvent.click(screen.getByRole('button', { name: /iconPicker\.ok/ }))
const saveButton = screen.getByText(/operation\.save/i)
@@ -472,7 +474,7 @@ describe('EditPipelineInfo', () => {
icon_info: expect.objectContaining({
icon_type: 'emoji',
icon: '📊',
- icon_background: '#E4FBCC',
+ icon_background: '#F3FEE7',
}),
}),
expect.any(Object),
@@ -492,7 +494,7 @@ describe('EditPipelineInfo', () => {
const emojiButton = await screen.findByRole('gridcell', { name: 'Grinning face' })
expect(emojiButton).toBeTruthy()
fireEvent.click(emojiButton!)
- fireEvent.click(screen.getByRole('button', { name: '#E4FBCC' }))
+ fireEvent.click(screen.getByRole('button', { name: '#F3FEE7' }))
fireEvent.click(screen.getByRole('button', { name: /iconPicker\.ok/ }))
const saveButton = screen.getByText(/operation\.save/i)
@@ -504,7 +506,7 @@ describe('EditPipelineInfo', () => {
icon_info: expect.objectContaining({
icon_type: 'emoji',
icon: expect.any(String),
- icon_background: '#E4FBCC',
+ icon_background: '#F3FEE7',
}),
}),
expect.any(Object),
diff --git a/web/app/components/explore/create-app-modal/__tests__/index.spec.tsx b/web/app/components/explore/create-app-modal/__tests__/index.spec.tsx
index d7c4d6fec07..05383a24be0 100644
--- a/web/app/components/explore/create-app-modal/__tests__/index.spec.tsx
+++ b/web/app/components/explore/create-app-modal/__tests__/index.spec.tsx
@@ -300,7 +300,7 @@ describe('CreateAppModal', () => {
})
describe('App Icon Picker', () => {
- it('should open and close the picker when cancel is clicked', async () => {
+ it('should open and close the picker when Escape is pressed', async () => {
await setup({
appIconType: 'image',
appIcon: 'file-123',
@@ -310,14 +310,14 @@ describe('CreateAppModal', () => {
const pickerDialog = openAppIconPicker()
expect(
- within(pickerDialog).getByRole('button', { name: 'app.iconPicker.cancel' }),
+ within(pickerDialog).getByRole('button', { name: 'app.iconPicker.tryYourLuck' }),
)!.toBeInTheDocument()
- fireEvent.click(within(pickerDialog).getByRole('button', { name: 'app.iconPicker.cancel' }))
+ await userEvent.setup().keyboard('{Escape}')
await waitFor(() => {
expect(
- screen.queryByRole('button', { name: 'app.iconPicker.cancel' }),
+ screen.queryByRole('dialog', { name: 'app.iconPicker.emoji' }),
).not.toBeInTheDocument()
})
})
@@ -343,7 +343,7 @@ describe('CreateAppModal', () => {
expect(payload).toMatchObject({
icon_type: 'emoji',
icon: '😀',
- icon_background: '#FFEAD5',
+ icon_background: '#FEF3F2',
})
})
@@ -358,7 +358,7 @@ describe('CreateAppModal', () => {
const pickerDialog = openAppIconPicker()
- fireEvent.click(within(pickerDialog).getByRole('button', { name: '#E4FBCC' }))
+ fireEvent.click(within(pickerDialog).getByRole('button', { name: '#F3FEE7' }))
fireEvent.click(within(pickerDialog).getByRole('button', { name: 'app.iconPicker.ok' }))
fireEvent.click(screen.getByRole('button', { name: /common\.operation\.create/ }))
@@ -371,7 +371,7 @@ describe('CreateAppModal', () => {
expect(payload).toMatchObject({
icon_type: 'emoji',
icon: '🤖',
- icon_background: '#E4FBCC',
+ icon_background: '#F3FEE7',
})
} finally {
vi.useRealTimers()
diff --git a/web/app/components/rag-pipeline/components/__tests__/publish-as-knowledge-pipeline-modal.spec.tsx b/web/app/components/rag-pipeline/components/__tests__/publish-as-knowledge-pipeline-modal.spec.tsx
index 40a518ed064..6ef2fb0c78e 100644
--- a/web/app/components/rag-pipeline/components/__tests__/publish-as-knowledge-pipeline-modal.spec.tsx
+++ b/web/app/components/rag-pipeline/components/__tests__/publish-as-knowledge-pipeline-modal.spec.tsx
@@ -158,22 +158,22 @@ describe('PublishAsKnowledgePipelineModal', () => {
it('should show icon picker when app icon clicked', async () => {
render(<PublishAsKnowledgePipelineModal {...defaultProps} />)
- expect(screen.queryByPlaceholderText('common.operation.search')).not.toBeInTheDocument()
+ expect(screen.queryByPlaceholderText('app.iconPicker.search')).not.toBeInTheDocument()
fireEvent.click(getIconButton())
- expect(screen.getByPlaceholderText('common.operation.search')).toBeInTheDocument()
+ expect(screen.getByPlaceholderText('app.iconPicker.search')).toBeInTheDocument()
})
it('should update icon when emoji style is selected', async () => {
render(<PublishAsKnowledgePipelineModal {...defaultProps} />)
fireEvent.click(getIconButton())
- fireEvent.click(screen.getByRole('button', { name: '#E4FBCC' }))
+ fireEvent.click(screen.getByRole('button', { name: '#F3FEE7' }))
fireEvent.click(screen.getByRole('button', { name: /iconPicker\.ok/ }))
await waitFor(() => {
- expect(screen.queryByPlaceholderText('common.operation.search')).not.toBeInTheDocument()
+ expect(screen.queryByPlaceholderText('app.iconPicker.search')).not.toBeInTheDocument()
})
})
@@ -181,19 +181,19 @@ describe('PublishAsKnowledgePipelineModal', () => {
render(<PublishAsKnowledgePipelineModal {...defaultProps} />)
fireEvent.click(getIconButton())
- fireEvent.click(screen.getByRole('button', { name: '#E4FBCC' }))
+ fireEvent.click(screen.getByRole('button', { name: '#F3FEE7' }))
- expect(screen.getByPlaceholderText('common.operation.search')).toBeInTheDocument()
+ expect(screen.getByPlaceholderText('app.iconPicker.search')).toBeInTheDocument()
})
- it('should close icon picker when cancel is clicked', async () => {
+ it('should close icon picker when Escape is pressed', async () => {
render(<PublishAsKnowledgePipelineModal {...defaultProps} />)
fireEvent.click(getIconButton())
- fireEvent.click(screen.getByRole('button', { name: /iconPicker\.cancel/ }))
+ await userEvent.setup().keyboard('{Escape}')
await waitFor(() => {
- expect(screen.queryByPlaceholderText('common.operation.search')).not.toBeInTheDocument()
+ expect(screen.queryByPlaceholderText('app.iconPicker.search')).not.toBeInTheDocument()
})
})
diff --git a/web/app/components/tools/mcp/__tests__/modal.spec.tsx b/web/app/components/tools/mcp/__tests__/modal.spec.tsx
index d4181af317e..291540ff48d 100644
--- a/web/app/components/tools/mcp/__tests__/modal.spec.tsx
+++ b/web/app/components/tools/mcp/__tests__/modal.spec.tsx
@@ -2,6 +2,7 @@ import type { SsoProtocol } from '@dify/contracts/api/console/system-features/ty
import type { ToolWithProvider } from '@/app/components/workflow/types'
import { zSsoProtocol } from '@dify/contracts/api/console/system-features/zod.gen'
import { fireEvent, render, screen, waitFor } from '@testing-library/react'
+import userEvent from '@testing-library/user-event'
import { beforeEach, describe, expect, it, vi } from 'vite-plus/test'
import { createConsoleQueryWrapper } from '@/test/console/query-data'
import { mockEmojiData } from '@/test/emoji-picker'
@@ -690,7 +691,7 @@ describe('MCPModal', () => {
fireEvent.click(appIconContainer)
await waitFor(() => {
- expect(screen.getByPlaceholderText('common.operation.search'))!.toBeInTheDocument()
+ expect(screen.getByPlaceholderText('app.iconPicker.search'))!.toBeInTheDocument()
})
}
})
@@ -707,19 +708,19 @@ describe('MCPModal', () => {
fireEvent.click(appIconContainer)
await waitFor(() => {
- expect(screen.getByPlaceholderText('common.operation.search'))!.toBeInTheDocument()
+ expect(screen.getByPlaceholderText('app.iconPicker.search'))!.toBeInTheDocument()
})
- fireEvent.click(screen.getByRole('button', { name: '#E4FBCC' }))
+ fireEvent.click(screen.getByRole('button', { name: '#F3FEE7' }))
fireEvent.click(screen.getByRole('button', { name: /iconPicker\.ok/ }))
await waitFor(() => {
- expect(screen.queryByPlaceholderText('common.operation.search')).not.toBeInTheDocument()
+ expect(screen.queryByPlaceholderText('app.iconPicker.search')).not.toBeInTheDocument()
})
}
})
- it('should close app icon picker and reset icon when close button is clicked', async () => {
+ it('should close app icon picker and reset icon when Escape is pressed', async () => {
render(<MCPModal {...defaultProps} />, { wrapper: createWrapper() })
// Open the icon picker
@@ -731,13 +732,13 @@ describe('MCPModal', () => {
fireEvent.click(appIconContainer)
await waitFor(() => {
- expect(screen.getByPlaceholderText('common.operation.search'))!.toBeInTheDocument()
+ expect(screen.getByPlaceholderText('app.iconPicker.search'))!.toBeInTheDocument()
})
- fireEvent.click(screen.getByRole('button', { name: /iconPicker\.cancel/ }))
+ await userEvent.setup().keyboard('{Escape}')
await waitFor(() => {
- expect(screen.queryByPlaceholderText('common.operation.search')).not.toBeInTheDocument()
+ expect(screen.queryByPlaceholderText('app.iconPicker.search')).not.toBeInTheDocument()
})
}
})
diff --git a/web/i18n/locales/ar-TN/app.json b/web/i18n/locales/ar-TN/app.json
index bbb7a62bb7b..3a0f4908c8c 100644
--- a/web/i18n/locales/ar-TN/app.json
+++ b/web/i18n/locales/ar-TN/app.json
@@ -110,9 +110,14 @@
"gotoAnything.someServicesUnavailable": "بعض خدمات البحث غير متوفرة",
"gotoAnything.tryDifferentSearch": "جرب مصطلح بحث مختلف",
"iconPicker.cancel": "إلغاء",
+ "iconPicker.chooseStyle": "اختر النمط",
"iconPicker.emoji": "رموز تعبيرية",
"iconPicker.image": "صورة",
"iconPicker.ok": "موافق",
+ "iconPicker.recent": "الأخيرة",
+ "iconPicker.recommend": "المقترحة",
+ "iconPicker.search": "ابحث عن رمز تعبيري…",
+ "iconPicker.tryYourLuck": "جرّب حظك",
"importApp": "استيراد التطبيق",
"importAppDescription": "حزمة تطبيق أو ملف DSL",
"importAppFormats": "يدعم .ifpkg و.yaml و.yml",
diff --git a/web/i18n/locales/az-AZ/app.json b/web/i18n/locales/az-AZ/app.json
index 3d9d7ebf847..57e05213714 100644
--- a/web/i18n/locales/az-AZ/app.json
+++ b/web/i18n/locales/az-AZ/app.json
@@ -110,9 +110,14 @@
"gotoAnything.someServicesUnavailable": "Bəzi axtarış xidmətləri əlçatan deyil",
"gotoAnything.tryDifferentSearch": "Başqa axtarış ifadəsi sınayın",
"iconPicker.cancel": "Ləğv et",
+ "iconPicker.chooseStyle": "Üslub seçin",
"iconPicker.emoji": "Emoci",
"iconPicker.image": "Şəkil",
"iconPicker.ok": "Təsdiqlə",
+ "iconPicker.recent": "Son istifadə olunanlar",
+ "iconPicker.recommend": "Tövsiyə olunanlar",
+ "iconPicker.search": "Emoji axtar…",
+ "iconPicker.tryYourLuck": "Şansını sına",
"importApp": "Tətbiq idxal et",
"importAppDescription": "Tətbiq paketi və ya DSL faylı",
"importAppFormats": ".ifpkg, .yaml və .yml dəstəklənir",
diff --git a/web/i18n/locales/de-DE/app.json b/web/i18n/locales/de-DE/app.json
index 4996a56be7f..5d1e0ae8a15 100644
--- a/web/i18n/locales/de-DE/app.json
+++ b/web/i18n/locales/de-DE/app.json
@@ -110,9 +110,14 @@
"gotoAnything.someServicesUnavailable": "Einige Suchdienste sind nicht verfügbar",
"gotoAnything.tryDifferentSearch": "Versuchen Sie es mit einem anderen Suchbegriff",
"iconPicker.cancel": "Abbrechen",
+ "iconPicker.chooseStyle": "Stil wählen",
"iconPicker.emoji": "Emoji",
"iconPicker.image": "Bild",
"iconPicker.ok": "OK",
+ "iconPicker.recent": "Zuletzt verwendet",
+ "iconPicker.recommend": "Empfohlen",
+ "iconPicker.search": "Emoji suchen…",
+ "iconPicker.tryYourLuck": "Auf gut Glück",
"importApp": "App importieren",
"importAppDescription": "App-Paket oder DSL-Datei",
"importAppFormats": "Unterstützt .ifpkg, .yaml und .yml",
diff --git a/web/i18n/locales/en-US/app.json b/web/i18n/locales/en-US/app.json
index 2d7108ee49a..2091aa1a753 100644
--- a/web/i18n/locales/en-US/app.json
+++ b/web/i18n/locales/en-US/app.json
@@ -110,9 +110,14 @@
"gotoAnything.someServicesUnavailable": "Some search services unavailable",
"gotoAnything.tryDifferentSearch": "Try a different search term",
"iconPicker.cancel": "Cancel",
+ "iconPicker.chooseStyle": "Choose Style",
"iconPicker.emoji": "Emoji",
"iconPicker.image": "Image",
"iconPicker.ok": "OK",
+ "iconPicker.recent": "Recent",
+ "iconPicker.recommend": "Recommend",
+ "iconPicker.search": "Search emoji...",
+ "iconPicker.tryYourLuck": "Try your luck",
"importApp": "Import App",
"importAppDescription": "App package or DSL file",
"importAppFormats": "Supports .ifpkg, .yaml, and .yml",
diff --git a/web/i18n/locales/es-ES/app.json b/web/i18n/locales/es-ES/app.json
index c987a91638e..854a3ebbb5f 100644
--- a/web/i18n/locales/es-ES/app.json
+++ b/web/i18n/locales/es-ES/app.json
@@ -110,9 +110,14 @@
"gotoAnything.someServicesUnavailable": "Algunos servicios de búsqueda no están disponibles",
"gotoAnything.tryDifferentSearch": "Prueba con un término de búsqueda diferente",
"iconPicker.cancel": "Cancelar",
+ "iconPicker.chooseStyle": "Elegir estilo",
"iconPicker.emoji": "Emoji",
"iconPicker.image": "Imagen",
"iconPicker.ok": "OK",
+ "iconPicker.recent": "Recientes",
+ "iconPicker.recommend": "Recomendados",
+ "iconPicker.search": "Buscar emoji…",
+ "iconPicker.tryYourLuck": "Prueba suerte",
"importApp": "Importar App",
"importAppDescription": "Paquete de aplicación o archivo DSL",
"importAppFormats": "Admite .ifpkg, .yaml y .yml",
diff --git a/web/i18n/locales/fa-IR/app.json b/web/i18n/locales/fa-IR/app.json
index 3f6d7004379..5a866b9dd16 100644
--- a/web/i18n/locales/fa-IR/app.json
+++ b/web/i18n/locales/fa-IR/app.json
@@ -110,9 +110,14 @@
"gotoAnything.someServicesUnavailable": "برخی از سرویس های جستجو دردسترس نیستند",
"gotoAnything.tryDifferentSearch": "عبارت جستجوی دیگری را امتحان کنید",
"iconPicker.cancel": "لغو",
+ "iconPicker.chooseStyle": "انتخاب سبک",
"iconPicker.emoji": "ایموجی",
"iconPicker.image": "تصویر",
"iconPicker.ok": "باشه",
+ "iconPicker.recent": "اخیر",
+ "iconPicker.recommend": "پیشنهادی",
+ "iconPicker.search": "جستجوی ایموجی…",
+ "iconPicker.tryYourLuck": "شانست را امتحان کن",
"importApp": "وارد کردن برنامه",
"importAppDescription": "بستهٔ برنامه یا فایل DSL",
"importAppFormats": "از .ifpkg، .yaml و .yml پشتیبانی می‌کند",
diff --git a/web/i18n/locales/fr-FR/app.json b/web/i18n/locales/fr-FR/app.json
index a152044f4c0..45bc3289793 100644
--- a/web/i18n/locales/fr-FR/app.json
+++ b/web/i18n/locales/fr-FR/app.json
@@ -110,9 +110,14 @@
"gotoAnything.someServicesUnavailable": "Certains services de recherche indisponibles",
"gotoAnything.tryDifferentSearch": "Essayez un autre terme de recherche",
"iconPicker.cancel": "Annuler",
+ "iconPicker.chooseStyle": "Choisir un style",
"iconPicker.emoji": "Emoji",
"iconPicker.image": "Image",
"iconPicker.ok": "OK",
+ "iconPicker.recent": "Récents",
+ "iconPicker.recommend": "Recommandés",
+ "iconPicker.search": "Rechercher un emoji…",
+ "iconPicker.tryYourLuck": "J’ai de la chance",
"importApp": "Importer l'App",
"importAppDescription": "Paquet d’application ou fichier DSL",
"importAppFormats": "Formats pris en charge : .ifpkg, .yaml et .yml",
diff --git a/web/i18n/locales/hi-IN/app.json b/web/i18n/locales/hi-IN/app.json
index 71e5c8bfe0f..affdaa7b153 100644
--- a/web/i18n/locales/hi-IN/app.json
+++ b/web/i18n/locales/hi-IN/app.json
@@ -110,9 +110,14 @@
"gotoAnything.someServicesUnavailable": "कुछ खोज सेवाएँ उपलब्ध नहीं हैं",
"gotoAnything.tryDifferentSearch": "एक अलग खोज शब्द आजमाएँ",
"iconPicker.cancel": "रद्द करें",
+ "iconPicker.chooseStyle": "शैली चुनें",
"iconPicker.emoji": "इमोजी",
"iconPicker.image": "छवि",
"iconPicker.ok": "ठीक है",
+ "iconPicker.recent": "हाल के",
+ "iconPicker.recommend": "सुझाए गए",
+ "iconPicker.search": "इमोजी खोजें…",
+ "iconPicker.tryYourLuck": "किस्मत आज़माएँ",
"importApp": "ऐप आयात करें",
"importAppDescription": "ऐप पैकेज या DSL फ़ाइल",
"importAppFormats": ".ifpkg, .yaml और .yml समर्थित हैं",
diff --git a/web/i18n/locales/id-ID/app.json b/web/i18n/locales/id-ID/app.json
index 0e552ab0e6e..2e393d7591b 100644
--- a/web/i18n/locales/id-ID/app.json
+++ b/web/i18n/locales/id-ID/app.json
@@ -110,9 +110,14 @@
"gotoAnything.someServicesUnavailable": "Beberapa layanan penelusuran tidak tersedia",
"gotoAnything.tryDifferentSearch": "Coba istilah penelusuran lain",
"iconPicker.cancel": "Batal",
+ "iconPicker.chooseStyle": "Pilih gaya",
"iconPicker.emoji": "Emoji",
"iconPicker.image": "Citra",
"iconPicker.ok": "OK",
+ "iconPicker.recent": "Terbaru",
+ "iconPicker.recommend": "Rekomendasi",
+ "iconPicker.search": "Cari emoji…",
+ "iconPicker.tryYourLuck": "Coba keberuntungan",
"importApp": "Impor Aplikasi",
"importAppDescription": "Paket aplikasi atau file DSL",
"importAppFormats": "Mendukung .ifpkg, .yaml, dan .yml",
diff --git a/web/i18n/locales/it-IT/app.json b/web/i18n/locales/it-IT/app.json
index abcc0665c88..75ea3c719c6 100644
--- a/web/i18n/locales/it-IT/app.json
+++ b/web/i18n/locales/it-IT/app.json
@@ -110,9 +110,14 @@
"gotoAnything.someServicesUnavailable": "Alcuni servizi di ricerca non sono disponibili",
"gotoAnything.tryDifferentSearch": "Prova un termine di ricerca diverso",
"iconPicker.cancel": "Annulla",
+ "iconPicker.chooseStyle": "Scegli stile",
"iconPicker.emoji": "Emoji",
"iconPicker.image": "Immagine",
"iconPicker.ok": "OK",
+ "iconPicker.recent": "Recenti",
+ "iconPicker.recommend": "Consigliati",
+ "iconPicker.search": "Cerca emoji…",
+ "iconPicker.tryYourLuck": "Tenta la fortuna",
"importApp": "Importa App",
"importAppDescription": "Pacchetto app o file DSL",
"importAppFormats": "Supporta .ifpkg, .yaml e .yml",
diff --git a/web/i18n/locales/ja-JP/app.json b/web/i18n/locales/ja-JP/app.json
index db6829a7ff7..960e73656f6 100644
--- a/web/i18n/locales/ja-JP/app.json
+++ b/web/i18n/locales/ja-JP/app.json
@@ -110,9 +110,14 @@
"gotoAnything.someServicesUnavailable": "一部の検索サービスが利用できません",
"gotoAnything.tryDifferentSearch": "別の検索語句をお試しください",
"iconPicker.cancel": "キャンセル",
+ "iconPicker.chooseStyle": "スタイルを選択",
"iconPicker.emoji": "絵文字",
"iconPicker.image": "画像",
"iconPicker.ok": "OK",
+ "iconPicker.recent": "最近使用",
+ "iconPicker.recommend": "おすすめ",
+ "iconPicker.search": "絵文字を検索…",
+ "iconPicker.tryYourLuck": "運試し",
"importApp": "アプリをインポート",
"importAppDescription": "アプリパッケージまたは DSL ファイル",
"importAppFormats": "対応形式:.ifpkg、.yaml、.yml",
diff --git a/web/i18n/locales/ko-KR/app.json b/web/i18n/locales/ko-KR/app.json
index b1cf6fb92ca..5925fd4b2ff 100644
--- a/web/i18n/locales/ko-KR/app.json
+++ b/web/i18n/locales/ko-KR/app.json
@@ -110,9 +110,14 @@
"gotoAnything.someServicesUnavailable": "일부 검색 서비스를 사용할 수 없습니다.",
"gotoAnything.tryDifferentSearch": "다른 검색어 사용해 보기",
"iconPicker.cancel": "취소",
+ "iconPicker.chooseStyle": "스타일 선택",
"iconPicker.emoji": "이모지",
"iconPicker.image": "이미지",
"iconPicker.ok": "확인",
+ "iconPicker.recent": "최근 사용",
+ "iconPicker.recommend": "추천",
+ "iconPicker.search": "이모지 검색…",
+ "iconPicker.tryYourLuck": "행운을 시험해 보세요",
"importApp": "앱 가져오기",
"importAppDescription": "앱 패키지 또는 DSL 파일",
"importAppFormats": ".ifpkg, .yaml 및 .yml 지원",
diff --git a/web/i18n/locales/lo-LA/app.json b/web/i18n/locales/lo-LA/app.json
index 78ddfb4d2a5..6c95a2de23a 100644
--- a/web/i18n/locales/lo-LA/app.json
+++ b/web/i18n/locales/lo-LA/app.json
@@ -110,9 +110,14 @@
"gotoAnything.someServicesUnavailable": "ບາງບໍລິການຄົ້ນຫາບໍ່ສາມາດໃຊ້ງານໄດ້",
"gotoAnything.tryDifferentSearch": "ລອງໃຊ້ຄຳຄົ້ນຫາອື່ນ",
"iconPicker.cancel": "ຍົກເລີກ",
+ "iconPicker.chooseStyle": "ເລືອກຮູບແບບ",
"iconPicker.emoji": "ອີໂມຈິ",
"iconPicker.image": "ຮູບພາບ",
"iconPicker.ok": "ຕົກລົງ",
+ "iconPicker.recent": "ຫຼ້າສຸດ",
+ "iconPicker.recommend": "ແນະນຳ",
+ "iconPicker.search": "ຄົ້ນຫາອີໂມຈິ…",
+ "iconPicker.tryYourLuck": "ລອງໂຊກຂອງທ່ານ",
"importApp": "ນຳເຂົ້າແອັບ",
"importAppDescription": "ແພັກເກດແອັບ ຫຼື ໄຟລ໌ DSL",
"importAppFormats": "ຮອງຮັບ .ifpkg, .yaml ແລະ .yml",
diff --git a/web/i18n/locales/nl-NL/app.json b/web/i18n/locales/nl-NL/app.json
index 44e5c49c59a..73f672b271a 100644
--- a/web/i18n/locales/nl-NL/app.json
+++ b/web/i18n/locales/nl-NL/app.json
@@ -110,9 +110,14 @@
"gotoAnything.someServicesUnavailable": "Some search services unavailable",
"gotoAnything.tryDifferentSearch": "Try a different search term",
"iconPicker.cancel": "Cancel",
+ "iconPicker.chooseStyle": "Kies stijl",
"iconPicker.emoji": "Emoji",
"iconPicker.image": "Image",
"iconPicker.ok": "OK",
+ "iconPicker.recent": "Recent",
+ "iconPicker.recommend": "Aanbevolen",
+ "iconPicker.search": "Emoji zoeken…",
+ "iconPicker.tryYourLuck": "Doe een gok",
"importApp": "App importeren",
"importAppDescription": "App-pakket of DSL-bestand",
"importAppFormats": "Ondersteunt .ifpkg, .yaml en .yml",
diff --git a/web/i18n/locales/pl-PL/app.json b/web/i18n/locales/pl-PL/app.json
index 2622868895a..f1abdccdd49 100644
--- a/web/i18n/locales/pl-PL/app.json
+++ b/web/i18n/locales/pl-PL/app.json
@@ -110,9 +110,14 @@
"gotoAnything.someServicesUnavailable": "Niektóre usługi wyszukiwania są niedostępne",
"gotoAnything.tryDifferentSearch": "Spróbuj użyć innego hasła",
"iconPicker.cancel": "Anuluj",
+ "iconPicker.chooseStyle": "Wybierz styl",
"iconPicker.emoji": "Emoji",
"iconPicker.image": "Obraz",
"iconPicker.ok": "OK",
+ "iconPicker.recent": "Ostatnie",
+ "iconPicker.recommend": "Polecane",
+ "iconPicker.search": "Szukaj emoji…",
+ "iconPicker.tryYourLuck": "Spróbuj szczęścia",
"importApp": "Importuj aplikację",
"importAppDescription": "Pakiet aplikacji lub plik DSL",
"importAppFormats": "Obsługuje .ifpkg, .yaml i .yml",
diff --git a/web/i18n/locales/pt-BR/app.json b/web/i18n/locales/pt-BR/app.json
index f70e03eae67..f3f0eb364e2 100644
--- a/web/i18n/locales/pt-BR/app.json
+++ b/web/i18n/locales/pt-BR/app.json
@@ -110,9 +110,14 @@
"gotoAnything.someServicesUnavailable": "Alguns serviços de pesquisa indisponíveis",
"gotoAnything.tryDifferentSearch": "Tente um termo de pesquisa diferente",
"iconPicker.cancel": "Cancelar",
+ "iconPicker.chooseStyle": "Escolher estilo",
"iconPicker.emoji": "Emoji",
"iconPicker.image": "Imagem",
"iconPicker.ok": "OK",
+ "iconPicker.recent": "Recentes",
+ "iconPicker.recommend": "Recomendados",
+ "iconPicker.search": "Buscar emoji…",
+ "iconPicker.tryYourLuck": "Tente a sorte",
"importApp": "Importar App",
"importAppDescription": "Pacote de aplicativo ou arquivo DSL",
"importAppFormats": "Suporta .ifpkg, .yaml e .yml",
diff --git a/web/i18n/locales/ro-RO/app.json b/web/i18n/locales/ro-RO/app.json
index 6fbd58bb28d..e4c4ca0db22 100644
--- a/web/i18n/locales/ro-RO/app.json
+++ b/web/i18n/locales/ro-RO/app.json
@@ -110,9 +110,14 @@
"gotoAnything.someServicesUnavailable": "Unele servicii de căutare nu sunt disponibile",
"gotoAnything.tryDifferentSearch": "Încercați un alt termen de căutare",
"iconPicker.cancel": "Anulează",
+ "iconPicker.chooseStyle": "Alege stilul",
"iconPicker.emoji": "Emoji",
"iconPicker.image": "Imagine",
"iconPicker.ok": "OK",
+ "iconPicker.recent": "Recente",
+ "iconPicker.recommend": "Recomandate",
+ "iconPicker.search": "Caută emoji…",
+ "iconPicker.tryYourLuck": "Încearcă-ți norocul",
"importApp": "Importați aplicația",
"importAppDescription": "Pachet de aplicație sau fișier DSL",
"importAppFormats": "Acceptă .ifpkg, .yaml și .yml",
diff --git a/web/i18n/locales/ru-RU/app.json b/web/i18n/locales/ru-RU/app.json
index d9cc504e000..255376c9ae0 100644
--- a/web/i18n/locales/ru-RU/app.json
+++ b/web/i18n/locales/ru-RU/app.json
@@ -110,9 +110,14 @@
"gotoAnything.someServicesUnavailable": "Некоторые поисковые сервисы недоступны",
"gotoAnything.tryDifferentSearch": "Попробуйте использовать другой поисковый запрос",
"iconPicker.cancel": "Отмена",
+ "iconPicker.chooseStyle": "Выбрать стиль",
"iconPicker.emoji": "Эмодзи",
"iconPicker.image": "Изображение",
"iconPicker.ok": "ОК",
+ "iconPicker.recent": "Недавние",
+ "iconPicker.recommend": "Рекомендуемые",
+ "iconPicker.search": "Поиск эмодзи…",
+ "iconPicker.tryYourLuck": "Испытать удачу",
"importApp": "Импортировать приложение",
"importAppDescription": "Пакет приложения или файл DSL",
"importAppFormats": "Поддерживаются .ifpkg, .yaml и .yml",
diff --git a/web/i18n/locales/sl-SI/app.json b/web/i18n/locales/sl-SI/app.json
index 63435eb0542..b0c45ca0ae6 100644
--- a/web/i18n/locales/sl-SI/app.json
+++ b/web/i18n/locales/sl-SI/app.json
@@ -110,9 +110,14 @@
"gotoAnything.someServicesUnavailable": "Nekatere iskalne storitve niso na voljo",
"gotoAnything.tryDifferentSearch": "Poskusite uporabiti drug iskalni izraz",
"iconPicker.cancel": "Prekliči",
+ "iconPicker.chooseStyle": "Izberi slog",
"iconPicker.emoji": "Emoji",
"iconPicker.image": "Slika",
"iconPicker.ok": "V redu",
+ "iconPicker.recent": "Nedavno",
+ "iconPicker.recommend": "Priporočeno",
+ "iconPicker.search": "Poišči čustveni simbol…",
+ "iconPicker.tryYourLuck": "Poskusi srečo",
"importApp": "Uvozi aplikacijo",
"importAppDescription": "Paket aplikacije ali datoteka DSL",
"importAppFormats": "Podpira .ifpkg, .yaml in .yml",
diff --git a/web/i18n/locales/th-TH/app.json b/web/i18n/locales/th-TH/app.json
index 5f3b2c485cb..0e0a8bfe2ad 100644
--- a/web/i18n/locales/th-TH/app.json
+++ b/web/i18n/locales/th-TH/app.json
@@ -110,9 +110,14 @@
"gotoAnything.someServicesUnavailable": "บริการค้นหาบางบริการไม่พร้อมใช้งาน",
"gotoAnything.tryDifferentSearch": "ลองใช้ข้อความค้นหาอื่น",
"iconPicker.cancel": "ยกเลิก",
+ "iconPicker.chooseStyle": "เลือกรูปแบบ",
"iconPicker.emoji": "อิโมจิ",
"iconPicker.image": "ภาพ",
"iconPicker.ok": "ตกลง, ได้",
+ "iconPicker.recent": "ล่าสุด",
+ "iconPicker.recommend": "แนะนำ",
+ "iconPicker.search": "ค้นหาอีโมจิ…",
+ "iconPicker.tryYourLuck": "ลองเสี่ยงโชค",
"importApp": "นำเข้าแอป",
"importAppDescription": "แพ็กเกจแอปหรือไฟล์ DSL",
"importAppFormats": "รองรับ .ifpkg, .yaml และ .yml",
diff --git a/web/i18n/locales/tr-TR/app.json b/web/i18n/locales/tr-TR/app.json
index 6920d8e1cce..58826878b45 100644
--- a/web/i18n/locales/tr-TR/app.json
+++ b/web/i18n/locales/tr-TR/app.json
@@ -110,9 +110,14 @@
"gotoAnything.someServicesUnavailable": "Bazı arama hizmetleri kullanılamıyor",
"gotoAnything.tryDifferentSearch": "Farklı bir arama terimi deneyin",
"iconPicker.cancel": "İptal",
+ "iconPicker.chooseStyle": "Stil seç",
"iconPicker.emoji": "Emoji",
"iconPicker.image": "Görsel",
"iconPicker.ok": "Tamam",
+ "iconPicker.recent": "Son kullanılanlar",
+ "iconPicker.recommend": "Önerilenler",
+ "iconPicker.search": "Emoji ara…",
+ "iconPicker.tryYourLuck": "Şansını dene",
"importApp": "Uygulamayı İçe Aktar",
"importAppDescription": "Uygulama paketi veya DSL dosyası",
"importAppFormats": ".ifpkg, .yaml ve .yml desteklenir",
diff --git a/web/i18n/locales/uk-UA/app.json b/web/i18n/locales/uk-UA/app.json
index a7027592840..8024c44fc3e 100644
--- a/web/i18n/locales/uk-UA/app.json
+++ b/web/i18n/locales/uk-UA/app.json
@@ -110,9 +110,14 @@
"gotoAnything.someServicesUnavailable": "Деякі пошукові сервіси недоступні",
"gotoAnything.tryDifferentSearch": "Спробуйте інший пошуковий термін",
"iconPicker.cancel": "Скасувати",
+ "iconPicker.chooseStyle": "Вибрати стиль",
"iconPicker.emoji": "Емодзі",
"iconPicker.image": "Зображення",
"iconPicker.ok": "OK",
+ "iconPicker.recent": "Нещодавні",
+ "iconPicker.recommend": "Рекомендовані",
+ "iconPicker.search": "Пошук емодзі…",
+ "iconPicker.tryYourLuck": "Спробувати удачу",
"importApp": "Імпортувати додаток",
"importAppDescription": "Пакет застосунку або файл DSL",
"importAppFormats": "Підтримуються .ifpkg, .yaml та .yml",
diff --git a/web/i18n/locales/vi-VN/app.json b/web/i18n/locales/vi-VN/app.json
index 30ab493d86e..eec2ede3db3 100644
--- a/web/i18n/locales/vi-VN/app.json
+++ b/web/i18n/locales/vi-VN/app.json
@@ -110,9 +110,14 @@
"gotoAnything.someServicesUnavailable": "Một số dịch vụ tìm kiếm không khả dụng",
"gotoAnything.tryDifferentSearch": "Thử một cụm từ tìm kiếm khác",
"iconPicker.cancel": "Hủy",
+ "iconPicker.chooseStyle": "Chọn kiểu",
"iconPicker.emoji": "Biểu tượng cảm xúc",
"iconPicker.image": "Hình ảnh",
"iconPicker.ok": "Đồng ý",
+ "iconPicker.recent": "Gần đây",
+ "iconPicker.recommend": "Đề xuất",
+ "iconPicker.search": "Tìm biểu tượng cảm xúc…",
+ "iconPicker.tryYourLuck": "Thử vận may",
"importApp": "Nhập App",
"importAppDescription": "Gói ứng dụng hoặc tệp DSL",
"importAppFormats": "Hỗ trợ .ifpkg, .yaml và .yml",
diff --git a/web/i18n/locales/zh-Hans/app.json b/web/i18n/locales/zh-Hans/app.json
index 813d2649c31..ff2e193d645 100644
--- a/web/i18n/locales/zh-Hans/app.json
+++ b/web/i18n/locales/zh-Hans/app.json
@@ -110,9 +110,14 @@
"gotoAnything.someServicesUnavailable": "某些搜索服务不可用",
"gotoAnything.tryDifferentSearch": "请尝试不同的搜索词",
"iconPicker.cancel": "取消",
+ "iconPicker.chooseStyle": "选择样式",
"iconPicker.emoji": "表情符号",
"iconPicker.image": "图片",
"iconPicker.ok": "确认",
+ "iconPicker.recent": "最近使用",
+ "iconPicker.recommend": "推荐",
+ "iconPicker.search": "搜索表情…",
+ "iconPicker.tryYourLuck": "试试手气",
"importApp": "导入应用",
"importAppDescription": "应用包或 DSL 文件",
"importAppFormats": "支持 .ifpkg、.yaml 和 .yml",
diff --git a/web/i18n/locales/zh-Hant/app.json b/web/i18n/locales/zh-Hant/app.json
index 382c49e9788..348fe9f4c5f 100644
--- a/web/i18n/locales/zh-Hant/app.json
+++ b/web/i18n/locales/zh-Hant/app.json
@@ -110,9 +110,14 @@
"gotoAnything.someServicesUnavailable": "某些搜索服務不可用",
"gotoAnything.tryDifferentSearch": "嘗試其他搜尋字詞",
"iconPicker.cancel": "取消",
+ "iconPicker.chooseStyle": "選擇樣式",
"iconPicker.emoji": "表情符號",
"iconPicker.image": "圖片",
"iconPicker.ok": "確認",
+ "iconPicker.recent": "最近使用",
+ "iconPicker.recommend": "推薦",
+ "iconPicker.search": "搜尋表情…",
+ "iconPicker.tryYourLuck": "試試手氣",
"importApp": "匯入應用",
"importAppDescription": "應用套件或 DSL 檔案",
"importAppFormats": "支援 .ifpkg、.yaml 和 .yml",