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.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
fix(web): align app and metadata picker lifecycles (#44698)
yyhb535806c4acd
diff --git a/oxlint-suppressions.json b/oxlint-suppressions.jsonindex 2c2702f9328..82f2d58fd45 100644--- a/oxlint-suppressions.json+++ b/oxlint-suppressions.json@@ -3421,21 +3421,6 @@"count": 8}},- "web/app/components/plugins/plugin-detail-panel/app-selector/app-picker.tsx": {- "better-tailwindcss/enforce-logical-properties": {- "count": 4- }- },- "web/app/components/plugins/plugin-detail-panel/app-selector/app-trigger.tsx": {- "better-tailwindcss/enforce-logical-properties": {- "count": 4- }- },- "web/app/components/plugins/plugin-detail-panel/app-selector/index.tsx": {- "better-tailwindcss/enforce-logical-properties": {- "count": 1- }- },"web/app/components/plugins/plugin-detail-panel/detail-header.tsx": {"no-barrel-files/no-barrel-files": {"count": 1@@ -6893,21 +6878,11 @@"count": 18}},- "web/features/new-rag/documents/metadata/create-form.tsx": {- "better-tailwindcss/enforce-logical-properties": {- "count": 2- }- },"web/features/new-rag/documents/metadata/drawer.tsx": {"better-tailwindcss/enforce-logical-properties": {"count": 3}},- "web/features/new-rag/documents/metadata/picker.tsx": {- "better-tailwindcss/enforce-logical-properties": {- "count": 2- }- },"web/features/new-rag/documents/tasks/documents-drawer.tsx": {"better-tailwindcss/enforce-logical-properties": {"count": 6diff --git a/web/app/components/header/account-setting/model-provider-page/model-modal/__tests__/Form.spec.tsx b/web/app/components/header/account-setting/model-provider-page/model-modal/__tests__/Form.spec.tsxindex 6d3b483af67..2280edec26e 100644--- a/web/app/components/header/account-setting/model-provider-page/model-modal/__tests__/Form.spec.tsx+++ b/web/app/components/header/account-setting/model-provider-page/model-modal/__tests__/Form.spec.tsx@@ -531,7 +531,7 @@ describe('Form', () => {],[FormTypeEnum.appSelector,- 'app.appSelector.label',+ 'app.appSelector.placeholder',{ app_id: 'selected-app', inputs: {}, files: [], type: FormTypeEnum.appSelector },],[FormTypeEnum.any, 'workflow.common.setVarValuePlaceholder', ['source', 'text']],@@ -561,7 +561,7 @@ describe('Form', () => {await chooseTool(user, type === FormTypeEnum.multiToolSelector)if (type === FormTypeEnum.any) await user.click(await screen.findByText('text'))if (type === FormTypeEnum.appSelector) {- await user.click(screen.getByRole('combobox', { name: 'app.appSelector.label' }))+ await user.click(screen.getAllByRole('button', { name: 'app.appSelector.placeholder' })[1]!)await user.click(await screen.findByRole('option', { name: /Support Bot/ }))}if (type === FormTypeEnum.modelSelector)@@ -713,7 +713,7 @@ describe('Form', () => {[FormTypeEnum.modelSelector, 'plugin.detailPanel.configureModel'],[FormTypeEnum.toolSelector, 'plugin.detailPanel.configureTool'],[FormTypeEnum.multiToolSelector, 'plugin.detailPanel.toolSelector.title'],- [FormTypeEnum.appSelector, 'app.appSelector.label'],+ [FormTypeEnum.appSelector, 'app.appSelector.placeholder'],[FormTypeEnum.any, 'workflow.common.setVarValuePlaceholder'],] as const)('shows validation feedback after a %s field changes', async (type, control) => {const user = userEvent.setup()@@ -745,7 +745,7 @@ describe('Form', () => {await chooseTool(user, type === FormTypeEnum.multiToolSelector)if (type === FormTypeEnum.any) await user.click(await screen.findByText('text'))if (type === FormTypeEnum.appSelector) {- await user.click(screen.getByRole('combobox', { name: 'app.appSelector.label' }))+ await user.click(screen.getAllByRole('button', { name: 'app.appSelector.placeholder' })[1]!)await user.click(await screen.findByRole('option', { name: /Support Bot/ }))}expect(screen.getByText('common.provider.validating')).toBeInTheDocument()diff --git a/web/app/components/plugins/plugin-detail-panel/app-selector/__tests__/app-inputs-panel.spec.tsx b/web/app/components/plugins/plugin-detail-panel/app-selector/__tests__/app-inputs-panel.spec.tsxindex a4cb4003856..edd57a8dd5b 100644--- a/web/app/components/plugins/plugin-detail-panel/app-selector/__tests__/app-inputs-panel.spec.tsx+++ b/web/app/components/plugins/plugin-detail-panel/app-selector/__tests__/app-inputs-panel.spec.tsx@@ -46,7 +46,7 @@ it('loads real input schemas and preserves the other field when inputs change',return (<AppInputsPanelappDetail={appDetail}- value={{ app_id: 'app-1', inputs }}+ inputs={inputs}onFormChange={(next) => {setInputs(next)onChange(next)@@ -71,7 +71,9 @@ it('loads real input schemas and preserves the other field when inputs change',it('retries a failed app query and replaces the error with its actual fields', async () => {getApp.mockRejectedValueOnce(new Error('Unavailable')).mockResolvedValue(appWithInputs())const user = userEvent.setup()- renderWithConsoleQuery(<AppInputsPanel appDetail={appDetail} onFormChange={vi.fn()} />)+ renderWithConsoleQuery(+ <AppInputsPanel inputs={{}} appDetail={appDetail} onFormChange={vi.fn()} />,+ )expect(await screen.findByRole('alert')).toHaveTextContent('common.errorBoundary.title')await user.click(screen.getByRole('button', { name: 'common.operation.retry' }))expect(await screen.findByRole('textbox', { name: 'Topic' })).toBeInTheDocument()@@ -81,7 +83,9 @@ it('retries a failed app query and replaces the error with its actual fields', ait('shows no parameters when the app has no user input fields', async () => {getApp.mockResolvedValue(createAppDetailFixture({ id: 'app-1', mode: 'completion' }))- renderWithConsoleQuery(<AppInputsPanel appDetail={appDetail} onFormChange={vi.fn()} />)+ renderWithConsoleQuery(+ <AppInputsPanel inputs={{}} appDetail={appDetail} onFormChange={vi.fn()} />,+ )expect(await screen.findByText('app.appSelector.noParams')).toBeInTheDocument()expect(screen.queryByRole('textbox')).not.toBeInTheDocument()})diff --git a/web/app/components/plugins/plugin-detail-panel/app-selector/__tests__/app-picker.spec.tsx b/web/app/components/plugins/plugin-detail-panel/app-selector/__tests__/app-picker.spec.tsxindex cb8b16fc75e..74124a7cf81 100644--- a/web/app/components/plugins/plugin-detail-panel/app-selector/__tests__/app-picker.spec.tsx+++ b/web/app/components/plugins/plugin-detail-panel/app-selector/__tests__/app-picker.spec.tsx@@ -1,86 +1,68 @@-import type { AppPartial } from '@dify/contracts/api/console/apps/types.gen'-import { render, screen } from '@testing-library/react'+import { screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'-import { useState } from 'react'+import { renderWithConsoleQuery } from '@/test/console/query-data'import { AppPicker } from '../app-picker'-vi.mock('@/app/components/base/app-icon', () => ({- default: () => <span aria-hidden="true" data-testid="app-icon" />,-}))+const { fetchApps } = vi.hoisted(() => ({ fetchApps: vi.fn() }))+vi.mock('@/service/console', async (importOriginal) => {+ const actual = await importOriginal<typeof import('@/service/console')>()+ const { withConsoleResponses } = await import('@/test/console/service-responses')+ return {+ ...actual,+ consoleQuery: withConsoleResponses(actual.consoleQuery, { 'apps.get': fetchApps }),+ }+})+vi.mock('@/app/components/base/app-icon', () => ({ default: () => null }))const app = {id: 'app-1',name: 'Workflow App',- mode: 'workflow' as const,+ mode: 'workflow',icon_type: 'emoji',icon: 'W',icon_background: '#FFFFFF',icon_url: null,-} satisfies AppPartial--function renderAppPicker(- overrides: Partial<Omit<React.ComponentProps<typeof AppPicker>, 'isShow' | 'onShowChange'>> = {},-) {- const props = {- disabled: false,- trigger: <span>Choose app</span>,- onSelect: vi.fn(),- apps: [app],- isLoading: false,- hasMore: false,- onLoadMore: vi.fn(),- searchText: '',- onSearchChange: vi.fn(),- ...overrides,- }-- function AppPickerHarness() {- const [open, setOpen] = useState(false)-- return <AppPicker {...props} isShow={open} onShowChange={setOpen} />- }-- return { props, ...render(<AppPickerHarness />) }}-describe('AppPicker', () => {- it('should expose a named dialog and keep app choices in the listbox', async () => {- const user = userEvent.setup()- renderAppPicker()- await user.click(screen.getByRole('combobox', { name: 'app.appSelector.label' }))-- const dialog = screen.getByRole('dialog', { name: 'app.appSelector.label' })- const listbox = screen.getByRole('listbox')- const option = screen.getByRole('option', { name: /Workflow App/ })-- expect(dialog).toBeInTheDocument()- expect(listbox).toContainElement(option)- })+it('announces loading without an empty result', async () => {+ fetchApps.mockReturnValue(new Promise(() => {}))+ renderWithConsoleQuery(<AppPicker value={null} onSelect={vi.fn()} />)+ expect(await screen.findByText(/common.loading/)).toBeInTheDocument()+ expect(screen.queryByText('common.noData')).not.toBeInTheDocument()+})- it('should not show the empty state while loading', async () => {- const user = userEvent.setup()- renderAppPicker({ apps: [], isLoading: true })- await user.click(screen.getByRole('combobox', { name: 'app.appSelector.label' }))+it('retries failed searches without announcing an empty result', async () => {+ const user = userEvent.setup()+ fetchApps+ .mockRejectedValueOnce(new Error('Unavailable'))+ .mockResolvedValue({ data: [app], page: 1, has_more: false })+ renderWithConsoleQuery(<AppPicker value={null} onSelect={vi.fn()} />)+ await user.click(await screen.findByRole('button', { name: 'common.operation.retry' }))+ expect(await screen.findByRole('option', { name: /Workflow App/ })).toBeInTheDocument()+ expect(screen.getByRole('combobox')).toHaveFocus()+ expect(screen.queryByText('common.noData')).not.toBeInTheDocument()+})- expect(- screen- .getAllByRole('status')- .some((status) => status.textContent?.includes('common.loading')),- ).toBe(true)- expect(screen.queryByText('common.noData')).not.toBeInTheDocument()+it('keeps existing options on a page failure and retries that page outside the listbox', async () => {+ const user = userEvent.setup()+ fetchApps.mockImplementation(({ query }: { query: { page: number } }) => {+ if (query.page === 2) throw new Error('Unavailable')+ return { data: [app], page: 1, has_more: true }})-- it('should keep load more outside the listbox and inside the named scroll region', async () => {- const user = userEvent.setup()- renderAppPicker({ hasMore: true })- await user.click(screen.getByRole('combobox', { name: 'app.appSelector.label' }))-- const listbox = screen.getByRole('listbox')- const scrollRegion = screen.getByRole('region', { name: 'app.appSelector.label' })- const loadMoreButton = screen.getByRole('button', { name: 'workflow.common.loadMore' })-- expect(listbox).not.toContainElement(loadMoreButton)- expect(scrollRegion).toContainElement(listbox)- expect(scrollRegion).toContainElement(loadMoreButton)+ renderWithConsoleQuery(<AppPicker value={null} onSelect={vi.fn()} />)+ await user.click(await screen.findByRole('button', { name: 'workflow.common.loadMore' }))+ const retry = await screen.findByRole('button', { name: 'common.operation.retry' })+ expect(screen.getByRole('option', { name: /Workflow App/ })).toBeInTheDocument()+ expect(screen.getByRole('listbox')).not.toContainElement(retry)+ expect(screen.getByRole('region', { name: 'app.appSelector.label' })).toContainElement(retry)+ fetchApps.mockResolvedValue({+ data: [{ ...app, id: 'app-2', name: 'Next App' }],+ page: 2,+ has_more: false,})+ await user.click(retry)+ expect(await screen.findByRole('option', { name: /Next App/ })).toBeInTheDocument()+ await waitFor(() =>+ expect(fetchApps).toHaveBeenLastCalledWith({ query: { page: 2, limit: 20, name: '' } }),+ )})diff --git a/web/app/components/plugins/plugin-detail-panel/app-selector/__tests__/index.browser.spec.tsx b/web/app/components/plugins/plugin-detail-panel/app-selector/__tests__/index.browser.spec.tsxnew file mode 100644index 00000000000..28feaec0e00--- /dev/null+++ b/web/app/components/plugins/plugin-detail-panel/app-selector/__tests__/index.browser.spec.tsx@@ -0,0 +1,181 @@+import type { AppPartial } from '@dify/contracts/api/console/apps/types.gen'+import type { AppSelectorValue } from '../index'+import { QueryClient, QueryClientProvider } from '@tanstack/react-query'+import { useState } from 'react'+import { beforeEach, expect, it, vi } from 'vite-plus/test'+import { page, userEvent } from 'vite-plus/test/browser'+import { render } from 'vitest-browser-react'+import { createAppDetailFixture } from '@/test/fixtures/app'+import { AppSelector } from '../index'++const apps = [+ {+ id: 'app-1',+ name: 'Support Bot',+ mode: 'chat',+ icon_type: 'emoji',+ icon: 'B',+ icon_background: '#FFFFFF',+ icon_url: null,+ },+ {+ id: 'app-2',+ name: 'Sales App',+ mode: 'chat',+ icon_type: 'emoji',+ icon: 'S',+ icon_background: '#FFFFFF',+ icon_url: null,+ },+] satisfies AppPartial[]+const { fetchApps, fetchApp } = vi.hoisted(() => ({ fetchApps: vi.fn(), fetchApp: vi.fn() }))+vi.mock('@/service/console', async (importOriginal) => {+ const actual = await importOriginal<typeof import('@/service/console')>()+ const { withConsoleResponses } = await import('@/test/console/service-responses')+ return {+ ...actual,+ consoleQuery: withConsoleResponses(actual.consoleQuery, {+ 'apps.get': fetchApps,+ 'apps.byAppId.get': fetchApp,+ 'files.upload.get': () => ({}),+ }),+ }+})+vi.mock('@/app/components/base/app-icon', () => ({ default: () => null }))++function Harness({+ onSelect,+ onSubmit,+}: {+ onSelect: (value: AppSelectorValue) => void+ onSubmit: () => void+}) {+ const [value, setValue] = useState<AppSelectorValue>()+ return (+ <form+ onSubmit={(event) => {+ event.preventDefault()+ onSubmit()+ }}+ >+ <AppSelector+ value={value}+ onSelect={(nextValue) => {+ setValue(nextValue)+ onSelect(nextValue)+ }}+ />+ <button type="submit">Save</button>+ </form>+ )+}++async function renderSelector() {+ const onSelect = vi.fn()+ const onSubmit = vi.fn()+ const client = new QueryClient({ defaultOptions: { queries: { retry: false } } })+ await render(+ <QueryClientProvider client={client}>+ <Harness onSelect={onSelect} onSubmit={onSubmit} />+ </QueryClientProvider>,+ )+ await page.getByRole('button', { name: 'app.appSelector.placeholder' }).click()+ await page.getByRole('button', { name: 'app.appSelector.placeholder' }).nth(1).click()+ const input = page.getByRole('combobox', { name: 'app.appSelector.searchPlaceholder' })+ await expect.element(input).toHaveFocus()+ return { input, onSelect, onSubmit }+}++beforeEach(() => {+ fetchApps.mockImplementation(({ query }: { query: { name: string; page: number } }) => ({+ data: apps.filter((app) => app.name.toLowerCase().includes(query.name.toLowerCase())),+ page: query.page,+ has_more: false,+ }))+ fetchApp.mockImplementation(({ params }: { params: { app_id: string } }) =>+ createAppDetailFixture(apps.find((app) => app.id === params.app_id)),+ )+})++it('dismisses only the inner picker with Escape and starts a fresh search after either popover closes', async () => {+ const { input, onSubmit } = await renderSelector()+ await input.fill('sales')+ await expect.element(page.getByRole('option', { name: /Sales App/ })).toBeVisible()+ await userEvent.keyboard('{Escape}')+ await expect.element(input).not.toBeInTheDocument()+ const innerTrigger = page.getByRole('button', { name: 'app.appSelector.placeholder' }).nth(1)+ await expect.element(innerTrigger).toHaveFocus()+ await innerTrigger.click()+ await expect.element(input).toHaveValue('')+ await input.fill('missing')+ await expect.element(page.getByText('common.noData')).toBeVisible()+ await userEvent.keyboard('{Enter}')+ expect(onSubmit).not.toHaveBeenCalled()+ await userEvent.keyboard('{Escape}')+ await expect.element(input).not.toBeInTheDocument()+ await userEvent.keyboard('{Escape}')+ await expect+ .element(page.getByRole('button', { name: 'app.appSelector.placeholder' }))+ .toHaveFocus()+ await page.getByRole('button', { name: 'app.appSelector.placeholder' }).click()+ await page.getByRole('button', { name: 'app.appSelector.placeholder' }).nth(1).click()+ await expect.element(input).toHaveValue('')+ await expect.element(page.getByRole('option', { name: /Support Bot/ })).toBeVisible()+})++it('removes a highlighted stale result during remote search and selects the new result with the keyboard', async () => {+ const { input, onSelect, onSubmit } = await renderSelector()+ await expect.element(page.getByRole('option', { name: /Support Bot/ })).toBeVisible()+ await userEvent.keyboard('{ArrowDown}')+ await expect.element(input).toHaveAttribute('aria-activedescendant')+ let resolveSearch!: (value: { data: AppPartial[]; page: number; has_more: boolean }) => void+ fetchApps.mockImplementation(({ query }: { query: { name: string } }) =>+ query.name+ ? new Promise((resolve) => {+ resolveSearch = resolve+ })+ : { data: apps, page: 1, has_more: false },+ )+ await input.fill('sales')+ await expect.element(page.getByRole('option')).not.toBeInTheDocument()+ await userEvent.keyboard('{Enter}')+ expect(onSelect).not.toHaveBeenCalled()+ expect(onSubmit).not.toHaveBeenCalled()+ await expect.poll(() => resolveSearch).toBeTypeOf('function')+ resolveSearch({ data: [apps[1]!], page: 1, has_more: false })+ await expect.element(page.getByRole('option', { name: /Sales App/ })).toBeVisible()+ await userEvent.keyboard('{ArrowDown}')+ await expect.element(input).toHaveAttribute('aria-activedescendant')+ await userEvent.keyboard('{Enter}')+ await expect.element(input).not.toBeInTheDocument()+ expect(onSelect).toHaveBeenLastCalledWith({ app_id: 'app-2', inputs: {}, files: [] })+ expect(onSubmit).not.toHaveBeenCalled()+ const innerTrigger = page.getByRole('button', { name: 'Sales App' }).nth(1)+ await expect.element(innerTrigger).toHaveFocus()+ await innerTrigger.click()+ await expect.element(input).toHaveValue('')+ await expect+ .element(page.getByRole('option', { name: /Sales App/ }))+ .toHaveAttribute('aria-selected', 'true')+})++it('keeps pagination reachable in the scroll area and selects an app from the appended page', async () => {+ const firstPage = Array.from({ length: 20 }, (_, index) => ({+ ...apps[0]!,+ id: `app-${index + 1}`,+ name: `Application ${index + 1}`,+ }))+ const nextApp = { ...apps[1]!, id: 'app-21', name: 'Application 21' }+ fetchApps.mockImplementation(({ query }: { query: { page: number } }) => ({+ data: query.page === 1 ? firstPage : [nextApp],+ page: query.page,+ has_more: query.page === 1,+ }))+ const { onSelect } = await renderSelector()+ const region = page.getByRole('region', { name: 'app.appSelector.label' })+ await expect.element(region).toBeVisible()+ expect(region.element().scrollHeight).toBeGreaterThan(region.element().clientHeight)+ await page.getByRole('button', { name: 'workflow.common.loadMore' }).click()+ await page.getByRole('option', { name: /Application 21/ }).click()+ expect(onSelect).toHaveBeenLastCalledWith({ app_id: 'app-21', inputs: {}, files: [] })+})diff --git a/web/app/components/plugins/plugin-detail-panel/app-selector/__tests__/index.spec.tsx b/web/app/components/plugins/plugin-detail-panel/app-selector/__tests__/index.spec.tsxindex 0d627a3e452..b17d7b4807e 100644--- a/web/app/components/plugins/plugin-detail-panel/app-selector/__tests__/index.spec.tsx+++ b/web/app/components/plugins/plugin-detail-panel/app-selector/__tests__/index.spec.tsx@@ -95,7 +95,7 @@ describe('AppSelector', () => {<AppSelector value={{ app_id: 'app-2', inputs: {} }} onSelect={vi.fn()} />,)- await user.click(screen.getByRole('button', { name: 'app.appSelector.label' }))+ await user.click(await screen.findByRole('button', { name: 'Workflow App' }))await waitFor(() => {expect(fetchWorkflow).toHaveBeenCalledWith({ params: { app_id: 'app-2' } })@@ -128,12 +128,12 @@ describe('AppSelector', () => {renderWithConsoleQuery(<StatefulAppSelector onSelect={onSelect} />)- await user.click(screen.getByRole('button', { name: 'app.appSelector.label' }))- await user.click(screen.getByRole('combobox', { name: 'app.appSelector.label' }))+ await user.click(screen.getByRole('button', { name: 'app.appSelector.placeholder' }))+ await user.click(screen.getAllByRole('button', { name: 'app.appSelector.placeholder' })[1]!)await user.click(await screen.findByRole('option', { name: /Support Bot/ }))await user.type(await screen.findByPlaceholderText('First question'), 'alpha')- await user.click(screen.getByRole('combobox', { name: 'app.appSelector.label' }))+ await user.click(screen.getAllByRole('button', { name: 'Support Bot' })[1]!)await user.click(await screen.findByRole('option', { name: /Sales Bot/ }))await user.type(await screen.findByPlaceholderText('Second question'), 'beta')@@ -150,8 +150,8 @@ describe('AppSelector', () => {renderWithConsoleQuery(<StatefulAppSelector onSelect={onSelect} />)- await user.click(screen.getByRole('button', { name: 'app.appSelector.label' }))- await user.click(screen.getByRole('combobox', { name: 'app.appSelector.label' }))+ await user.click(screen.getByRole('button', { name: 'app.appSelector.placeholder' }))+ await user.click(screen.getAllByRole('button', { name: 'app.appSelector.placeholder' })[1]!)await waitFor(() => {expect(screen.getByText('Support Bot')).toBeInTheDocument()@@ -160,16 +160,16 @@ describe('AppSelector', () => {await user.click(screen.getByText('Support Bot'))expect(onSelect).toHaveBeenLastCalledWith({ app_id: 'app-1', inputs: {}, files: [] })expect(screen.queryByRole('option')).not.toBeInTheDocument()- await user.click(screen.getByRole('combobox', { name: 'app.appSelector.label' }))+ await user.click(screen.getAllByRole('button', { name: 'Support Bot' })[1]!)await user.type(- screen.getByRole('combobox', { name: 'app.appSelector.placeholder' }),+ screen.getByRole('combobox', { name: 'app.appSelector.searchPlaceholder' }),'workflow',)await waitFor(() => {expect(screen.queryByRole('option', { name: /Support Bot/ })).not.toBeInTheDocument()})- expect(screen.getByRole('option', { name: /Workflow App/ })).toBeInTheDocument()+ expect(await screen.findByRole('option', { name: /Workflow App/ })).toBeInTheDocument()await user.keyboard('{ArrowDown}')await user.keyboard('{Enter}')@@ -182,4 +182,18 @@ describe('AppSelector', () => {})})})+ it('preserves inputs and files when the current app is selected again', async () => {+ const user = userEvent.setup()+ const onSelect = vi.fn()+ const value = {+ app_id: 'app-1',+ inputs: { question: 'Keep this draft' },+ files: ['attachment'],+ }+ renderWithConsoleQuery(<AppSelector value={value} onSelect={onSelect} />)+ await user.click(await screen.findByRole('button', { name: 'Support Bot' }))+ await user.click(screen.getAllByRole('button', { name: 'Support Bot' })[1]!)+ await user.click(await screen.findByRole('option', { name: /Support Bot/ }))+ expect(onSelect).toHaveBeenLastCalledWith(value)+ })})diff --git a/web/app/components/plugins/plugin-detail-panel/app-selector/app-inputs-panel.tsx b/web/app/components/plugins/plugin-detail-panel/app-selector/app-inputs-panel.tsxindex e2cc079c024..b64b1ec88fc 100644--- a/web/app/components/plugins/plugin-detail-panel/app-selector/app-inputs-panel.tsx+++ b/web/app/components/plugins/plugin-detail-panel/app-selector/app-inputs-panel.tsx@@ -1,25 +1,21 @@'use client'import type { AppPartial } from '@dify/contracts/api/console/apps/types.gen'import { Button } from '@langgenius/dify-ui/button'-import { cn } from '@langgenius/dify-ui/cn'import { useRef } from 'react'import { useTranslation } from 'react-i18next'import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder'import AppInputsForm from '@/app/components/plugins/plugin-detail-panel/app-selector/app-inputs-form'import { useAppInputsFormSchema } from '@/app/components/plugins/plugin-detail-panel/app-selector/hooks/use-app-inputs-form-schema'-type Props = Readonly<{- value?: {- app_id: string- inputs: Record<string, unknown>- }+type AppInputsPanelProps = {+ inputs: Record<string, unknown>appDetail: Pick<AppPartial, 'id' | 'mode'>onFormChange: (value: Record<string, unknown>) => void-}>+}-const AppInputsPanel = ({ value, appDetail, onFormChange }: Props) => {+const AppInputsPanel = ({ inputs, appDetail, onFormChange }: AppInputsPanelProps) => {const { t } = useTranslation(['app', 'common'])- const inputsRef = useRef<Record<string, unknown>>(value?.inputs || {})+ const inputsRef = useRef(inputs)const { inputFormSchema, isError, isLoading, retry } = useAppInputsFormSchema({ appDetail })@@ -31,7 +27,7 @@ const AppInputsPanel = ({ value, appDetail, onFormChange }: Props) => {const hasInputs = inputFormSchema.length > 0return (- <div className={cn('flex max-h-60 flex-col rounded-b-2xl border-t border-divider-subtle pb-4')}>+ <div className="flex max-h-60 flex-col rounded-b-2xl border-t border-divider-subtle pb-4">{isLoading && (<div className="pt-3"><LoadingPlaceholder className="h-full" />@@ -63,7 +59,7 @@ const AppInputsPanel = ({ value, appDetail, onFormChange }: Props) => {{!isLoading && !isError && hasInputs && (<div className="grow overflow-y-auto"><AppInputsForm- inputs={value?.inputs || {}}+ inputs={inputs}inputsRef={inputsRef}inputsForms={inputFormSchema}onFormChange={handleFormChange}diff --git a/web/app/components/plugins/plugin-detail-panel/app-selector/app-list-query.ts b/web/app/components/plugins/plugin-detail-panel/app-selector/app-list-query.tsnew file mode 100644index 00000000000..55fec7fba96--- /dev/null+++ b/web/app/components/plugins/plugin-detail-panel/app-selector/app-list-query.ts@@ -0,0 +1,11 @@+import { consoleQuery } from '@/service/console'++export function appListOptions(name = '') {+ return consoleQuery.apps.get.infiniteOptions({+ input: (pageParam) => ({+ query: { page: Number(pageParam), limit: 20, name },+ }),+ getNextPageParam: (lastPage) => (lastPage.has_more ? lastPage.page + 1 : undefined),+ initialPageParam: 1,+ })+}diff --git a/web/app/components/plugins/plugin-detail-panel/app-selector/app-picker.tsx b/web/app/components/plugins/plugin-detail-panel/app-selector/app-picker.tsxindex 6cd11801238..2cae83e7a2b 100644--- a/web/app/components/plugins/plugin-detail-panel/app-selector/app-picker.tsx+++ b/web/app/components/plugins/plugin-detail-panel/app-selector/app-picker.tsx@@ -1,7 +1,6 @@'use client'import type { AppPartial } from '@dify/contracts/api/console/apps/types.gen'-import type { ReactNode } from 'react'import { Button } from '@langgenius/dify-ui/button'import {Combobox,@@ -11,11 +10,7 @@ import {ComboboxItem,ComboboxItemText,ComboboxList,- ComboboxPopup,- ComboboxPortal,- ComboboxPositioner,ComboboxStatus,- ComboboxTrigger,} from '@langgenius/dify-ui/combobox'import {ScrollArea,@@ -24,22 +19,16 @@ import {ScrollAreaThumb,ScrollAreaViewport,} from '@langgenius/dify-ui/scroll-area'-import { useCallback } from 'react'+import { useInfiniteQuery } from '@tanstack/react-query'+import { useDebouncedValue } from 'foxact/use-debounced-value'+import { useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import AppIcon from '@/app/components/base/app-icon'+import { appListOptions } from './app-list-query'type AppPickerProps = {- disabled: boolean- trigger: ReactNode- isShow: boolean- onShowChange: (isShow: boolean) => void+ value: AppPartial | nullonSelect: (app: AppPartial) => void- apps: AppPartial[]- isLoading: boolean- hasMore: boolean- onLoadMore: () => void- searchText: string- onSearchChange: (text: string) => void}function getAppTypeLabel(app: AppPartial) {@@ -59,21 +48,17 @@ function getAppTypeLabel(app: AppPartial) {}}-function getAppSearchText(app: AppPartial) {- return `${app.name} ${app.id} ${getAppTypeLabel(app)}`-}-function AppPickerOption({ app }: { app: AppPartial }) {return (<ComboboxItemkey={app.id}value={app}- className="grid-cols-[minmax(0,1fr)_auto] gap-3 py-1 pr-3 pl-2"+ className="grid-cols-[minmax(0,1fr)_auto] gap-3 py-1 ps-2 pe-3"><ComboboxItemText className="flex items-center gap-3"><AppIcon className="shrink-0" size="xs" icon={app} /><span className="min-w-0 grow truncate system-sm-medium text-components-input-text-filled">- <span className="mr-1">{app.name}</span>+ <span className="me-1">{app.name}</span><span className="text-text-tertiary">({app.id.slice(0, 8)})</span></span></ComboboxItemText>@@ -84,101 +69,110 @@ function AppPickerOption({ app }: { app: AppPartial }) {)}-export function AppPicker({- disabled,- trigger,- isShow,- onShowChange,- onSelect,- apps,- isLoading,- hasMore,- onLoadMore,- searchText,- onSearchChange,-}: AppPickerProps) {+export function AppPicker({ value, onSelect }: AppPickerProps) {const { t } = useTranslation(['app', 'common', 'workflow'])- const handleValueChange = useCallback(- (app: AppPartial | null) => {- if (!app) return-- onSelect(app)- onShowChange(false)- },- [onSelect, onShowChange],- )+ const [searchText, setSearchText] = useState('')+ const inputRef = useRef<HTMLInputElement>(null)+ const debouncedSearchText = useDebouncedValue(searchText, 500)+ const {+ data,+ isPending,+ isError,+ isFetching,+ isFetchingNextPage,+ isFetchNextPageError,+ fetchNextPage,+ hasNextPage,+ refetch,+ } = useInfiniteQuery(appListOptions(debouncedSearchText))+ const isDebouncing = searchText !== debouncedSearchText+ const isLoading = isDebouncing || isPending+ const showError = !isDebouncing && isError+ const apps =+ isLoading || (showError && !isFetchNextPageError)+ ? []+ : (data?.pages.flatMap((page) => page.data) ?? [])return (<Combobox<AppPartial>+ inline+ openitems={apps}- open={isShow}inputValue={searchText}- onOpenChange={onShowChange}- onInputValueChange={onSearchChange}- onValueChange={handleValueChange}- itemToStringLabel={(app) => app?.name ?? ''}- itemToStringValue={(app) => app?.id ?? ''}- filter={(app, query) => getAppSearchText(app).toLowerCase().includes(query.toLowerCase())}- disabled={disabled}+ onInputValueChange={setSearchText}+ onValueChange={(app) => {+ if (app) onSelect(app)+ }}+ itemToStringLabel={(app) => app.name}+ filter={null}+ value={value}+ isItemEqualToValue={(app, selectedApp) => app.id === selectedApp.id}>- <ComboboxTrigger- aria-label={t(($) => $['appSelector.label'], { ns: 'app' })}- className="block w-full min-w-0 rounded-lg text-left data-disabled:cursor-not-allowed data-disabled:bg-components-input-bg-disabled"- >- {trigger}- </ComboboxTrigger>- <ComboboxPortal>- <ComboboxPositioner align="center">- <ComboboxPopup- aria-label={t(($) => $['appSelector.label'], { ns: 'app' })}- className="border-0 bg-transparent p-0 shadow-none backdrop-blur-none"- >- <div className="relative flex max-h-100 min-h-20 w-89 flex-col rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg-blur shadow-lg backdrop-blur-xs">- <ComboboxInputGroup>- <span- className="i-ri-search-line size-4 shrink-0 text-text-tertiary"- aria-hidden="true"- />- <ComboboxInput- aria-label={t(($) => $['appSelector.placeholder'], { ns: 'app' })}- placeholder={t(($) => $['appSelector.placeholder'], { ns: 'app' })}- />- </ComboboxInputGroup>- <ScrollArea className="min-h-0 flex-1 overflow-hidden">- <ScrollAreaViewport- role="region"- aria-label={t(($) => $['appSelector.label'], { ns: 'app' })}- style={{ overflowX: 'hidden' }}+ <ComboboxInputGroup className="mx-1 mt-1 w-auto">+ <span className="i-ri-search-line size-4 shrink-0 text-text-tertiary" aria-hidden />+ <ComboboxInput+ ref={inputRef}+ aria-label={t(($) => $['appSelector.searchPlaceholder'], { ns: 'app' })}+ placeholder={t(($) => $['appSelector.searchPlaceholder'], { ns: 'app' })}+ />+ </ComboboxInputGroup>+ <ScrollArea className="flex min-h-0 flex-1 flex-col overflow-hidden">+ <ScrollAreaViewport+ className="h-auto min-h-0 flex-1"+ role="region"+ aria-label={t(($) => $['appSelector.label'], { ns: 'app' })}+ style={{ overflowX: 'hidden' }}+ >+ <ScrollAreaContent className="p-1" style={{ minWidth: 0 }}>+ <ComboboxStatus>+ {isLoading || isFetchingNextPage ? t(($) => $.loading, { ns: 'common' }) : null}+ </ComboboxStatus>+ <ComboboxList<AppPartial> className="max-h-none overflow-visible p-0">+ {(app) => <AppPickerOption key={app.id} app={app} />}+ </ComboboxList>+ <ComboboxEmpty>+ {!isLoading && !showError ? t(($) => $.noData, { ns: 'common' }) : null}+ </ComboboxEmpty>+ {showError && (+ <div className="flex flex-col items-center gap-1 px-3 py-2">+ <span role="status" className="system-xs-regular text-text-tertiary">+ {t(($) => $['dynamicSelect.error'], { ns: 'common' })}+ </span>+ <Button+ size="small"+ variant="ghost"+ disabled={isFetching}+ onClick={() => {+ inputRef.current?.focus()+ if (isFetchNextPageError) void fetchNextPage()+ else void refetch()+ }}+ >+ {t(($) => $['operation.retry'], { ns: 'common' })}+ </Button>+ </div>+ )}+ {!isLoading && !showError && hasNextPage && (+ <div className="flex justify-center px-3 py-2">+ <Button+ size="small"+ disabled={isFetchingNextPage}+ onClick={() => {+ void fetchNextPage()+ }}>- <ScrollAreaContent className="p-1" style={{ minWidth: 0 }}>- <ComboboxStatus>- {isLoading ? t(($) => $.loading, { ns: 'common' }) : null}- </ComboboxStatus>- <ComboboxList<AppPartial> className="max-h-none overflow-visible p-0">- {(app) => <AppPickerOption key={app.id} app={app} />}- </ComboboxList>- <ComboboxEmpty>- {!isLoading ? t(($) => $.noData, { ns: 'common' }) : null}- </ComboboxEmpty>- {hasMore && (- <div className="flex justify-center px-3 py-2">- <Button size="small" disabled={isLoading} onClick={() => onLoadMore()}>- {isLoading- ? t(($) => $.loading, { ns: 'common' })- : t(($) => $['common.loadMore'], { ns: 'workflow' })}- </Button>- </div>- )}- </ScrollAreaContent>- </ScrollAreaViewport>- <ScrollAreaScrollbar>- <ScrollAreaThumb />- </ScrollAreaScrollbar>- </ScrollArea>- </div>- </ComboboxPopup>- </ComboboxPositioner>- </ComboboxPortal>+ {isFetchingNextPage+ ? t(($) => $.loading, { ns: 'common' })+ : t(($) => $['common.loadMore'], { ns: 'workflow' })}+ </Button>+ </div>+ )}+ </ScrollAreaContent>+ </ScrollAreaViewport>+ <ScrollAreaScrollbar>+ <ScrollAreaThumb />+ </ScrollAreaScrollbar>+ </ScrollArea></Combobox>)}diff --git a/web/app/components/plugins/plugin-detail-panel/app-selector/app-trigger.tsx b/web/app/components/plugins/plugin-detail-panel/app-selector/app-trigger.tsxindex 6677c7b69e4..cd48f4a5b58 100644--- a/web/app/components/plugins/plugin-detail-panel/app-selector/app-trigger.tsx+++ b/web/app/components/plugins/plugin-detail-panel/app-selector/app-trigger.tsx@@ -1,30 +1,32 @@'use client'import type { AppPartial } from '@dify/contracts/api/console/apps/types.gen'+import type { ComponentProps } from 'react'import { cn } from '@langgenius/dify-ui/cn'import { useTranslation } from 'react-i18next'import AppIcon from '@/app/components/base/app-icon'-type AppTriggerProps = {- open: boolean+type AppTriggerProps = ComponentProps<'button'> & {appDetail?: Pick<AppPartial,'icon' | 'icon_background' | 'icon_type' | 'icon_url' | 'id' | 'name'>}-export function AppTrigger({ open, appDetail }: AppTriggerProps) {+export function AppTrigger({ appDetail, className, ...props }: AppTriggerProps) {const { t } = useTranslation(['app'])return (- <span+ <button+ {...props}+ type="button"className={cn(- 'group flex cursor-pointer items-center rounded-lg bg-components-input-bg-normal p-2 pl-3 hover:bg-state-base-hover-alt',- open && 'bg-state-base-hover-alt',- appDetail && 'py-1.5 pl-1.5',+ 'group flex w-full min-w-0 cursor-pointer items-center rounded-lg bg-components-input-bg-normal p-2 ps-3 text-start hover:bg-state-base-hover-alt disabled:cursor-not-allowed data-popup-open:bg-state-base-hover-alt',+ appDetail && 'py-1.5 ps-1.5',+ className,)}>- {appDetail && <AppIcon className="mr-2 shrink-0" size="xs" icon={appDetail} />}+ {appDetail && <AppIcon className="me-2 shrink-0" size="xs" icon={appDetail} />}{appDetail ? (<span className="min-w-0 grow truncate system-sm-medium text-components-input-text-filled">{appDetail.name}@@ -35,12 +37,9 @@ export function AppTrigger({ open, appDetail }: AppTriggerProps) {</span>)}<span- className={cn(- 'ml-0.5 i-ri-arrow-down-s-line size-4 shrink-0 text-text-quaternary group-hover:text-text-secondary',- open && 'text-text-secondary',- )}+ className="ms-0.5 i-ri-arrow-down-s-line size-4 shrink-0 text-text-quaternary group-hover:text-text-secondary group-data-popup-open:text-text-secondary"aria-hidden="true"/>- </span>+ </button>)}diff --git a/web/app/components/plugins/plugin-detail-panel/app-selector/index.tsx b/web/app/components/plugins/plugin-detail-panel/app-selector/index.tsxindex 71889be5aef..518a9bf069e 100644--- a/web/app/components/plugins/plugin-detail-panel/app-selector/index.tsx+++ b/web/app/components/plugins/plugin-detail-panel/app-selector/index.tsx@@ -1,17 +1,16 @@'use client'import type { AppPartial } from '@dify/contracts/api/console/apps/types.gen'-import { cn } from '@langgenius/dify-ui/cn'-import { Popover, PopoverContent, PopoverTrigger } from '@langgenius/dify-ui/popover'-import { keepPreviousData, skipToken, useInfiniteQuery, useQuery } from '@tanstack/react-query'-import { useCallback, useMemo, useState } from 'react'+import type { PopoverActions } from '@langgenius/dify-ui/popover'+import { Popover, PopoverContent, PopoverTitle, PopoverTrigger } from '@langgenius/dify-ui/popover'+import { skipToken, useInfiniteQuery, useQuery } from '@tanstack/react-query'+import { useCallback, useMemo, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import AppInputsPanel from '@/app/components/plugins/plugin-detail-panel/app-selector/app-inputs-panel'import { AppPicker } from '@/app/components/plugins/plugin-detail-panel/app-selector/app-picker'import { AppTrigger } from '@/app/components/plugins/plugin-detail-panel/app-selector/app-trigger'import { consoleQuery } from '@/service/console'--const PAGE_SIZE = 20+import { appListOptions } from './app-list-query'export type AppSelectorValue = {app_id: string@@ -27,35 +26,9 @@ type AppSelectorProps = {export function AppSelector({ value, disabled, onSelect }: AppSelectorProps) {const { t } = useTranslation(['app'])- const [isShowChooseApp, setIsShowChooseApp] = useState(false)- const [searchText, setSearchText] = useState('')-- const appListQuery = useMemo(- () => ({- page: 1,- limit: PAGE_SIZE,- name: searchText,- }),- [searchText],- )-- const { data, isLoading, isFetchingNextPage, fetchNextPage, hasNextPage } = useInfiniteQuery({- ...consoleQuery.apps.get.infiniteOptions({- input: (pageParam) => ({- query: {- ...appListQuery,- page: Number(pageParam),- },- }),- getNextPageParam: (lastPage) => (lastPage.has_more ? lastPage.page + 1 : undefined),- initialPageParam: 1,- placeholderData: keepPreviousData,- }),- })-- const displayedApps = useMemo(() => {- return data?.pages.flatMap(({ data: apps }) => apps) ?? []- }, [data?.pages])+ const pickerActionsRef = useRef<PopoverActions>(null)+ const [selectedApp, setSelectedApp] = useState<AppPartial>()+ const { data } = useInfiniteQuery(appListOptions())const { data: selectedAppDetail } = useQuery(consoleQuery.apps.byAppId.get.queryOptions({@@ -66,13 +39,17 @@ export function AppSelector({ value, disabled, onSelect }: AppSelectorProps) {const currentAppInfo = useMemo(() => {if (!value?.app_id) return undefined- return selectedAppDetail || displayedApps.find((app) => app.id === value.app_id)- }, [displayedApps, selectedAppDetail, value?.app_id])-- const hasMore = hasNextPage ?? true+ return (+ selectedAppDetail ||+ (selectedApp?.id === value.app_id ? selectedApp : undefined) ||+ data?.pages.flatMap((page) => page.data).find((app) => app.id === value.app_id)+ )+ }, [data?.pages, selectedApp, selectedAppDetail, value?.app_id])const handleSelectApp = useCallback((app: AppPartial) => {+ setSelectedApp(app)+ pickerActionsRef.current?.close()const shouldClearValue = app.id !== value?.app_idonSelect({@@ -99,69 +76,47 @@ export function AppSelector({ value, disabled, onSelect }: AppSelectorProps) {[onSelect, value?.app_id, value?.files],)- const formattedValue = useMemo(+ const formattedInputs = useMemo(() => ({- app_id: value?.app_id || '',- inputs: {- ...value?.inputs,- ...(value?.files?.length ? { '#image#': value.files[0] } : {}),- },+ ...value?.inputs,+ ...(value?.files?.length ? { '#image#': value.files[0] } : {}),}),- [value],+ [value?.inputs, value?.files],)return (<Popover>- <PopoverTrigger- aria-label={t(($) => $['appSelector.label'], { ns: 'app' })}- disabled={disabled}- render={(props, state) => (- <button- {...props}- type="button"- className={cn(- 'block w-full rounded-lg border-0 bg-transparent p-0 text-left',- props.className,- )}- >- <AppTrigger open={state.open} appDetail={currentAppInfo} />- </button>- )}- />+ <PopoverTrigger disabled={disabled} render={<AppTrigger appDetail={currentAppInfo} />} /><PopoverContentsideOffset={4}- className="border-0 bg-transparent p-0 shadow-none backdrop-blur-none"+ className="relative min-h-20 w-97.25 max-w-(--available-width) bg-components-panel-bg-blur backdrop-blur-xs">- <div className="relative min-h-20 w-97.25 rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg-blur shadow-lg backdrop-blur-xs">- <div className="flex flex-col gap-1 px-4 py-3">- <div className="flex h-6 items-center system-sm-semibold text-text-secondary">- {t(($) => $['appSelector.label'], { ns: 'app' })}- </div>- <AppPicker- trigger={<AppTrigger open={isShowChooseApp} appDetail={currentAppInfo} />}- isShow={isShowChooseApp}- onShowChange={setIsShowChooseApp}- disabled={false}- onSelect={handleSelectApp}- apps={displayedApps}- isLoading={isLoading || isFetchingNextPage}- hasMore={hasMore}- onLoadMore={() => {- void fetchNextPage()- }}- searchText={searchText}- onSearchChange={setSearchText}- />- </div>- {currentAppInfo && (- <AppInputsPanel- key={currentAppInfo.id}- value={formattedValue}- appDetail={currentAppInfo}- onFormChange={handleFormChange}- />- )}+ <div className="flex flex-col gap-1 px-4 py-3">+ <PopoverTitle className="flex h-6 items-center system-sm-semibold text-text-secondary">+ {t(($) => $['appSelector.label'], { ns: 'app' })}+ </PopoverTitle>+ <Popover actionsRef={pickerActionsRef}>+ <PopoverTrigger render={<AppTrigger appDetail={currentAppInfo} />} />+ <PopoverContent+ align="center"+ sideOffset={4}+ className="relative flex max-h-[min(25rem,var(--available-height))] min-h-20 w-89 max-w-(--available-width) flex-col bg-components-panel-bg-blur backdrop-blur-xs"+ >+ <PopoverTitle className="sr-only">+ {t(($) => $['appSelector.label'], { ns: 'app' })}+ </PopoverTitle>+ <AppPicker value={currentAppInfo ?? null} onSelect={handleSelectApp} />+ </PopoverContent>+ </Popover></div>+ {currentAppInfo && (+ <AppInputsPanel+ key={currentAppInfo.id}+ inputs={formattedInputs}+ appDetail={currentAppInfo}+ onFormChange={handleFormChange}+ />+ )}</PopoverContent></Popover>)diff --git a/web/app/components/plugins/plugin-detail-panel/tool-selector/components/__tests__/reasoning-config-form.spec.tsx b/web/app/components/plugins/plugin-detail-panel/tool-selector/components/__tests__/reasoning-config-form.spec.tsxindex 0824bc44157..8638ec6e731 100644--- a/web/app/components/plugins/plugin-detail-panel/tool-selector/components/__tests__/reasoning-config-form.spec.tsx+++ b/web/app/components/plugins/plugin-detail-panel/tool-selector/components/__tests__/reasoning-config-form.spec.tsx@@ -352,8 +352,8 @@ describe('ReasoningConfigForm', () => {}render(<Owner />)- await user.click(screen.getByRole('button', { name: 'app.appSelector.label' }))- await user.click(screen.getByRole('combobox', { name: 'app.appSelector.label' }))+ await user.click(screen.getByRole('button', { name: 'app.appSelector.placeholder' }))+ await user.click(screen.getAllByRole('button', { name: 'app.appSelector.placeholder' })[1]!)await user.click(await screen.findByRole('option', { name: /Support Bot/ }))await user.type(await screen.findByPlaceholderText('Topic'), 'hello')@@ -370,9 +370,9 @@ describe('ReasoningConfigForm', () => {)await user.keyboard('{Escape}')await waitFor(() => expect(screen.queryByRole('dialog')).not.toBeInTheDocument())- await user.click(screen.getByRole('button', { name: 'app.appSelector.label' }))+ await user.click(await screen.findByRole('button', { name: 'Support Bot' }))expect(await screen.findByPlaceholderText('Topic')).toHaveValue('hello')- expect(screen.getByRole('combobox', { name: 'app.appSelector.label' })).toHaveTextContent(+ expect(screen.getAllByRole('button', { name: 'Support Bot' })[1]!).toHaveTextContent('Support Bot',)})@@ -395,7 +395,7 @@ describe('ReasoningConfigForm', () => {nodeId="node-1"/>,)- await user.click(screen.getByRole('button', { name: 'app.appSelector.label' }))+ await user.click(await screen.findByRole('button', { name: 'Support Bot' }))expect(await screen.findByPlaceholderText('Topic')).toHaveValue('Saved topic')expect(onChange).not.toHaveBeenCalled()})diff --git a/web/features/new-rag/documents/metadata/__tests__/picker.browser.spec.tsx b/web/features/new-rag/documents/metadata/__tests__/picker.browser.spec.tsxnew file mode 100644index 00000000000..94fda082f90--- /dev/null+++ b/web/features/new-rag/documents/metadata/__tests__/picker.browser.spec.tsx@@ -0,0 +1,94 @@+import type { DocumentMetadataField } from '../editor-model'+import { expect, it, vi } from 'vite-plus/test'+import { page, userEvent } from 'vite-plus/test/browser'+import { render } from 'vitest-browser-react'+import { DocumentMetadataPicker } from '../picker'++const fields: DocumentMetadataField[] = [+ {+ id: 'author',+ name: 'Author',+ type: 'string',+ count: 0,+ rowVersion: 1,+ createdAt: '',+ updatedAt: '',+ },+ {+ id: 'year',+ name: 'Year',+ type: 'number',+ count: 0,+ rowVersion: 1,+ createdAt: '',+ updatedAt: '',+ },+]+const props = {+ fields,+ creating: false,+ error: false,+ loading: false,+ onCreate: vi.fn(),+ onManage: vi.fn(),+ onRetry: vi.fn(),+}++it('exposes the visible list immediately and selects a field without submitting the enclosing form', async () => {+ const onSelect = vi.fn()+ const onSubmit = vi.fn((event) => event.preventDefault())+ const screen = await render(+ <form onSubmit={onSubmit}>+ <DocumentMetadataPicker {...props} onSelect={onSelect} />+ <button type="submit">Save</button>+ </form>,+ )+ await screen.getByRole('button', { name: 'dataset.metadata.addMetadata' }).click()+ const input = page.getByRole('combobox', { name: 'dataset.metadata.selectMetadata.search' })+ await expect.element(input).toHaveFocus()+ await expect.element(input).toHaveAttribute('aria-expanded', 'true')+ await expect.element(page.getByRole('listbox')).toBeVisible()+ await input.fill('year')+ await expect.element(page.getByRole('option', { name: /Year/ })).toBeVisible()+ await userEvent.keyboard('{ArrowDown}')+ await expect.element(input).toHaveAttribute('aria-activedescendant')+ await userEvent.keyboard('{Enter}')+ await expect.element(input).not.toBeInTheDocument()+ expect(onSelect).toHaveBeenCalledWith(fields[1])+ expect(onSubmit).not.toHaveBeenCalled()+})++it('resets the search when returning from create and after one Escape closes the picker', async () => {+ const screen = await render(<DocumentMetadataPicker {...props} onSelect={vi.fn()} />)+ const trigger = screen.getByRole('button', { name: 'dataset.metadata.addMetadata' })+ await trigger.click()+ const search = page.getByRole('combobox', { name: 'dataset.metadata.selectMetadata.search' })+ await search.fill('year')+ await page.getByRole('button', { name: 'dataset.metadata.selectMetadata.newAction' }).click()+ await expect.element(page.getByRole('textbox')).toHaveFocus()+ await page.getByRole('button', { name: 'common.operation.cancel' }).click()+ await expect.element(search).toHaveFocus()+ await expect.element(search).toHaveValue('')+ await search.fill('author')+ await userEvent.keyboard('{Escape}')+ await expect.element(search).not.toBeInTheDocument()+ await trigger.click()+ await expect.element(search).toHaveValue('')+ await expect.element(page.getByRole('option', { name: /Year/ })).toBeVisible()+})++it('does not submit the enclosing form when Enter has no matching field', async () => {+ const onSubmit = vi.fn((event) => event.preventDefault())+ const screen = await render(+ <form onSubmit={onSubmit}>+ <DocumentMetadataPicker {...props} onSelect={vi.fn()} />+ <button type="submit">Save</button>+ </form>,+ )+ await screen.getByRole('button', { name: 'dataset.metadata.addMetadata' }).click()+ await page.getByRole('combobox').fill('missing')+ await expect.element(page.getByText('common.noData')).toBeVisible()+ await userEvent.keyboard('{Enter}')+ expect(onSubmit).not.toHaveBeenCalled()+ await expect.element(page.getByRole('combobox')).toBeVisible()+})diff --git a/web/features/new-rag/documents/metadata/create-form.tsx b/web/features/new-rag/documents/metadata/create-form.tsxindex 2143a90ac70..60fd690d259 100644--- a/web/features/new-rag/documents/metadata/create-form.tsx+++ b/web/features/new-rag/documents/metadata/create-form.tsx@@ -72,7 +72,7 @@ export function DocumentMetadataCreateForm({void create()}}>- <Button variant="ghost-accent" size="small" className="mb-1 -ml-2" onClick={close}>+ <Button variant="ghost-accent" size="small" className="-ms-2 mb-1" onClick={close}><span aria-hidden className="i-ri-arrow-left-line size-4" /><span className="system-xs-semibold-uppercase">{t(($) => $['metadata.createMetadata.back'], { ns: 'dataset' })}@@ -125,11 +125,13 @@ export function DocumentMetadataCreateForm({})}value={name}/>- {nameTouched && nameError && <FieldError match>{nameError}</FieldError>}+ <div className="min-h-5">+ {nameTouched && nameError && <FieldError match>{nameError}</FieldError>}+ </div></Field></div><div className="mt-4 flex justify-end">- <Button className="mr-2" disabled={pending} onClick={close}>+ <Button className="me-2" disabled={pending} onClick={close}>{tCommon(($) => $['operation.cancel'])}</Button><Button loading={pending} type="submit" variant="primary">diff --git a/web/features/new-rag/documents/metadata/picker.tsx b/web/features/new-rag/documents/metadata/picker.tsxindex 4331d940d1f..930e6951d45 100644--- a/web/features/new-rag/documents/metadata/picker.tsx+++ b/web/features/new-rag/documents/metadata/picker.tsx@@ -1,6 +1,6 @@'use client'-import type { ComboboxChangeEventDetails } from '@langgenius/dify-ui/combobox'+import type { PopoverActions } from '@langgenius/dify-ui/popover'import type { DocumentMetadataField, DocumentMetadataType } from './editor-model'import { Button } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'@@ -15,7 +15,7 @@ import {ComboboxSeparator,} from '@langgenius/dify-ui/combobox'import { Popover, PopoverContent, PopoverTitle, PopoverTrigger } from '@langgenius/dify-ui/popover'-import { useState } from 'react'+import { useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import { DocumentMetadataCreateForm } from './create-form'@@ -25,6 +25,19 @@ const metadataTypeIcon = {time: 'i-ri-time-line',} satisfies Record<DocumentMetadataType, string>+type DocumentMetadataPickerProps = {+ allowedExistingName?: string+ creating: boolean+ disabled?: boolean+ error: boolean+ fields: DocumentMetadataField[]+ loading: boolean+ onCreate: (name: string, type: DocumentMetadataType) => Promise<void>+ onManage: () => void+ onRetry: () => void+ onSelect: (field: DocumentMetadataField) => void+}+export function DocumentMetadataPicker({allowedExistingName,creating,@@ -36,36 +49,19 @@ export function DocumentMetadataPicker({onManage,onRetry,onSelect,-}: {- allowedExistingName?: string- creating: boolean- disabled?: boolean- error: boolean- fields: DocumentMetadataField[]- loading: boolean- onCreate: (name: string, type: DocumentMetadataType) => Promise<void>- onManage: () => void- onRetry: () => void- onSelect: (field: DocumentMetadataField) => void-}) {+}: DocumentMetadataPickerProps) {const { t } = useTranslation(['knowledgeCitation', 'dataset'])const { t: tCommon } = useTranslation(['common'])- const [open, setOpen] = useState(false)+ const popoverActionsRef = useRef<PopoverActions>(null)const [view, setView] = useState<'create' | 'select'>('select')- const [query, setQuery] = useState('')-- const reset = () => {- setView('select')- setQuery('')- }-- const handleOpenChange = (nextOpen: boolean) => {- setOpen(nextOpen)- if (!nextOpen) reset()- }return (- <Popover open={open} onOpenChange={handleOpenChange}>+ <Popover+ actionsRef={popoverActionsRef}+ onOpenChangeComplete={(open) => {+ if (!open) setView('select')+ }}+ ><PopoverTriggerrender={<Button variant="tertiary" size="small" className="w-full" disabled={disabled}>@@ -80,7 +76,7 @@ export function DocumentMetadataPicker({alignOffset={4}side="left"align="start"- className="w-[320px] bg-components-panel-bg-blur backdrop-blur-[5px]"+ className="w-80 max-w-(--available-width) bg-components-panel-bg-blur backdrop-blur-[5px]"sideOffset={-38}><PopoverTitle className="sr-only">@@ -90,31 +86,24 @@ export function DocumentMetadataPicker({</PopoverTitle>{view === 'select' ? (<Combobox<DocumentMetadataField>- filter={(field, input) => field.name.toLowerCase().includes(input.toLowerCase())}- inputValue={query}- isItemEqualToValue={(field, value) => field.name === value.name}+ inline+ openitems={fields}itemToStringLabel={(field) => field.name}- itemToStringValue={(field) => field.name}- onInputValueChange={(value, details: ComboboxChangeEventDetails) => {- if (details.reason !== 'item-press') setQuery(value)- }}onValueChange={(field) => {if (!field) returnonSelect(field)- setOpen(false)- reset()+ popoverActionsRef.current?.close()}}value={null}><div className="p-2 pb-1"><ComboboxInputGroup>- <span aria-hidden className="ml-2 i-ri-search-line size-4 text-text-tertiary" />+ <span aria-hidden className="i-ri-search-line size-4 shrink-0 text-text-tertiary" /><ComboboxInput// oxlint-disable-next-line jsx-a11y/no-autofocus -- Returning from the create view replaces the focused control in an open popover.autoFocusaria-label={t(($) => $['metadata.selectMetadata.search'], { ns: 'dataset' })}- className="pl-2"placeholder={t(($) => $['metadata.selectMetadata.search'], { ns: 'dataset' })}/></ComboboxInputGroup>@@ -138,14 +127,17 @@ export function DocumentMetadataPicker({</ComboboxList>)}{loading && (- <div className="flex h-20 items-center justify-center gap-2 system-xs-regular text-text-tertiary">+ <div+ role="status"+ className="flex h-20 items-center justify-center gap-2 system-xs-regular text-text-tertiary"+ ><span aria-hidden className="i-ri-loader-2-line size-4 animate-spin" />{tCommon(($) => $.loading)}</div>)}{error && !loading && (<div className="flex h-20 flex-col items-center justify-center gap-1 px-3 text-center">- <span className="system-xs-regular text-text-tertiary">+ <span role="status" className="system-xs-regular text-text-tertiary">{t(($) => $.documentLoadErrorDescription, { ns: 'knowledgeCitation' })}</span><Button onClick={onRetry} size="small" variant="ghost">@@ -162,7 +154,6 @@ export function DocumentMetadataPicker({disabled={loading || error}onClick={() => {setView('create')- setQuery('')}}><span aria-hidden className="i-ri-add-line size-4 text-text-tertiary" />@@ -176,8 +167,7 @@ export function DocumentMetadataPicker({variant="ghost"className="px-2"onClick={() => {- setOpen(false)- reset()+ popoverActionsRef.current?.close()onManage()}}>@@ -195,7 +185,7 @@ export function DocumentMetadataPicker({allowedExistingName={allowedExistingName}fields={fields}pending={creating}- onClose={reset}+ onClose={() => setView('select')}onCreate={async (name, type) => {await onCreate(name, type)return truediff --git a/web/i18n/locales/ar-TN/app.json b/web/i18n/locales/ar-TN/app.jsonindex daeeb77c25c..cf3a10d786b 100644--- a/web/i18n/locales/ar-TN/app.json+++ b/web/i18n/locales/ar-TN/app.json@@ -29,6 +29,7 @@"appSelector.noParams": "لا توجد معلمات مطلوبة","appSelector.params": "معلمات التطبيق","appSelector.placeholder": "اختر تطبيقًا...",+ "appSelector.searchPlaceholder": "البحث عن التطبيقات بالاسم…","chooseAppFile": "اختر حزمة تطبيق أو ملف DSL","deleteAppConfirmContent": "حذف التطبيق لا رجعة فيه. لن يتمكن المستخدمون من الوصول إلى تطبيقك بعد الآن، وسيتم حذف جميع تكوينات المطالبة والسجلات بشكل دائم.","deleteAppConfirmInputLabel": "للتأكيد، اكتب <appName>{{appName}}</appName> في المربع أدناه:",diff --git a/web/i18n/locales/az-AZ/app.json b/web/i18n/locales/az-AZ/app.jsonindex a11c0c0387a..4d059cf6bdd 100644--- a/web/i18n/locales/az-AZ/app.json+++ b/web/i18n/locales/az-AZ/app.json@@ -29,6 +29,7 @@"appSelector.noParams": "Parametr tələb olunmur","appSelector.params": "Tətbiqin parametrləri","appSelector.placeholder": "Tətbiq seçin...",+ "appSelector.searchPlaceholder": "Tətbiqləri ada görə axtarın…","chooseAppFile": "Tətbiq paketi və ya DSL faylı seçin","deleteAppConfirmContent": "Tətbiqin silinməsi geri qaytarıla bilməz. İstifadəçilər artıq tətbiqinizə daxil ola bilməyəcək, bütün təlimat konfiqurasiyaları və jurnallar həmişəlik silinəcək.","deleteAppConfirmInputLabel": "Təsdiqləmək üçün aşağıdakı xanaya <appName>{{appName}}</appName> yazın:",diff --git a/web/i18n/locales/de-DE/app.json b/web/i18n/locales/de-DE/app.jsonindex 9d97fd7a219..70ce0a528fc 100644--- a/web/i18n/locales/de-DE/app.json+++ b/web/i18n/locales/de-DE/app.json@@ -29,6 +29,7 @@"appSelector.noParams": "Keine Parameter erforderlich","appSelector.params": "APP-PARAMETER","appSelector.placeholder": "Wählen Sie eine App aus...",+ "appSelector.searchPlaceholder": "Apps nach Namen suchen…","chooseAppFile": "App-Paket oder DSL-Datei auswählen","deleteAppConfirmContent": "Das Löschen der App ist unwiderruflich. Nutzer werden keinen Zugang mehr zu Ihrer App haben, und alle Prompt-Konfigurationen und Logs werden dauerhaft gelöscht.","deleteAppConfirmInputLabel": "Geben Sie zur Bestätigung <appName>{{appName}}</appName> in das Feld unten ein:",diff --git a/web/i18n/locales/en-US/app.json b/web/i18n/locales/en-US/app.jsonindex 428e9e6d96a..49662311ebd 100644--- a/web/i18n/locales/en-US/app.json+++ b/web/i18n/locales/en-US/app.json@@ -29,6 +29,7 @@"appSelector.noParams": "No parameters needed","appSelector.params": "APP PARAMETERS","appSelector.placeholder": "Select an app...",+ "appSelector.searchPlaceholder": "Search apps by name…","chooseAppFile": "Choose an app package or DSL file","deleteAppConfirmContent": "Deleting the app is irreversible. Users will no longer be able to access your app, and all prompt configurations and logs will be permanently deleted.","deleteAppConfirmInputLabel": "To confirm, type <appName>{{appName}}</appName> in the box below:",diff --git a/web/i18n/locales/es-ES/app.json b/web/i18n/locales/es-ES/app.jsonindex 7cee1ba511f..13114688ca0 100644--- a/web/i18n/locales/es-ES/app.json+++ b/web/i18n/locales/es-ES/app.json@@ -29,6 +29,7 @@"appSelector.noParams": "No se necesitan parámetros","appSelector.params": "PARÁMETROS DE LA APLICACIÓN","appSelector.placeholder": "Selecciona una aplicación...",+ "appSelector.searchPlaceholder": "Buscar aplicaciones por nombre…","chooseAppFile": "Seleccionar un paquete de aplicación o archivo DSL","deleteAppConfirmContent": "Eliminar la app es irreversible. Los usuarios ya no podrán acceder a tu app y todas las configuraciones y registros de prompts se eliminarán permanentemente.","deleteAppConfirmInputLabel": "Para confirmar, escriba <appName>{{appName}}</appName> en el cuadro a continuación:",diff --git a/web/i18n/locales/fa-IR/app.json b/web/i18n/locales/fa-IR/app.jsonindex b6f1be9850f..fef24733a68 100644--- a/web/i18n/locales/fa-IR/app.json+++ b/web/i18n/locales/fa-IR/app.json@@ -29,6 +29,7 @@"appSelector.noParams": "بدون پارامتر مورد نیاز است","appSelector.params": "پارامترهای برنامه","appSelector.placeholder": "برنامه ای را انتخاب کنید...",+ "appSelector.searchPlaceholder": "جستجوی برنامهها بر اساس نام…","chooseAppFile": "بستهٔ برنامه یا فایل DSL را انتخاب کنید","deleteAppConfirmContent": "حذف برنامه غیرقابل برگشت است. کاربران دیگر قادر به دسترسی به برنامه شما نخواهند بود و تمام تنظیمات و گزارشات درخواستها به صورت دائم حذف خواهند شد.","deleteAppConfirmInputLabel": "برای تأیید، <appName>{{appName}}</appName> را در کادر زیر تایپ کنید:",diff --git a/web/i18n/locales/fr-FR/app.json b/web/i18n/locales/fr-FR/app.jsonindex 3a57ddece17..1340a1b3536 100644--- a/web/i18n/locales/fr-FR/app.json+++ b/web/i18n/locales/fr-FR/app.json@@ -29,6 +29,7 @@"appSelector.noParams": "Aucun paramètre nécessaire","appSelector.params": "PARAMÈTRES DE L’APPLICATION","appSelector.placeholder": "Sélectionnez une application...",+ "appSelector.searchPlaceholder": "Rechercher des applications par nom…","chooseAppFile": "Choisir un paquet d’application ou un fichier DSL","deleteAppConfirmContent": "La suppression de l'application est irréversible. Les utilisateurs ne pourront plus accéder à votre application et toutes les configurations de prompt et les journaux seront définitivement supprimés.","deleteAppConfirmInputLabel": "Pour confirmer, tapez <appName>{{appName}}</appName> dans la case ci-dessous :",diff --git a/web/i18n/locales/hi-IN/app.json b/web/i18n/locales/hi-IN/app.jsonindex 48c158b4c87..3b60274e097 100644--- a/web/i18n/locales/hi-IN/app.json+++ b/web/i18n/locales/hi-IN/app.json@@ -29,6 +29,7 @@"appSelector.noParams": "कोई पैरामीटर की आवश्यकता नहीं है।","appSelector.params": "ऐप पैरामीटर","appSelector.placeholder": "एक ऐप चुनें...",+ "appSelector.searchPlaceholder": "नाम से ऐप खोजें…","chooseAppFile": "ऐप पैकेज या DSL फ़ाइल चुनें","deleteAppConfirmContent": "ऐप को हटाना अपरिवर्तनीय है। उपयोगकर्ता अब आपके ऐप तक पहुँचने में सक्षम नहीं होंगे, और सभी प्रॉम्प्ट कॉन्फ़िगरेशन और लॉग स्थायी रूप से हटा दिए जाएंगे।","deleteAppConfirmInputLabel": "पुष्टि करने के लिए, नीचे दिए गए बॉक्स में <appName>{{appName}}</appName> टाइप करें:",diff --git a/web/i18n/locales/id-ID/app.json b/web/i18n/locales/id-ID/app.jsonindex 6c46518de95..a05bb69016a 100644--- a/web/i18n/locales/id-ID/app.json+++ b/web/i18n/locales/id-ID/app.json@@ -29,6 +29,7 @@"appSelector.noParams": "Tidak perlu parameter","appSelector.params": "PARAMETER APLIKASI","appSelector.placeholder": "Pilih aplikasi...",+ "appSelector.searchPlaceholder": "Cari aplikasi berdasarkan nama…","chooseAppFile": "Pilih paket aplikasi atau file DSL","deleteAppConfirmContent": "Menghapus aplikasi tidak dapat diubah. Pengguna tidak akan dapat lagi mengakses aplikasi Anda, dan semua konfigurasi prompt serta log akan dihapus secara permanen.","deleteAppConfirmInputLabel": "Untuk konfirmasi, ketik <appName>{{appName}}</appName> di kotak di bawah ini:",diff --git a/web/i18n/locales/it-IT/app.json b/web/i18n/locales/it-IT/app.jsonindex a33536e92f0..21c873cd2b6 100644--- a/web/i18n/locales/it-IT/app.json+++ b/web/i18n/locales/it-IT/app.json@@ -29,6 +29,7 @@"appSelector.noParams": "Non sono necessari parametri","appSelector.params": "PARAMETRI DELL'APP","appSelector.placeholder": "Seleziona un'app...",+ "appSelector.searchPlaceholder": "Cerca app per nome…","chooseAppFile": "Scegli un pacchetto app o un file DSL","deleteAppConfirmContent": "Eliminare l'app è irreversibile. Gli utenti non potranno più accedere alla tua app e tutte le configurazioni e i log dei prompt verranno eliminati permanentemente.","deleteAppConfirmInputLabel": "Per confermare, digita <appName>{{appName}}</appName> nel campo sottostante:",diff --git a/web/i18n/locales/ja-JP/app.json b/web/i18n/locales/ja-JP/app.jsonindex 5909138dda0..9c3ca4aa2ea 100644--- a/web/i18n/locales/ja-JP/app.json+++ b/web/i18n/locales/ja-JP/app.json@@ -29,6 +29,7 @@"appSelector.noParams": "パラメータは必要ありません","appSelector.params": "アプリパラメータ","appSelector.placeholder": "アプリを選択...",+ "appSelector.searchPlaceholder": "名前でアプリを検索…","chooseAppFile": "アプリパッケージまたは DSL ファイルを選択","deleteAppConfirmContent": "アプリを削除すると、元に戻すことはできません。他のユーザーはもはやこのアプリにアクセスできず、すべてのプロンプトの設定とログが永久に削除されます。","deleteAppConfirmInputLabel": "確認するには、下のボックスに<appName>{{appName}}</appName>と入力してください:",diff --git a/web/i18n/locales/ko-KR/app.json b/web/i18n/locales/ko-KR/app.jsonindex dcff6300187..37ff1982d94 100644--- a/web/i18n/locales/ko-KR/app.json+++ b/web/i18n/locales/ko-KR/app.json@@ -29,6 +29,7 @@"appSelector.noParams": "매개 변수가 필요하지 않습니다.","appSelector.params": "앱 매개 변수","appSelector.placeholder": "앱 선택...",+ "appSelector.searchPlaceholder": "이름으로 앱 검색…","chooseAppFile": "앱 패키지 또는 DSL 파일 선택","deleteAppConfirmContent": "앱을 삭제하면 복구할 수 없습니다. 사용자는 더 이상 앱에 액세스할 수 없으며 모든 프롬프트 설정 및 로그가 영구적으로 삭제됩니다.","deleteAppConfirmInputLabel": "확인하려면 아래 상자에 <appName>{{appName}}</appName>을 입력하세요:",diff --git a/web/i18n/locales/lo-LA/app.json b/web/i18n/locales/lo-LA/app.jsonindex cee6312d12f..de91addbefb 100644--- a/web/i18n/locales/lo-LA/app.json+++ b/web/i18n/locales/lo-LA/app.json@@ -29,6 +29,7 @@"appSelector.noParams": "ບໍ່ຕ້ອງມີພາຣາມີເຕີ","appSelector.params": "ພາຣາມີເຕີຂອງແອັບ","appSelector.placeholder": "ເລືອກແອັບ...",+ "appSelector.searchPlaceholder": "ຄົ້ນຫາແອັບຕາມຊື່…","chooseAppFile": "ເລືອກແພັກເກດແອັບ ຫຼື ໄຟລ໌ DSL","deleteAppConfirmContent": "ການລຶບແອັບບໍ່ສາມາດກັບຄືນມາໄດ້. ຜູ້ໃຊ້ຈະບໍ່ສາມາດເຂົ້າເຖິງແອັບຂອງທ່ານໄດ້ອີກຕໍ່ໄປ, ແລະ ການຕັ້ງຄ່າ prompt ລວມທັງບັນທຶກທັງໝົດຈະຖືກລຶບຖາວອນ.","deleteAppConfirmInputLabel": "ເພື່ອຢືນຢັນ, ໃຫ້ພິມ <appName>{{appName}}</appName> ໃນຫ້ອງລຸ່ມນີ້:",diff --git a/web/i18n/locales/nl-NL/app.json b/web/i18n/locales/nl-NL/app.jsonindex 50fb465d68f..cfe46e13b69 100644--- a/web/i18n/locales/nl-NL/app.json+++ b/web/i18n/locales/nl-NL/app.json@@ -29,6 +29,7 @@"appSelector.noParams": "No parameters needed","appSelector.params": "APP PARAMETERS","appSelector.placeholder": "Select an app...",+ "appSelector.searchPlaceholder": "Apps zoeken op naam…","chooseAppFile": "Kies een app-pakket of DSL-bestand","deleteAppConfirmContent": "Deleting the app is irreversible. Users will no longer be able to access your app, and all prompt configurations and logs will be permanently deleted.","deleteAppConfirmInputLabel": "To confirm, type <appName>{{appName}}</appName> in the box below:",diff --git a/web/i18n/locales/pl-PL/app.json b/web/i18n/locales/pl-PL/app.jsonindex 7991f30ead9..ad190de415f 100644--- a/web/i18n/locales/pl-PL/app.json+++ b/web/i18n/locales/pl-PL/app.json@@ -29,6 +29,7 @@"appSelector.noParams": "Nie są potrzebne żadne parametry","appSelector.params": "PARAMETRY APLIKACJI","appSelector.placeholder": "Wybierz aplikację...",+ "appSelector.searchPlaceholder": "Szukaj aplikacji według nazwy…","chooseAppFile": "Wybierz pakiet aplikacji lub plik DSL","deleteAppConfirmContent": "Usunięcie aplikacji jest nieodwracalne. Użytkownicy nie będą mieli już dostępu do twojej aplikacji, a wszystkie konfiguracje monitów i dzienniki zostaną trwale usunięte.","deleteAppConfirmInputLabel": "Aby potwierdzić, wpisz <appName>{{appName}}</appName> w polu poniżej:",diff --git a/web/i18n/locales/pt-BR/app.json b/web/i18n/locales/pt-BR/app.jsonindex de5c23414ad..745de1d646d 100644--- a/web/i18n/locales/pt-BR/app.json+++ b/web/i18n/locales/pt-BR/app.json@@ -29,6 +29,7 @@"appSelector.noParams": "Não são necessários parâmetros","appSelector.params": "PARÂMETROS DO APLICATIVO","appSelector.placeholder": "Selecione um aplicativo...",+ "appSelector.searchPlaceholder": "Buscar aplicativos por nome…","chooseAppFile": "Escolha um pacote de aplicativo ou arquivo DSL","deleteAppConfirmContent": "A exclusão do aplicativo é irreversível. Os usuários não poderão mais acessar seu aplicativo e todas as configurações de prompt e logs serão permanentemente excluídas.","deleteAppConfirmInputLabel": "Para confirmar, digite <appName>{{appName}}</appName> na caixa abaixo:",diff --git a/web/i18n/locales/ro-RO/app.json b/web/i18n/locales/ro-RO/app.jsonindex 60a399d696a..93af3227a47 100644--- a/web/i18n/locales/ro-RO/app.json+++ b/web/i18n/locales/ro-RO/app.json@@ -29,6 +29,7 @@"appSelector.noParams": "Nu sunt necesari parametri","appSelector.params": "PARAMETRII APLICAȚIEI","appSelector.placeholder": "Selectați o aplicație...",+ "appSelector.searchPlaceholder": "Caută aplicații după nume…","chooseAppFile": "Alege un pachet de aplicație sau un fișier DSL","deleteAppConfirmContent": "Ștergerea aplicației este ireversibilă. Utilizatorii nu vor mai putea accesa aplicația ta, iar toate configurațiile promptului și jurnalele vor fi șterse permanent.","deleteAppConfirmInputLabel": "Pentru confirmare, tastați <appName>{{appName}}</appName> în caseta de mai jos:",diff --git a/web/i18n/locales/ru-RU/app.json b/web/i18n/locales/ru-RU/app.jsonindex ae8012ca177..690ab5230e7 100644--- a/web/i18n/locales/ru-RU/app.json+++ b/web/i18n/locales/ru-RU/app.json@@ -29,6 +29,7 @@"appSelector.noParams": "Параметры не нужны","appSelector.params": "ПАРАМЕТРЫ ПРИЛОЖЕНИЯ","appSelector.placeholder": "Выберите приложение...",+ "appSelector.searchPlaceholder": "Поиск приложений по имени…","chooseAppFile": "Выберите пакет приложения или файл DSL","deleteAppConfirmContent": "Удаление приложения необратимо. Пользователи больше не смогут получить доступ к вашему приложению, и все настройки подсказок и журналы будут безвозвратно удалены.","deleteAppConfirmInputLabel": "Для подтверждения введите <appName>{{appName}}</appName> в поле ниже:",diff --git a/web/i18n/locales/sl-SI/app.json b/web/i18n/locales/sl-SI/app.jsonindex f65bec20f1f..07764df1331 100644--- a/web/i18n/locales/sl-SI/app.json+++ b/web/i18n/locales/sl-SI/app.json@@ -29,6 +29,7 @@"appSelector.noParams": "Parametri niso potrebni","appSelector.params": "PARAMETRI APLIKACIJE","appSelector.placeholder": "Izberite aplikacijo ...",+ "appSelector.searchPlaceholder": "Iskanje aplikacij po imenu…","chooseAppFile": "Izberite paket aplikacije ali datoteko DSL","deleteAppConfirmContent": "Brisanje aplikacije je nepopravljivo. Uporabniki ne bodo več imeli dostopa do vaše aplikacije, vse konfiguracije in dnevniki pa bodo trajno izbrisani.","deleteAppConfirmInputLabel": "Za potrditev vnesite <appName>{{appName}}</appName> v polje spodaj:",diff --git a/web/i18n/locales/th-TH/app.json b/web/i18n/locales/th-TH/app.jsonindex c65b9ea99ac..05c8bce96a5 100644--- a/web/i18n/locales/th-TH/app.json+++ b/web/i18n/locales/th-TH/app.json@@ -29,6 +29,7 @@"appSelector.noParams": "ไม่จําเป็นต้องใช้พารามิเตอร์","appSelector.params": "พารามิเตอร์แอพ","appSelector.placeholder": "เลือกแอป...",+ "appSelector.searchPlaceholder": "ค้นหาแอปตามชื่อ…","chooseAppFile": "เลือกแพ็กเกจแอปหรือไฟล์ DSL","deleteAppConfirmContent": "การลบโปรเจกนั้นไม่สามารถย้อนกลับได้ ผู้ใช้จะไม่สามารถเข้าถึงโปรเจกต์ของคุณอีกต่อไป และการกําหนดค่าต่างๆและบันทึกทั้งหมดจะถูกลบอย่างถาวร","deleteAppConfirmInputLabel": "หากต้องการยืนยัน พิมพ์ <appName>{{appName}}</appName> ในช่องด้านล่าง:",diff --git a/web/i18n/locales/tr-TR/app.json b/web/i18n/locales/tr-TR/app.jsonindex 46eb53a0ccc..ae0df7b4e37 100644--- a/web/i18n/locales/tr-TR/app.json+++ b/web/i18n/locales/tr-TR/app.json@@ -29,6 +29,7 @@"appSelector.noParams": "Parametre gerekmez","appSelector.params": "UYGULAMA PARAMETRELERI","appSelector.placeholder": "Bir uygulama seçin...",+ "appSelector.searchPlaceholder": "Uygulamaları ada göre ara…","chooseAppFile": "Bir uygulama paketi veya DSL dosyası seçin","deleteAppConfirmContent": "Uygulamanın silinmesi geri alınamaz. Kullanıcılar artık uygulamanıza erişemeyecek ve tüm prompt yapılandırmaları ile loglar kalıcı olarak silinecektir.","deleteAppConfirmInputLabel": "Onaylamak için aşağıdaki kutuya <appName>{{appName}}</appName> yazın:",diff --git a/web/i18n/locales/uk-UA/app.json b/web/i18n/locales/uk-UA/app.jsonindex 267fa495062..2c47a01fbb3 100644--- a/web/i18n/locales/uk-UA/app.json+++ b/web/i18n/locales/uk-UA/app.json@@ -29,6 +29,7 @@"appSelector.noParams": "Параметри не потрібні","appSelector.params": "ПАРАМЕТРИ ПРОГРАМИ","appSelector.placeholder": "Виберіть програму...",+ "appSelector.searchPlaceholder": "Пошук застосунків за назвою…","chooseAppFile": "Виберіть пакет застосунку або файл DSL","deleteAppConfirmContent": "Видалення додатка незворотнє. Користувачі більше не зможуть отримати доступ до вашого додатка, і всі налаштування запитів та журнали будуть остаточно видалені.","deleteAppConfirmInputLabel": "Для підтвердження введіть <appName>{{appName}}</appName> у поле нижче:",diff --git a/web/i18n/locales/vi-VN/app.json b/web/i18n/locales/vi-VN/app.jsonindex 286c5fee75b..b9f9deafe28 100644--- a/web/i18n/locales/vi-VN/app.json+++ b/web/i18n/locales/vi-VN/app.json@@ -29,6 +29,7 @@"appSelector.noParams": "Không cần thông số","appSelector.params": "THÔNG SỐ ỨNG DỤNG","appSelector.placeholder": "Chọn một ứng dụng...",+ "appSelector.searchPlaceholder": "Tìm ứng dụng theo tên…","chooseAppFile": "Chọn gói ứng dụng hoặc tệp DSL","deleteAppConfirmContent": "Việc xóa ứng dụng là không thể hoàn tác. Người dùng sẽ không thể truy cập vào ứng dụng của bạn nữa và tất cả cấu hình cũng như nhật ký nhắc sẽ bị xóa vĩnh viễn.","deleteAppConfirmInputLabel": "Để xác nhận, hãy nhập <appName>{{appName}}</appName> vào ô bên dưới:",diff --git a/web/i18n/locales/zh-Hans/app.json b/web/i18n/locales/zh-Hans/app.jsonindex 150eade1ebf..227dd73300f 100644--- a/web/i18n/locales/zh-Hans/app.json+++ b/web/i18n/locales/zh-Hans/app.json@@ -29,6 +29,7 @@"appSelector.noParams": "无需参数","appSelector.params": "应用参数","appSelector.placeholder": "选择一个应用",+ "appSelector.searchPlaceholder": "按名称搜索应用…","chooseAppFile": "选择应用包或 DSL 文件","deleteAppConfirmContent": "删除应用将无法撤销。用户将不能访问你的应用,所有 Prompt 编排配置和日志均将一并被删除。","deleteAppConfirmInputLabel": "请在下方输入框中输入<appName>{{appName}}</appName>以确认:",diff --git a/web/i18n/locales/zh-Hant/app.json b/web/i18n/locales/zh-Hant/app.jsonindex e3fd2912bec..13556f07b66 100644--- a/web/i18n/locales/zh-Hant/app.json+++ b/web/i18n/locales/zh-Hant/app.json@@ -29,6 +29,7 @@"appSelector.noParams": "無需參數","appSelector.params": "應用程式參數","appSelector.placeholder": "選擇應用程式...",+ "appSelector.searchPlaceholder": "依名稱搜尋應用程式…","chooseAppFile": "選擇應用程式套件或 DSL 檔案","deleteAppConfirmContent": "刪除應用將無法復原。使用者將無法存取你的應用,所有 Prompt 設定和日誌都將一併被刪除。","deleteAppConfirmInputLabel": "請在下方輸入框中輸入<appName>{{appName}}</appName>以確認:",diff --git a/web/i18n/resources.generated.d.ts b/web/i18n/resources.generated.d.tsindex 98520808a6e..fb61075bf09 100644--- a/web/i18n/resources.generated.d.ts+++ b/web/i18n/resources.generated.d.ts@@ -574,6 +574,7 @@ export default interface Resources {'appSelector.noParams': 'No parameters needed''appSelector.params': 'APP PARAMETERS''appSelector.placeholder': 'Select an app...'+ 'appSelector.searchPlaceholder': 'Search apps by name…'chooseAppFile: 'Choose an app package or DSL file'deleteAppConfirmContent: 'Deleting the app is irreversible. Users will no longer be able to access your app, and all prompt configurations and logs will be permanently deleted.'deleteAppConfirmInputLabel: 'To confirm, type <appName>{{appName}}</appName> in the box below:'