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): unify Agent, App, and Knowledge deletion confirmations (#44618)
yyh530d8300cfdf
diff --git a/web/app/components/app-sidebar/app-info/__tests__/app-info-modals.spec.tsx b/web/app/components/app-sidebar/app-info/__tests__/app-info-modals.spec.tsxindex 415009bb28d..bd7fb46c889 100644--- a/web/app/components/app-sidebar/app-info/__tests__/app-info-modals.spec.tsx+++ b/web/app/components/app-sidebar/app-info/__tests__/app-info-modals.spec.tsx@@ -7,7 +7,6 @@ import { createConsoleQueryClient, renderWithConsoleQuery } from '@/test/consoleimport { mockEmojiData } from '@/test/emoji-picker'import { createAppDetailFixture } from '@/test/fixtures/app'import AppInfoModals from '../app-info-modals'-import { DeleteAppDialog } from '../delete-app-dialog'import { ExportAppDialog } from '../export-app-dialog'const service = vi.hoisted(() => ({@@ -60,7 +59,15 @@ function MetadataEntry({ operation = 'edit' }: { operation?: 'edit' | 'duplicate}function DeleteEntry() {const [open, setOpen] = useState(true)- return <DeleteAppDialog appDetail={app} open={open} onOpenChange={setOpen} />+ return (+ <AppInfoModals+ appDetail={app}+ activeModal={open ? 'delete' : null}+ onOpenChange={setOpen}+ exportOpen={false}+ onExportOpenChange={() => {}}+ />+ )}function ExportEntry() {const [open, setOpen] = useState(true)diff --git a/web/app/components/app-sidebar/app-info/app-info-modals.tsx b/web/app/components/app-sidebar/app-info/app-info-modals.tsxindex 8a1deeea927..266179d46a7 100644--- a/web/app/components/app-sidebar/app-info/app-info-modals.tsx+++ b/web/app/components/app-sidebar/app-info/app-info-modals.tsx@@ -1,19 +1,25 @@import type { AppDetailWithSite } from '@dify/contracts/api/console/apps/types.gen'-import type { AlertDialogProps } from '@langgenius/dify-ui/alert-dialog'+import type { AlertDialogActions, AlertDialogProps } from '@langgenius/dify-ui/alert-dialog'import type { DialogActions, DialogProps } from '@langgenius/dify-ui/dialog'+import { AlertDialog, AlertDialogContent } from '@langgenius/dify-ui/alert-dialog'import { Dialog, DialogContent } from '@langgenius/dify-ui/dialog'import { useMutation, useSuspenseQuery } from '@tanstack/react-query'import { useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import { AppMetadataForm } from '@/app/components/app/app-metadata'+import { DeleteAppForm } from '@/app/components/app/delete-app-form'import SwitchAppModal from '@/app/components/app/switch-app-modal'import UpdateDSLModal from '@/app/components/workflow/update-dsl-modal'import { toast } from '@/app/notifications'import { systemFeaturesQueryOptions } from '@/features/system-features/client'import { useRouter } from '@/next/navigation'+import {+ markAppDeletionFailed,+ markAppDeletionStarted,+ markAppDeletionSucceeded,+} from '@/service/app-deletion'import { consoleQuery } from '@/service/console'import { getRedirection } from '@/utils/app-redirection'-import { DeleteAppDialog } from './delete-app-dialog'import { ExportAppDialog } from './export-app-dialog'export type AppInfoOperation = 'edit' | 'duplicate' | 'delete' | 'switch' | 'importDSL'@@ -33,6 +39,7 @@ export default function AppInfoModals({exportOpen,onExportOpenChange,}: AppInfoModalsProps) {+ const deleteActionsRef = useRef<AlertDialogActions>(null)const editActionsRef = useRef<DialogActions>(null)const duplicateActionsRef = useRef<DialogActions>(null)const editNameRef = useRef<HTMLInputElement>(null)@@ -49,6 +56,13 @@ export default function AppInfoModals({const copy = useMutation(consoleQuery.apps.byAppId.copy.post.mutationOptions({ context: { silent: true } }),)+ const deletion = useMutation(+ consoleQuery.apps.byAppId.delete.mutationOptions({+ context: { silent: true },+ onMutate: () => markAppDeletionStarted(appDetail.id),+ onError: () => markAppDeletionFailed(appDetail.id),+ }),+ )return (<><Dialog@@ -138,11 +152,44 @@ export default function AppInfoModals({open={activeModal === 'switch'}onOpenChange={onOpenChange}/>- <DeleteAppDialog- appDetail={appDetail}+ <AlertDialog+ actionsRef={deleteActionsRef}open={activeModal === 'delete'}- onOpenChange={onOpenChange}- />+ onOpenChange={(open, details) => {+ if (!open && deletion.isPending && details.reason !== 'imperative-action')+ details.cancel()+ else onOpenChange?.(open, details)+ }}+ onOpenChangeComplete={(open) => {+ if (!open) deletion.reset()+ }}+ >+ <AlertDialogContent>+ <DeleteAppForm+ appName={appDetail.name}+ isPending={deletion.isPending}+ error={+ deletion.isError+ ? `${t(($) => $.appDeleteFailed)}: ${deletion.error.message}`+ : undefined+ }+ onSubmit={() => {+ if (deletion.isPending) return+ deletion.mutate(+ { params: { app_id: appDetail.id } },+ {+ onSuccess: () => {+ markAppDeletionSucceeded(appDetail.id)+ deleteActionsRef.current?.close()+ toast.success(t(($) => $.appDeleted))+ replace('/apps')+ },+ },+ )+ }}+ />+ </AlertDialogContent>+ </AlertDialog><ImportAppDialogappDetail={appDetail}open={activeModal === 'importDSL'}diff --git a/web/app/components/app-sidebar/app-info/delete-app-dialog.tsx b/web/app/components/app/delete-app-form.tsxsimilarity index 53%rename from web/app/components/app-sidebar/app-info/delete-app-dialog.tsxrename to web/app/components/app/delete-app-form.tsxindex 4b7268346ea..f8c68c2e77d 100644--- a/web/app/components/app-sidebar/app-info/delete-app-dialog.tsx+++ b/web/app/components/app/delete-app-form.tsx@@ -1,11 +1,9 @@-import type { AppDetailWithSite } from '@dify/contracts/api/console/apps/types.gen'-import type { AlertDialogActions, AlertDialogProps } from '@langgenius/dify-ui/alert-dialog'+'use client'+import {- AlertDialog,AlertDialogBody,AlertDialogCancelButton,AlertDialogConfirmButton,- AlertDialogContent,AlertDialogDescription,AlertDialogFooter,AlertDialogHeader,@@ -14,84 +12,18 @@ import {import { Button } from '@langgenius/dify-ui/button'import { Field, FieldLabel } from '@langgenius/dify-ui/field'import { InputGroup, InputGroupAddon, InputGroupInput } from '@langgenius/dify-ui/input-group'-import { useMutation } from '@tanstack/react-query'-import { useRef, useState } from 'react'+import { useState } from 'react'import { Trans, useTranslation } from 'react-i18next'-import { toast } from '@/app/notifications'-import { useRouter } from '@/next/navigation'-import {- markAppDeletionFailed,- markAppDeletionStarted,- markAppDeletionSucceeded,-} from '@/service/app-deletion'-import { consoleQuery } from '@/service/console'--export function DeleteAppDialog({- appDetail,- open,- onOpenChange,-}: Pick<AlertDialogProps, 'open' | 'onOpenChange'> & {- appDetail: AppDetailWithSite-}) {- const actionsRef = useRef<AlertDialogActions>(null)- const { t } = useTranslation(['app'])- const confirmationRef = useRef<HTMLInputElement>(null)- const { replace } = useRouter()- const deletion = useMutation(- consoleQuery.apps.byAppId.delete.mutationOptions({- onMutate: () => markAppDeletionStarted(appDetail.id),- onError: (error) => {- markAppDeletionFailed(appDetail.id)- toast.error(- `${t(($) => $.appDeleteFailed, { ns: 'app' })}${error instanceof Error ? `: ${error.message}` : ''}`,- )- },- }),- )- return (- <AlertDialog- actionsRef={actionsRef}- open={open}- onOpenChange={(nextOpen, details) => {- if (!nextOpen && deletion.isPending && details.reason !== 'imperative-action')- details.cancel()- else onOpenChange?.(nextOpen, details)- }}- >- <AlertDialogContent initialFocus={confirmationRef}>- <DeleteAppForm- confirmationRef={confirmationRef}- appName={appDetail.name}- isPending={deletion.isPending}- onSubmit={() => {- if (!deletion.isPending)- deletion.mutate(- { params: { app_id: appDetail.id } },- {- onSuccess: () => {- markAppDeletionSucceeded(appDetail.id)- actionsRef.current?.close()- toast.success(t(($) => $.appDeleted, { ns: 'app' }))- replace('/apps')- },- },- )- }}- />- </AlertDialogContent>- </AlertDialog>- )-}-function DeleteAppForm({- confirmationRef,+export function DeleteAppForm({appName,isPending,+ error,onSubmit,}: {- confirmationRef: React.RefObject<HTMLInputElement | null>appName: stringisPending: boolean+ error?: stringonSubmit: () => void}) {const { t } = useTranslation(['app', 'common'])@@ -125,7 +57,6 @@ function DeleteAppForm({</FieldLabel><InputGroup><InputGroupInput- ref={confirmationRef}autoComplete="off"spellCheck={false}value={confirmation}@@ -146,6 +77,11 @@ function DeleteAppForm({</InputGroupAddon></InputGroup></Field>+ {error && (+ <p role="alert" className="mt-2 system-xs-regular text-text-destructive">+ {error}+ </p>+ )}</AlertDialogBody><AlertDialogFooter><AlertDialogCancelButton type="button" disabled={isPending}>diff --git a/web/app/components/apps/__tests__/app-card.spec.tsx b/web/app/components/apps/__tests__/app-card.spec.tsxindex e39d2b9cf04..6144ee18f28 100644--- a/web/app/components/apps/__tests__/app-card.spec.tsx+++ b/web/app/components/apps/__tests__/app-card.spec.tsx@@ -437,7 +437,7 @@ describe('AppCard', () => {await waitFor(() => {expect(api.delete).toHaveBeenCalledWith({ params: { app_id: mockApp.id } })- expect(toast.error).toHaveBeenCalledWith(expect.stringContaining('Delete failed'))+ expect(screen.getByRole('alert')).toHaveTextContent('Delete failed')})expect(screen.getByRole('textbox')).toHaveValue(mockApp.name)await user.click(screen.getByRole('button', { name: 'common.operation.confirm' }))@@ -445,6 +445,25 @@ describe('AppCard', () => {expect(api.delete).toHaveBeenCalledTimes(2)})+ it('locks the name and autofill while deletion is pending and preserves the confirmation session name', async () => {+ const user = userEvent.setup()+ const pending = createDeferred<void>()+ api.delete.mockReturnValueOnce(pending.promise)+ const view = render(<AppCard app={mockApp} />)+ await chooseAction(user, 'common.operation.delete')+ await user.click(screen.getByRole('button', { name: 'common.operation.fill' }))+ view.rerender(<AppCard app={{ ...mockApp, name: 'Renamed elsewhere' }} />)+ expect(screen.getByRole('textbox')).toHaveValue(mockApp.name)+ await user.click(screen.getByRole('button', { name: 'common.operation.confirm' }))+ await waitFor(() => expect(api.delete).toHaveBeenCalledOnce())+ expect(screen.getByRole('textbox')).toHaveAttribute('readonly')+ expect(screen.getByRole('button', { name: 'common.operation.fill' })).toBeDisabled()+ await user.keyboard('{Escape}')+ expect(screen.getByRole('alertdialog')).toBeInTheDocument()+ await act(async () => pending.resolve())+ await waitFor(() => expect(screen.queryByRole('alertdialog')).not.toBeInTheDocument())+ })+it('should hide open in explore for SSO-restricted apps', async () => {mockWebappAuthEnabled = truemockWebappAuthEnabled = truediff --git a/web/app/components/apps/app-card/interactions.tsx b/web/app/components/apps/app-card/interactions.tsxindex 9c8d67971ef..5c841c08777 100644--- a/web/app/components/apps/app-card/interactions.tsx+++ b/web/app/components/apps/app-card/interactions.tsx@@ -5,20 +5,10 @@ import type {EnvironmentVariableItemResponse,} from '@dify/contracts/api/console/apps/types.gen'import type { DialogActions } from '@langgenius/dify-ui/dialog'-import type { MouseEvent, ReactElement, SubmitEventHandler } from 'react'+import type { MouseEvent, ReactElement } from 'react'import type { DuplicateAppModalProps } from '@/app/components/app/duplicate-modal'import { zIconType } from '@dify/contracts/api/console/apps/zod.gen'-import {- AlertDialog,- AlertDialogCancelButton,- AlertDialogConfirmButton,- AlertDialogContent,- AlertDialogDescription,- AlertDialogFooter,- AlertDialogHeader,- AlertDialogTitle,-} from '@langgenius/dify-ui/alert-dialog'-import { Button } from '@langgenius/dify-ui/button'+import { AlertDialog, AlertDialogContent } from '@langgenius/dify-ui/alert-dialog'import { cn } from '@langgenius/dify-ui/cn'import {ContextMenu,@@ -35,17 +25,16 @@ import {DropdownMenuSeparator,DropdownMenuTrigger,} from '@langgenius/dify-ui/dropdown-menu'-import { Field, FieldLabel } from '@langgenius/dify-ui/field'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { InputGroup, InputGroupAddon, InputGroupInput } from '@langgenius/dify-ui/input-group'import { Toggle } from '@langgenius/dify-ui/toggle'import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'import { useMutation, useSuspenseQuery } from '@tanstack/react-query'import { useAtomValue } from 'jotai'import dynamic from 'next/dynamic'import { useCallback, useMemo, useRef, useState } from 'react'-import { Trans, useTranslation } from 'react-i18next'+import { useTranslation } from 'react-i18next'import { AppMetadataForm } from '@/app/components/app/app-metadata'+import { DeleteAppForm } from '@/app/components/app/delete-app-form'import { useExportAppDsl, useExportWorkflowAppDsl } from '@/app/components/app/use-export-app-dsl'import { buildInstalledAppPath } from '@/app/components/explore/installed-app/routes'import {@@ -273,8 +262,8 @@ export function AppCardInteractions({const isRbacEnabled = systemFeatures.rbac_enabledconst { push } = useRouter()const { mutate: copyApp } = useMutation(consoleQuery.apps.byAppId.copy.post.mutationOptions())- const { mutate: deleteApp, isPending: isDeleting } = useMutation(- consoleQuery.apps.byAppId.delete.mutationOptions(),+ const deletion = useMutation(+ consoleQuery.apps.byAppId.delete.mutationOptions({ context: { silent: true } }),)const { mutate: starApp, isPending: isStarring } = useMutation(consoleQuery.apps.byAppId.star.post.mutationOptions(),@@ -291,7 +280,6 @@ export function AppCardInteractions({const [activeDialog, setActiveDialog] = useState<'delete' | 'duplicate' | 'edit' | 'switch' | null>(null)- const [confirmDeleteInput, setConfirmDeleteInput] = useState('')const operationsMenu = useStepByStepTourControlledDropdown({allowTriggerCloseWhileControlled: false,controlledOpen: stepByStepTourActionMenuOpen,@@ -325,52 +313,6 @@ export function AppCardInteractions({)const canCreateApp = hasPermission(workspacePermissionKeys, 'app.create_and_management')- const onConfirmDelete = useCallback(() => {- try {- deleteApp(- { params: { app_id: app.id } },- {- onSuccess: () => {- setActiveDialog(null)- setConfirmDeleteInput('')- },- onError: (error) => {- const message = error instanceof Error ? error.message : ''- toast.error(- `${t(($) => $.appDeleteFailed, { ns: 'app' })}${message ? `: ${message}` : ''}`,- )- },- },- )- } catch (error) {- const message = error instanceof Error ? error.message : ''- toast.error(`${t(($) => $.appDeleteFailed, { ns: 'app' })}${message ? `: ${message}` : ''}`)- }- }, [app.id, deleteApp, t])-- const onDeleteDialogOpenChange = useCallback(- (open: boolean) => {- if (isDeleting) return-- setActiveDialog(open ? 'delete' : null)- if (!open) setConfirmDeleteInput('')- },- [isDeleting],- )-- const deleteNameMismatch = confirmDeleteInput !== app.name- const isDeleteConfirmDisabled = isDeleting || deleteNameMismatch-- const onDeleteDialogSubmit: SubmitEventHandler<HTMLFormElement> = useCallback(- (e) => {- e.preventDefault()- if (isDeleteConfirmDisabled) return-- void onConfirmDelete()- },- [isDeleteConfirmDisabled, onConfirmDelete],- )-const handleShowEditModal = useCallback(() => {setIsOperationsMenuOpen(false)queueMicrotask(() => {@@ -665,63 +607,35 @@ export function AppCardInteractions({}}/>)}- <AlertDialog open={activeDialog === 'delete'} onOpenChange={onDeleteDialogOpenChange}>+ <AlertDialog+ open={activeDialog === 'delete'}+ onOpenChange={(open, details) => {+ if (!open && deletion.isPending) details.cancel()+ else if (!open) setActiveDialog(null)+ }}+ onOpenChangeComplete={(open) => {+ if (!open) deletion.reset()+ }}+ ><AlertDialogContent>- <form onSubmit={onDeleteDialogSubmit}>- <AlertDialogHeader>- <AlertDialogTitle>- {t(($) => $.deleteAppConfirmTitle, { ns: 'app' })}- </AlertDialogTitle>- <AlertDialogDescription>- {t(($) => $.deleteAppConfirmContent, { ns: 'app' })}- </AlertDialogDescription>- <Field name="confirm-app-name">- <FieldLabel>- <Trans- i18nKey={($) => $.deleteAppConfirmInputLabel}- ns="app"- values={{ appName: app.name }}- components={{- appName: (- <span className="system-sm-semibold text-text-primary" translate="no" />- ),- }}- />- </FieldLabel>- <InputGroup>- <InputGroupInput- type="text"- autoComplete="off"- spellCheck={false}- placeholder={t(($) => $.deleteAppConfirmInputPlaceholder, { ns: 'app' })}- value={confirmDeleteInput}- onValueChange={setConfirmDeleteInput}- />- <InputGroupAddon align="inline-end">- <Button- variant="tertiary"- size="small"- onClick={() => setConfirmDeleteInput(app.name)}- >- {t(($) => $['operation.fill'], { ns: 'common' })}- </Button>- </InputGroupAddon>- </InputGroup>- </Field>- </AlertDialogHeader>- <AlertDialogFooter>- <AlertDialogCancelButton type="button" disabled={isDeleting}>- {t(($) => $['operation.cancel'], { ns: 'common' })}- </AlertDialogCancelButton>- <AlertDialogConfirmButton- type="submit"- loading={isDeleting}- disabled={deleteNameMismatch}- >- {t(($) => $['operation.confirm'], { ns: 'common' })}- </AlertDialogConfirmButton>- </AlertDialogFooter>- </form>+ <DeleteAppForm+ appName={app.name}+ isPending={deletion.isPending}+ error={+ deletion.isError+ ? `${t(($) => $.appDeleteFailed, { ns: 'app' })}: ${deletion.error.message}`+ : undefined+ }+ onSubmit={() => {+ if (deletion.isPending) return+ deletion.mutate(+ { params: { app_id: app.id } },+ {+ onSuccess: () => setActiveDialog(null),+ },+ )+ }}+ /></AlertDialogContent></AlertDialog>{secretEnvList.length > 0 && (diff --git a/web/features/agent-v2/__tests__/delete-agent.browser.spec.tsx b/web/features/agent-v2/__tests__/delete-agent.browser.spec.tsxnew file mode 100644index 00000000000..fb2a48f4edf--- /dev/null+++ b/web/features/agent-v2/__tests__/delete-agent.browser.spec.tsx@@ -0,0 +1,118 @@+import { QueryClient, QueryClientProvider, useQuery } from '@tanstack/react-query'+import { createInstance } from 'i18next'+import { I18nextProvider } from 'react-i18next'+import { userEvent } from 'vite-plus/test/browser'+import { render } from 'vitest-browser-react'+import { AgentPermission } from '@/features/agent-v2/acl'+import agentRoster from '@/i18n/locales/en-US/agent-roster.json'+import common from '@/i18n/locales/en-US/common.json'+import { consoleQuery } from '@/service/console'+import { createDeferred } from '@/test/deferred'+import { createAgentFixture } from '@/test/fixtures/agent'+import { AgentRosterList } from '../roster/components/agent-roster-list'++const deleteAgent = vi.hoisted(() => vi.fn())+vi.mock('react-i18next', async (importOriginal) => importOriginal())+vi.mock('@/features/agent-v2/permissions', () => ({ useCanCreateAgents: () => false }))+vi.mock('@/hooks/use-timestamp', () => ({ default: () => ({ formatTime: () => '' }) }))+vi.mock('@/app/components/app/use-export-app-dsl', () => ({+ useExportAppDsl: () => ({ exportAppDsl: vi.fn(), isExporting: false }),+}))+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, {+ 'agent.byAgentId.delete': deleteAgent,+ }),+ }+})++const agent = {+ ...createAgentFixture({+ id: 'agent-1',+ name: 'Research Agent',+ permission_keys: [AgentPermission.Delete, AgentPermission.Edit],+ }),+ active_config_is_published: false,+ is_starred: false,+ published_reference_count: 0,+}+const listOptions = consoleQuery.agent.get.queryOptions({+ input: { query: { page: 1, limit: 30 } },+ enabled: false,+})++function Roster() {+ const { data } = useQuery(listOptions)+ return (+ <AgentRosterList+ label="Agents"+ state={{+ status: 'ready',+ agents: data?.data ?? [],+ emptyState: 'roster',+ footer: { status: 'none' },+ isFetching: false,+ }}+ />+ )+}++it('keeps the card action keyboard-accessible after cancel and preserves input focus while deleting', async () => {+ const i18n = createInstance()+ await i18n.init({+ lng: 'en-US',+ resources: { 'en-US': { agentRoster, common } },+ keySeparator: false,+ interpolation: { escapeValue: false },+ })+ const queryClient = new QueryClient({ defaultOptions: { queries: { retry: false } } })+ queryClient.setQueryData(listOptions.queryKey, {+ data: [agent],+ publication_counts: { drafts: 1, published: 0 },+ total: 1,+ has_more: false,+ page: 1,+ limit: 30,+ })+ const pending = createDeferred<void>()+ deleteAgent.mockReturnValueOnce(pending.promise)+ try {+ const screen = await render(+ <I18nextProvider i18n={i18n}>+ <QueryClientProvider client={queryClient}>+ <Roster />+ </QueryClientProvider>+ </I18nextProvider>,+ )+ const trigger = screen.getByRole('button', { name: 'More actions for Research Agent' })+ const link = screen.getByRole('link', { name: 'Research Agent' })+ await link.hover()+ await trigger.click()+ await screen.getByRole('menuitem', { name: 'Delete' }).click()+ await expect+ .element(screen.getByRole('textbox', { name: 'Type Research Agent to confirm' }))+ .toHaveFocus()+ await screen.getByRole('button', { name: 'Cancel' }).click()+ await expect.element(screen.getByRole('alertdialog')).not.toBeInTheDocument()+ await expect.element(trigger).toHaveFocus()+ await expect.element(trigger).toBeVisible()+ await userEvent.keyboard('{Enter}')+ await expect.element(screen.getByRole('menuitem', { name: 'Delete' })).toBeVisible()+ await screen.getByRole('menuitem', { name: 'Delete' }).click()+ const input = screen.getByRole('textbox', { name: 'Type Research Agent to confirm' })+ await expect.element(input).toHaveFocus()+ await screen.getByRole('button', { name: 'Autofill' }).click()+ await input.click()+ await userEvent.keyboard('{Enter}')+ await expect.poll(() => deleteAgent.mock.calls.length).toBe(1)+ await expect.element(input).toHaveFocus()+ pending.resolve()+ await expect.element(screen.getByRole('alertdialog')).not.toBeInTheDocument()+ await expect.element(link).not.toBeInTheDocument()+ } finally {+ queryClient.clear()+ }+})diff --git a/web/features/agent-v2/__tests__/delete-agent.spec.tsx b/web/features/agent-v2/__tests__/delete-agent.spec.tsxnew file mode 100644index 00000000000..6778fc0d6e4--- /dev/null+++ b/web/features/agent-v2/__tests__/delete-agent.spec.tsx@@ -0,0 +1,139 @@+import { act, screen, waitFor } from '@testing-library/react'+import userEvent from '@testing-library/user-event'+import { AgentPermission } from '@/features/agent-v2/acl'+import { renderWithConsoleQuery as render } from '@/test/console/query-data'+import { createDeferred } from '@/test/deferred'+import { createAgentFixture } from '@/test/fixtures/agent'+import { AgentRosterList } from '../roster/components/agent-roster-list'++const service = vi.hoisted(() => ({ deleteAgent: vi.fn() }))++vi.mock('react-i18next', async () => {+ const { createReactI18nextMock } = await import('@/test/i18n-mock')+ const { default: agentRoster } = await import('@/i18n/locales/en-US/agent-roster.json')+ const { default: common } = await import('@/i18n/locales/en-US/common.json')+ return createReactI18nextMock({ ...agentRoster, ...common })+})+vi.mock('@/features/agent-v2/permissions', () => ({ useCanCreateAgents: () => false }))+vi.mock('@/hooks/use-timestamp', () => ({ default: () => ({ formatTime: () => '' }) }))+vi.mock('@/app/components/app/use-export-app-dsl', () => ({+ useExportAppDsl: () => ({ exportAppDsl: vi.fn(), isExporting: false }),+}))+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, {+ 'agent.byAgentId.delete': service.deleteAgent,+ }),+ }+})++const agent = createAgentFixture({+ id: 'agent-1',+ name: 'Research Agent',+ permission_keys: [AgentPermission.Delete],+})++async function openDeletion(user: ReturnType<typeof userEvent.setup>) {+ await user.click(screen.getByRole('button', { name: 'More actions for Research Agent' }))+ await user.click(await screen.findByRole('menuitem', { name: 'Delete' }))+ return screen.findByRole('alertdialog')+}++describe('roster agent deletion', () => {+ beforeEach(() => {+ service.deleteAgent.mockReset().mockResolvedValue(undefined)+ render(+ <AgentRosterList+ label="Agents"+ state={{+ status: 'ready',+ agents: [agent],+ emptyState: 'roster',+ footer: { status: 'none' },+ isFetching: false,+ }}+ />,+ )+ })++ it('requires the exact name, offers autofill without submitting, and submits with Enter', async () => {+ const user = userEvent.setup()+ await openDeletion(user)+ expect(screen.getByText(/Its web app, API access, and workflows/)).toBeInTheDocument()+ const input = screen.getByRole('textbox', { name: /Type .* to confirm/ })+ expect(input).toHaveAttribute('placeholder', 'Enter agent name')+ const confirm = screen.getByRole('button', { name: 'Confirm' })+ expect(confirm).toBeDisabled()+ await user.type(input, 'research Agent{Enter}')+ expect(service.deleteAgent).not.toHaveBeenCalled()+ await user.clear(input)+ await user.type(input, 'Research Agent {Enter}')+ expect(confirm).toBeDisabled()+ expect(service.deleteAgent).not.toHaveBeenCalled()+ await user.click(screen.getByRole('button', { name: 'Autofill' }))+ expect(input).toHaveValue(agent.name)+ expect(confirm).toBeEnabled()+ expect(service.deleteAgent).not.toHaveBeenCalled()+ await user.click(input)+ await user.keyboard('{Enter}')+ await waitFor(() =>+ expect(service.deleteAgent).toHaveBeenCalledExactlyOnceWith({+ params: { agent_id: agent.id },+ }),+ )+ await waitFor(() => expect(screen.queryByRole('alertdialog')).not.toBeInTheDocument())+ })++ it('blocks Escape, cancel, edits and duplicate submission until the deletion settles', async () => {+ const user = userEvent.setup()+ const pending = createDeferred<void>()+ service.deleteAgent.mockReturnValueOnce(pending.promise)+ await openDeletion(user)+ await user.click(screen.getByRole('button', { name: 'Autofill' }))+ const confirm = screen.getByRole('button', { name: 'Confirm' })+ await user.click(confirm)+ await waitFor(() => expect(confirm).toHaveAttribute('aria-disabled', 'true'))+ expect(screen.getByRole('textbox')).toHaveAttribute('readonly')+ expect(screen.getByRole('button', { name: 'Autofill' })).toBeDisabled()+ const cancel = screen.getByRole('button', { name: 'Cancel' })+ expect(cancel).toBeDisabled()+ await user.click(cancel)+ await user.keyboard('{Escape}')+ await user.click(confirm)+ expect(screen.getByRole('alertdialog')).toBeInTheDocument()+ expect(service.deleteAgent).toHaveBeenCalledOnce()+ await act(async () => pending.resolve())+ await waitFor(() => expect(screen.queryByRole('alertdialog')).not.toBeInTheDocument())+ })++ it('keeps the confirmed name after failure and allows retry', async () => {+ const user = userEvent.setup()+ service.deleteAgent.mockRejectedValueOnce(new Error('Deletion failed'))+ await openDeletion(user)+ await user.click(screen.getByRole('button', { name: 'Autofill' }))+ await user.click(screen.getByRole('button', { name: 'Confirm' }))+ expect(await screen.findByRole('alert')).toHaveTextContent('Failed to delete agent')+ expect(screen.getByRole('textbox')).toHaveValue(agent.name)+ await user.click(screen.getByRole('button', { name: 'Confirm' }))+ await waitFor(() => expect(screen.queryByRole('alertdialog')).not.toBeInTheDocument())+ expect(service.deleteAgent).toHaveBeenCalledTimes(2)+ })++ it('starts a fresh confirmation session after cancelling a failed deletion', async () => {+ const user = userEvent.setup()+ service.deleteAgent.mockRejectedValueOnce(new Error('Deletion failed'))+ await openDeletion(user)+ await user.click(screen.getByRole('button', { name: 'Autofill' }))+ await user.click(screen.getByRole('button', { name: 'Confirm' }))+ await screen.findByRole('alert')+ await user.click(screen.getByRole('button', { name: 'Cancel' }))+ await waitFor(() => expect(screen.queryByRole('alertdialog')).not.toBeInTheDocument())+ await openDeletion(user)+ expect(screen.getByRole('textbox')).toHaveValue('')+ expect(screen.getByRole('button', { name: 'Confirm' })).toBeDisabled()+ expect(screen.queryByRole('alert')).not.toBeInTheDocument()+ })+})diff --git a/web/features/agent-v2/agent-detail/__tests__/navigation.spec.tsx b/web/features/agent-v2/agent-detail/__tests__/navigation.spec.tsxindex f2bfbb6e5f3..4177344da20 100644--- a/web/features/agent-v2/agent-detail/__tests__/navigation.spec.tsx+++ b/web/features/agent-v2/agent-detail/__tests__/navigation.spec.tsx@@ -1,9 +1,10 @@import type { AgentAppDetailWithSite } from '@dify/contracts/api/console/agent/types.gen'-import { render, screen, waitFor, within } from '@testing-library/react'+import { act, render, screen, waitFor, within } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { AgentPermission } from '@/features/agent-v2/acl'import { consoleQuery } from '@/service/console'import { createConsoleQueryWrapper } from '@/test/console/query-data'+import { createDeferred } from '@/test/deferred'import { createAgentFixture } from '@/test/fixtures/agent'import { AgentDetailSection, AgentDetailTop } from '../navigation'@@ -162,8 +163,10 @@ describe('AgentDetailSection', () => {})})- it('returns to the roster after deleting the current agent', async () => {+ it('keeps confirmation open while deleting and returns to the roster only after success', async () => {const user = userEvent.setup()+ const pending = createDeferred<void>()+ mocks.deleteAgent.mockReturnValueOnce(pending.promise)renderAgentDetailSection()await user.click(screen.getByRole('button', { name: /agentRoster\.roster\.moreActions/ }))@@ -172,8 +175,14 @@ describe('AgentDetailSection', () => {const dialog = await screen.findByRole('alertdialog', {name: /agentRoster\.roster\.deleteDialog\.title/,})- await user.click(within(dialog).getByRole('button', { name: 'common.operation.delete' }))+ await user.click(within(dialog).getByRole('button', { name: 'common.operation.fill' }))+ await user.click(within(dialog).getByRole('button', { name: 'common.operation.confirm' }))+ await waitFor(() => expect(mocks.deleteAgent).toHaveBeenCalledOnce())+ await user.keyboard('{Escape}')+ expect(dialog).toBeInTheDocument()+ expect(mocks.replace).not.toHaveBeenCalled()+ await act(async () => pending.resolve())await waitFor(() => {expect(mocks.replace).toHaveBeenCalledWith('/agents')})@@ -195,11 +204,12 @@ describe('AgentDetailSection', () => {const dialog = await screen.findByRole('alertdialog', {name: /agentRoster\.roster\.deleteDialog\.title/,})- await user.click(within(dialog).getByRole('button', { name: 'common.operation.delete' }))+ await user.click(within(dialog).getByRole('button', { name: 'common.operation.fill' }))+ await user.click(within(dialog).getByRole('button', { name: 'common.operation.confirm' }))- await waitFor(() => {- expect(mocks.deleteAgent).toHaveBeenCalled()- })+ expect(await within(dialog).findByRole('alert')).toHaveTextContent(+ 'agentRoster.roster.deleteFailed',+ )expect(mocks.replace).not.toHaveBeenCalled()expect(dialog).toBeInTheDocument()})diff --git a/web/features/agent-v2/agent-detail/sidebar-actions.tsx b/web/features/agent-v2/agent-detail/sidebar-actions.tsxindex 458f49f6ed6..000caaaf416 100644--- a/web/features/agent-v2/agent-detail/sidebar-actions.tsx+++ b/web/features/agent-v2/agent-detail/sidebar-actions.tsx@@ -2,6 +2,7 @@import type { AgentAppPartial } from '@dify/contracts/api/console/agent/types.gen'import type { AgentFormSource } from '@/features/agent-v2/roster/components/agent-form'+import { AlertDialog, AlertDialogContent } from '@langgenius/dify-ui/alert-dialog'import {DropdownMenu,DropdownMenuContent,@@ -10,16 +11,18 @@ import {DropdownMenuTrigger,} from '@langgenius/dify-ui/dropdown-menu'import { IconButton } from '@langgenius/dify-ui/icon-button'+import { useMutation } from '@tanstack/react-query'import { useState } from 'react'import { useTranslation } from 'react-i18next'import { useExportAppDsl } from '@/app/components/app/use-export-app-dsl'import { toast } from '@/app/notifications'import { getAgentACLCapabilities } from '@/features/agent-v2/acl'+import { DeleteAgentForm } from '@/features/agent-v2/delete-agent-form'import { useCanCreateAgents } from '@/features/agent-v2/permissions'-import { DeleteAgentDialog } from '@/features/agent-v2/roster/components/delete-agent-dialog'import { DuplicateAgentDialog } from '@/features/agent-v2/roster/components/duplicate-agent-dialog'import { EditAgentDialog } from '@/features/agent-v2/roster/components/edit-agent-dialog'import { useRouter } from '@/next/navigation'+import { consoleQuery } from '@/service/console'type AgentDetailSidebarActionAgent = AgentFormSource &Pick<AgentAppPartial, 'app_id' | 'permission_keys'>@@ -31,6 +34,9 @@ export function AgentDetailSidebarActions({ agent }: { agent: AgentDetailSidebarconst [isEditOpen, setIsEditOpen] = useState(false)const [isDuplicateOpen, setIsDuplicateOpen] = useState(false)const [isDeleteOpen, setIsDeleteOpen] = useState(false)+ const deletion = useMutation(+ consoleQuery.agent.byAgentId.delete.mutationOptions({ context: { silent: true } }),+ )const { exportAppDsl, isExporting } = useExportAppDsl()const router = useRouter()const capabilities = getAgentACLCapabilities(agent.permission_keys)@@ -115,7 +121,10 @@ export function AgentDetailSidebarActions({ agent }: { agent: AgentDetailSidebar<DropdownMenuItemvariant="destructive"className="gap-2"- onClick={() => setIsDeleteOpen(true)}+ onClick={() => {+ deletion.reset()+ setIsDeleteOpen(true)+ }}><span aria-hidden className="i-ri-delete-bin-line size-4 shrink-0" /><span>{tCommon(($) => $['operation.delete'])}</span>@@ -134,13 +143,33 @@ export function AgentDetailSidebarActions({ agent }: { agent: AgentDetailSidebar/>)}{capabilities.canDelete && (- <DeleteAgentDialog- agentId={agent.id}- agentName={agent.name}+ <AlertDialogopen={isDeleteOpen}- onOpenChange={setIsDeleteOpen}- onDeleted={() => router.replace('/agents')}- />+ onOpenChange={(open, details) => {+ if (!open && deletion.isPending) details.cancel()+ else setIsDeleteOpen(open)+ }}+ >+ <AlertDialogContent>+ <DeleteAgentForm+ agentName={agent.name}+ isPending={deletion.isPending}+ error={deletion.isError ? t(($) => $['roster.deleteFailed']) : undefined}+ onSubmit={() => {+ if (deletion.isPending) return+ deletion.mutate(+ { params: { agent_id: agent.id } },+ {+ onSuccess: () => {+ setIsDeleteOpen(false)+ router.replace('/agents')+ },+ },+ )+ }}+ />+ </AlertDialogContent>+ </AlertDialog>)}</>)diff --git a/web/features/agent-v2/delete-agent-form.tsx b/web/features/agent-v2/delete-agent-form.tsxnew file mode 100644index 00000000000..7235ad7f5ed--- /dev/null+++ b/web/features/agent-v2/delete-agent-form.tsx@@ -0,0 +1,106 @@+'use client'++import {+ AlertDialogBody,+ AlertDialogCancelButton,+ AlertDialogConfirmButton,+ AlertDialogDescription,+ AlertDialogFooter,+ AlertDialogHeader,+ AlertDialogTitle,+} from '@langgenius/dify-ui/alert-dialog'+import { Button } from '@langgenius/dify-ui/button'+import { Field, FieldLabel } from '@langgenius/dify-ui/field'+import { InputGroup, InputGroupAddon, InputGroupInput } from '@langgenius/dify-ui/input-group'+import { useState } from 'react'+import { Trans, useTranslation } from 'react-i18next'++export function DeleteAgentForm({+ agentName,+ isPending,+ error,+ onSubmit,+}: {+ agentName: string+ isPending: boolean+ error?: string+ onSubmit: () => void+}) {+ const { t } = useTranslation(['agentRoster', 'common'])+ // Keep the name the user is asked to type stable while a list refresh lands mid-dialog.+ const [name] = useState(agentName)+ const [confirmation, setConfirmation] = useState('')++ return (+ <form+ className="contents"+ onSubmit={(event) => {+ event.preventDefault()+ if (!isPending && confirmation === name) onSubmit()+ }}+ >+ <AlertDialogHeader>+ <AlertDialogTitle>+ {t(($) => $['roster.deleteDialog.title'], { ns: 'agentRoster', name })}+ </AlertDialogTitle>+ <AlertDialogDescription>+ {t(($) => $['roster.deleteDialog.description'], { ns: 'agentRoster', name })}+ </AlertDialogDescription>+ </AlertDialogHeader>+ <AlertDialogBody>+ <Field name="confirm-agent-name">+ <FieldLabel>+ <Trans+ i18nKey={($) => $['roster.deleteDialog.inputLabel']}+ ns="agentRoster"+ values={{ name }}+ components={{+ name: <span className="system-sm-semibold text-text-primary" translate="no" />,+ }}+ />+ </FieldLabel>+ <InputGroup>+ <InputGroupInput+ autoComplete="off"+ spellCheck={false}+ value={confirmation}+ onValueChange={setConfirmation}+ readOnly={isPending}+ placeholder={t(($) => $['roster.deleteDialog.inputPlaceholder'], {+ ns: 'agentRoster',+ })}+ />+ <InputGroupAddon align="inline-end">+ <Button+ type="button"+ variant="tertiary"+ size="small"+ disabled={isPending}+ onClick={() => setConfirmation(name)}+ >+ {t(($) => $['operation.fill'], { ns: 'common' })}+ </Button>+ </InputGroupAddon>+ </InputGroup>+ </Field>+ {error && (+ <p role="alert" className="mt-2 system-xs-regular text-text-destructive">+ {error}+ </p>+ )}+ </AlertDialogBody>+ <AlertDialogFooter>+ <AlertDialogCancelButton type="button" disabled={isPending}>+ {t(($) => $['operation.cancel'], { ns: 'common' })}+ </AlertDialogCancelButton>+ <AlertDialogConfirmButton+ type="submit"+ loading={isPending}+ disabled={confirmation !== name}+ >+ {t(($) => $['operation.confirm'], { ns: 'common' })}+ </AlertDialogConfirmButton>+ </AlertDialogFooter>+ </form>+ )+}diff --git a/web/features/agent-v2/roster/components/__tests__/delete-agent-dialog.spec.tsx b/web/features/agent-v2/roster/components/__tests__/delete-agent-dialog.spec.tsxdeleted file mode 100644index 2ec15966859..00000000000--- a/web/features/agent-v2/roster/components/__tests__/delete-agent-dialog.spec.tsx+++ /dev/null@@ -1,67 +0,0 @@-import { act, screen, waitFor } from '@testing-library/react'-import userEvent from '@testing-library/user-event'-import { renderWithConsoleQuery as render } from '@/test/console/query-data'-import { createDeferred } from '@/test/deferred'-import { DeleteAgentDialog } from '../delete-agent-dialog'--const mutateRequest = vi.hoisted(() => vi.fn())--vi.mock('react-i18next', async () => {- const { createReactI18nextMock } = await import('@/test/i18n-mock')- const { default: agentV2 } = await import('@/i18n/locales/en-US/agent-roster.json')- return createReactI18nextMock({- 'roster.deleteDialog.description': agentV2['roster.deleteDialog.description'],- 'roster.deleteDialog.title': agentV2['roster.deleteDialog.title'],- })-})--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, {- 'agent.byAgentId.delete': mutateRequest,- }),- }-})--describe('DeleteAgentDialog', () => {- it('explains the deletion impact and waits for the request before notifying the list', async () => {- const user = userEvent.setup()- const pending = createDeferred<void>()- mutateRequest.mockReturnValueOnce(pending.promise)- const onOpenChange = vi.fn()- const onDeleted = vi.fn()- render(- <DeleteAgentDialog- agentId="agent-1"- agentName="Research Agent"- open- onOpenChange={onOpenChange}- onDeleted={onDeleted}- />,- )-- expect(- screen.getByText(- 'This permanently deletes Research Agent. Its web app, API access, and workflows that use it stop working immediately.',- ),- ).toBeInTheDocument()- expect(mutateRequest).not.toHaveBeenCalled()- const confirm = screen.getByRole('button', { name: 'common.operation.delete' })- await user.click(confirm)- await waitFor(() =>- expect(mutateRequest).toHaveBeenCalledExactlyOnceWith({- params: { agent_id: 'agent-1' },- }),- )- await user.click(confirm)- expect(mutateRequest).toHaveBeenCalledOnce()- expect(onOpenChange).not.toHaveBeenCalled()- expect(onDeleted).not.toHaveBeenCalled()- await act(async () => pending.resolve())- await waitFor(() => expect(onDeleted).toHaveBeenCalledOnce())- expect(onOpenChange).toHaveBeenCalledExactlyOnceWith(false)- })-})diff --git a/web/features/agent-v2/roster/components/agent-roster-list.tsx b/web/features/agent-v2/roster/components/agent-roster-list.tsxindex 0e0ca2f72cb..3a42deefe13 100644--- a/web/features/agent-v2/roster/components/agent-roster-list.tsx+++ b/web/features/agent-v2/roster/components/agent-roster-list.tsx@@ -1,6 +1,11 @@'use client'import type { AgentAppPartial } from '@dify/contracts/api/console/agent/types.gen'+import {+ AlertDialog,+ AlertDialogContent,+ createAlertDialogHandle,+} from '@langgenius/dify-ui/alert-dialog'import { Button } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'import {@@ -18,6 +23,7 @@ import {DropdownMenuTrigger,} from '@langgenius/dify-ui/dropdown-menu'import { IconButton } from '@langgenius/dify-ui/icon-button'+import { useMutation } from '@tanstack/react-query'import { useId, useState } from 'react'import { useTranslation } from 'react-i18next'import { useExportAppDsl } from '@/app/components/app/use-export-app-dsl'@@ -26,11 +32,12 @@ import { SkeletonRectangle } from '@/app/components/base/skeleton'import { MAIN_NAV_APP_CARD_GRID_CLASS_NAME } from '@/app/components/main-nav/app-card-grid'import { toast } from '@/app/notifications'import { getAgentACLCapabilities, getAgentDefaultSection } from '@/features/agent-v2/acl'+import { DeleteAgentForm } from '@/features/agent-v2/delete-agent-form'import { useCanCreateAgents } from '@/features/agent-v2/permissions'import useTimestamp from '@/hooks/use-timestamp'import Link from '@/next/link'+import { consoleQuery } from '@/service/console'import { AgentWorkflowReferencesDropdown } from './agent-workflow-references-dropdown'-import { DeleteAgentDialog } from './delete-agent-dialog'import { DuplicateAgentDialog } from './duplicate-agent-dialog'import { EditAgentDialog } from './edit-agent-dialog'@@ -207,14 +214,20 @@ function AgentCardActionMenuItems({)}-function AgentRosterItem({ agent }: { agent: AgentAppPartial }) {+function AgentRosterItem({+ agent,+ onDelete,+}: {+ agent: AgentAppPartial+ onDelete: (agent: AgentAppPartial) => void+}) {const { t } = useTranslation(['agentRoster'])const { t: tApp } = useTranslation(['app'])const { formatTime } = useTimestamp()const nameId = useId()const descriptionId = useId()const draftStatusId = useId()- const [activeDialog, setActiveDialog] = useState<'delete' | 'duplicate' | 'edit' | null>(null)+ const [activeDialog, setActiveDialog] = useState<'duplicate' | 'edit' | null>(null)const { exportAppDsl, isExporting } = useExportAppDsl()const capabilities = getAgentACLCapabilities(agent.permission_keys)const isPreviewOnly = agent.permission_keys?.length === 1 && capabilities.canPreview@@ -251,10 +264,6 @@ function AgentRosterItem({ agent }: { agent: AgentAppPartial }) {setActiveDialog('duplicate')}- const handleDeleteOpen = () => {- setActiveDialog('delete')- }-const handleDialogOpenChange = (open: boolean) => {if (!open) setActiveDialog(null)}@@ -356,7 +365,7 @@ function AgentRosterItem({ agent }: { agent: AgentAppPartial }) {onEdit={capabilities.canEdit ? handleEditOpen : undefined}onDuplicate={canDuplicate ? handleDuplicateOpen : undefined}onExport={capabilities.canImportExportDSL ? handleExport : undefined}- onDelete={capabilities.canDelete ? handleDeleteOpen : undefined}+ onDelete={capabilities.canDelete ? () => onDelete(agent) : undefined}/></ContextMenuContent>)}@@ -386,7 +395,7 @@ function AgentRosterItem({ agent }: { agent: AgentAppPartial }) {onEdit={capabilities.canEdit ? handleEditOpen : undefined}onDuplicate={canDuplicate ? handleDuplicateOpen : undefined}onExport={capabilities.canImportExportDSL ? handleExport : undefined}- onDelete={capabilities.canDelete ? handleDeleteOpen : undefined}+ onDelete={capabilities.canDelete ? () => onDelete(agent) : undefined}/></DropdownMenuContent></DropdownMenu>@@ -438,14 +447,6 @@ function AgentRosterItem({ agent }: { agent: AgentAppPartial }) {onOpenChange={handleDialogOpenChange}/>)}- {capabilities.canDelete && (- <DeleteAgentDialog- agentId={agent.id}- agentName={agent.name}- open={activeDialog === 'delete'}- onOpenChange={handleDialogOpenChange}- />- )}</li>)}@@ -454,6 +455,12 @@ export function AgentRosterList({ label, state }: AgentRosterListProps) {const { t } = useTranslation(['agentRoster'])const { t: tCommon } = useTranslation(['common'])const isBusy = state.status === 'pending' || (state.status === 'ready' && state.isFetching)+ const [deleteDialog] = useState(() =>+ createAlertDialogHandle<Pick<AgentAppPartial, 'id' | 'name'>>(),+ )+ const deletion = useMutation(+ consoleQuery.agent.byAgentId.delete.mutationOptions({ context: { silent: true } }),+ )return (<section aria-label={label} aria-busy={isBusy}>@@ -484,7 +491,14 @@ export function AgentRosterList({ label, state }: AgentRosterListProps) {// oxlint-disable-next-line jsx-a11y/no-redundant-roles -- Dify's preflight removes list markers.<ul role="list" className={AGENT_ROSTER_GRID_CLASS_NAME}>{state.agents.map((agent) => (- <AgentRosterItem key={agent.id} agent={agent} />+ <AgentRosterItem+ key={agent.id}+ agent={agent}+ onDelete={(target) => {+ deletion.reset()+ deleteDialog.openWithPayload(target)+ }}+ />))}</ul>)}@@ -506,6 +520,32 @@ export function AgentRosterList({ label, state }: AgentRosterListProps) {</Button></div>)}+ <AlertDialog+ handle={deleteDialog}+ onOpenChange={(open, details) => {+ if (!open && deletion.isPending && details.reason !== 'imperative-action')+ details.cancel()+ }}+ >+ {({ payload }) => (+ <AlertDialogContent>+ {payload && (+ <DeleteAgentForm+ agentName={payload.name}+ isPending={deletion.isPending}+ error={deletion.isError ? t(($) => $['roster.deleteFailed']) : undefined}+ onSubmit={() => {+ if (deletion.isPending) return+ deletion.mutate(+ { params: { agent_id: payload.id } },+ { onSuccess: () => deleteDialog.close() },+ )+ }}+ />+ )}+ </AlertDialogContent>+ )}+ </AlertDialog></section>)}diff --git a/web/features/agent-v2/roster/components/delete-agent-dialog.tsx b/web/features/agent-v2/roster/components/delete-agent-dialog.tsxdeleted file mode 100644index 74405436a05..00000000000--- a/web/features/agent-v2/roster/components/delete-agent-dialog.tsx+++ /dev/null@@ -1,80 +0,0 @@-'use client'--import {- AlertDialog,- AlertDialogCancelButton,- AlertDialogConfirmButton,- AlertDialogContent,- AlertDialogDescription,- AlertDialogFooter,- AlertDialogHeader,- AlertDialogTitle,-} from '@langgenius/dify-ui/alert-dialog'-import { useMutation } from '@tanstack/react-query'-import { useTranslation } from 'react-i18next'-import { toast } from '@/app/notifications'-import { consoleQuery } from '@/service/console'--type DeleteAgentDialogProps = {- agentId: string- agentName: string- open: boolean- onOpenChange: (open: boolean) => void- onDeleted?: () => void-}--export function DeleteAgentDialog({- agentId,- agentName,- open,- onOpenChange,- onDeleted,-}: DeleteAgentDialogProps) {- const { t } = useTranslation(['agentRoster'])- const { t: tCommon } = useTranslation(['common'])- const deleteAgentMutation = useMutation(consoleQuery.agent.byAgentId.delete.mutationOptions())-- const handleDelete = () => {- if (deleteAgentMutation.isPending) return-- deleteAgentMutation.mutate(- {- params: {- agent_id: agentId,- },- },- {- onSuccess: () => {- onOpenChange(false)- onDeleted?.()- },- onError: () => {- toast.error(t(($) => $['roster.deleteFailed'], { ns: 'agentRoster' }))- },- },- )- }-- return (- <AlertDialog open={open} onOpenChange={onOpenChange}>- <AlertDialogContent>- <AlertDialogHeader>- <AlertDialogTitle>- {t(($) => $['roster.deleteDialog.title'], { ns: 'agentRoster', name: agentName })}- </AlertDialogTitle>- <AlertDialogDescription>- {t(($) => $['roster.deleteDialog.description'], { ns: 'agentRoster', name: agentName })}- </AlertDialogDescription>- </AlertDialogHeader>- <AlertDialogFooter>- <AlertDialogCancelButton disabled={deleteAgentMutation.isPending}>- {tCommon(($) => $['operation.cancel'])}- </AlertDialogCancelButton>- <AlertDialogConfirmButton loading={deleteAgentMutation.isPending} onClick={handleDelete}>- {tCommon(($) => $['operation.delete'])}- </AlertDialogConfirmButton>- </AlertDialogFooter>- </AlertDialogContent>- </AlertDialog>- )-}diff --git a/web/features/new-rag/components/delete-knowledge-form.tsx b/web/features/new-rag/delete-knowledge-form.tsxsimilarity index 95%rename from web/features/new-rag/components/delete-knowledge-form.tsxrename to web/features/new-rag/delete-knowledge-form.tsxindex 2b0e5758a10..ac051aa1ec2 100644--- a/web/features/new-rag/components/delete-knowledge-form.tsx+++ b/web/features/new-rag/delete-knowledge-form.tsx@@ -1,6 +1,5 @@'use client'-import type { RefObject } from 'react'import {AlertDialogBody,AlertDialogCancelButton,@@ -18,13 +17,11 @@ import { Trans, useTranslation } from 'react-i18next'// Rendered inside AlertDialogContent so the confirmation resets each time the dialog opens.export function DeleteKnowledgeForm({- confirmationRef,knowledgeName,isPending,error,onSubmit,}: {- confirmationRef: RefObject<HTMLInputElement | null>knowledgeName: stringisPending: booleanerror?: string@@ -65,7 +62,6 @@ export function DeleteKnowledgeForm({</FieldLabel><InputGroup><InputGroupInput- ref={confirmationRef}autoComplete="off"spellCheck={false}value={confirmation}diff --git a/web/features/new-rag/list/knowledge-space-actions.tsx b/web/features/new-rag/list/knowledge-space-actions.tsxindex a76cdc4be2a..a1e9606c0d0 100644--- a/web/features/new-rag/list/knowledge-space-actions.tsx+++ b/web/features/new-rag/list/knowledge-space-actions.tsx@@ -12,12 +12,12 @@ import {} from '@langgenius/dify-ui/dropdown-menu'import { IconButton } from '@langgenius/dify-ui/icon-button'import { useMutation, useQueryClient } from '@tanstack/react-query'-import { useRef, useState } from 'react'+import { useState } from 'react'import { useTranslation } from 'react-i18next'import Link from '@/next/link'import { consoleQuery } from '@/service/console'import { getHttpErrorStatus } from '@/service/http-error'-import { DeleteKnowledgeForm } from '../components/delete-knowledge-form'+import { DeleteKnowledgeForm } from '../delete-knowledge-form'import { newKnowledgeSettingsPath } from '../routes'export function KnowledgeSpaceActions({@@ -27,25 +27,23 @@ export function KnowledgeSpaceActions({}) {const { t: tCommon } = useTranslation(['common'])const queryClient = useQueryClient()- const [deleteDialogOpen, setDeleteDialogOpen] = useState(false)- const confirmationRef = useRef<HTMLInputElement>(null)+ const [deleteOpen, setDeleteOpen] = useState(false)const canEdit = knowledgeSpace.permission_keys.includes('knowledge_space_edit')const canDelete = knowledgeSpace.permission_keys.includes('knowledge_space_delete')const name = knowledgeSpace.technical_summary?.name ?? knowledgeSpace.control_space_id- const deleteMutation = useMutation({- // The dialog shows the failure next to the confirmation the user can retry.- ...consoleQuery.knowledgeFs.spaces.byControlSpaceId.delete.mutationOptions({+ const deleteMutation = useMutation(+ consoleQuery.knowledgeFs.spaces.byControlSpaceId.delete.mutationOptions({context: { silent: true },+ onSuccess: () => {+ // The card leaves the list once it refreshes; that removal is the success feedback.+ setDeleteOpen(false)+ void queryClient.invalidateQueries({+ queryKey: consoleQuery.knowledgeFs.spaces.get.key(),+ })+ },}),- onSuccess: () => {- // The card leaves the list once it refreshes; that removal is the success feedback.- setDeleteDialogOpen(false)- void queryClient.invalidateQueries({- queryKey: consoleQuery.knowledgeFs.spaces.get.key(),- })- },- })+ )if (!canEdit && !canDelete) return null@@ -83,7 +81,13 @@ export function KnowledgeSpaceActions({{canDelete && (<>{canEdit && <DropdownMenuSeparator />}- <DropdownMenuItem variant="destructive" onClick={() => setDeleteDialogOpen(true)}>+ <DropdownMenuItem+ variant="destructive"+ onClick={() => {+ deleteMutation.reset()+ setDeleteOpen(true)+ }}+ ><span aria-hidden className="mr-1 i-ri-delete-bin-line size-4" />{tCommon(($) => $['operation.delete'])}</DropdownMenuItem>@@ -95,16 +99,14 @@ export function KnowledgeSpaceActions({</div><AlertDialog- open={deleteDialogOpen}- onOpenChange={(open) => {- if (deleteMutation.isPending) return- setDeleteDialogOpen(open)- if (!open) deleteMutation.reset()+ open={deleteOpen}+ onOpenChange={(open, details) => {+ if (!open && deleteMutation.isPending) details.cancel()+ else setDeleteOpen(open)}}>- <AlertDialogContent initialFocus={confirmationRef}>+ <AlertDialogContent><DeleteKnowledgeForm- confirmationRef={confirmationRef}knowledgeName={name}isPending={deleteMutation.isPending}error={deleteError}diff --git a/web/features/new-rag/settings/__tests__/form.spec.tsx b/web/features/new-rag/settings/__tests__/form.spec.tsxindex 7e46ad15192..d6e82d0327c 100644--- a/web/features/new-rag/settings/__tests__/form.spec.tsx+++ b/web/features/new-rag/settings/__tests__/form.spec.tsx@@ -959,6 +959,22 @@ describe('KnowledgeSettingsPage workflows', () => {expect(queryClient.getQueryState(listKey)?.isInvalidated).toBe(true)})+ it('keeps a failed deletion inline and retries with the same confirmed name', async () => {+ const user = userEvent.setup()+ serviceMock.deleteSpace.mockRejectedValueOnce(new Error('network error'))+ await renderForm()+ await user.click(screen.getByRole('button', { name: 'common.operation.delete' }))+ const dialog = await screen.findByRole('alertdialog')+ await user.click(within(dialog).getByRole('button', { name: 'common.operation.fill' }))+ await user.click(within(dialog).getByRole('button', { name: 'common.operation.confirm' }))+ expect(await within(dialog).findByRole('alert')).toHaveTextContent('common.api.actionFailed')+ expect(within(dialog).getByRole('textbox')).toHaveValue('Camera Technical Spec')+ expect(routerMock.replace).not.toHaveBeenCalled()+ await user.click(within(dialog).getByRole('button', { name: 'common.operation.confirm' }))+ await waitFor(() => expect(routerMock.replace).toHaveBeenCalledWith('/datasets?view=agent'))+ expect(serviceMock.deleteSpace).toHaveBeenCalledTimes(2)+ })+it('keeps the deletion dialog modal until the pending deletion settles', async () => {const user = userEvent.setup()let finishDeletion = () => {}diff --git a/web/features/new-rag/settings/delete-knowledge.tsx b/web/features/new-rag/settings/delete-knowledge.tsxindex 0471b1dcca9..cd259c9d305 100644--- a/web/features/new-rag/settings/delete-knowledge.tsx+++ b/web/features/new-rag/settings/delete-knowledge.tsx@@ -1,15 +1,19 @@'use client'-import { AlertDialog, AlertDialogContent } from '@langgenius/dify-ui/alert-dialog'+import type { AlertDialogActions } from '@langgenius/dify-ui/alert-dialog'+import {+ AlertDialog,+ AlertDialogContent,+ AlertDialogTrigger,+} from '@langgenius/dify-ui/alert-dialog'import { Button } from '@langgenius/dify-ui/button'import { useMutation, useQueryClient } from '@tanstack/react-query'import { useAtomValue } from 'jotai'-import { useRef, useState } from 'react'+import { useRef } from 'react'import { useTranslation } from 'react-i18next'-import { toast } from '@/app/notifications'import { useRouter } from '@/next/navigation'import { consoleQuery } from '@/service/console'-import { DeleteKnowledgeForm } from '../components/delete-knowledge-form'+import { DeleteKnowledgeForm } from '../delete-knowledge-form'import { newKnowledgeListPath } from '../routes'import { knowledgeSettingsSpaceAtom } from './state/queries'import { knowledgeSettingsHasPendingSaveAtom } from './state/workflow'@@ -21,10 +25,11 @@ export function DeleteKnowledgeAction() {const queryClient = useQueryClient()const space = useAtomValue(knowledgeSettingsSpaceAtom)const hasPendingSave = useAtomValue(knowledgeSettingsHasPendingSaveAtom)- const [open, setOpen] = useState(false)- const confirmationRef = useRef<HTMLInputElement>(null)+ const deleteActionsRef = useRef<AlertDialogActions>(null)const mutation = useMutation(- consoleQuery.knowledgeFs.spaces.byControlSpaceId.delete.mutationOptions(),+ consoleQuery.knowledgeFs.spaces.byControlSpaceId.delete.mutationOptions({+ context: { silent: true },+ }),)if (!space) return null@@ -32,24 +37,31 @@ export function DeleteKnowledgeAction() {if (!canDelete) return nullconst name = space.technical_summary?.name ?? ''- const deleteKnowledge = async () => {+ const deleteKnowledge = () => {if (mutation.isPending) return- try {- await mutation.mutateAsync({- params: { control_space_id: space.control_space_id },- })- setOpen(false)- void queryClient.invalidateQueries({- queryKey: consoleQuery.knowledgeFs.spaces.get.key(),- })- router.replace(newKnowledgeListPath)- } catch {- toast.error(tCommon(($) => $['api.actionFailed']))- }+ mutation.mutate(+ { params: { control_space_id: space.control_space_id } },+ {+ onSuccess: () => {+ deleteActionsRef.current?.close()+ void queryClient.invalidateQueries({+ queryKey: consoleQuery.knowledgeFs.spaces.get.key(),+ })+ router.replace(newKnowledgeListPath)+ },+ },+ )}return (- <>+ <AlertDialog+ actionsRef={deleteActionsRef}+ onOpenChange={(nextOpen, details) => {+ if (!nextOpen && mutation.isPending && details.reason !== 'imperative-action')+ details.cancel()+ else if (nextOpen) mutation.reset()+ }}+ ><div className="h-px bg-divider-subtle" /><div className="flex min-w-0 flex-col gap-4 pt-7 sm:flex-row sm:gap-1"><h2 className="flex h-8 w-full shrink-0 items-center system-sm-semibold text-text-destructive sm:w-45">@@ -64,34 +76,22 @@ export function DeleteKnowledgeAction() {{t(($) => $['settings.deleteDescription'], { ns: 'knowledgeSettings' })}</p></div>- <Button- type="button"- tone="destructive"- disabled={hasPendingSave}- onClick={() => setOpen(true)}+ <AlertDialogTrigger+ render={<Button type="button" tone="destructive" disabled={hasPendingSave} />}>{tCommon(($) => $['operation.delete'])}- </Button>+ </AlertDialogTrigger></div></div>- <AlertDialog- open={open}- onOpenChange={(nextOpen) => {- // The pending deletion redirects when it settles; keep it modal until then.- if (!nextOpen && mutation.isPending) return- setOpen(nextOpen)- }}- >- <AlertDialogContent initialFocus={confirmationRef}>- <DeleteKnowledgeForm- confirmationRef={confirmationRef}- knowledgeName={name}- isPending={mutation.isPending}- onSubmit={() => void deleteKnowledge()}- />- </AlertDialogContent>- </AlertDialog>- </>+ <AlertDialogContent>+ <DeleteKnowledgeForm+ knowledgeName={name}+ isPending={mutation.isPending}+ error={mutation.isError ? tCommon(($) => $['api.actionFailed']) : undefined}+ onSubmit={deleteKnowledge}+ />+ </AlertDialogContent>+ </AlertDialog>)}diff --git a/web/i18n/locales/ar-TN/agent-roster.json b/web/i18n/locales/ar-TN/agent-roster.jsonindex 228827f1c3b..d556992ce64 100644--- a/web/i18n/locales/ar-TN/agent-roster.json+++ b/web/i18n/locales/ar-TN/agent-roster.json@@ -12,6 +12,8 @@"roster.createForm.rolePlaceholder": "مثلاً مساعد بحث","roster.dateTimeFormat": "DD/MM/YYYY HH:mm:ss","roster.deleteDialog.description": "سيؤدي هذا إلى حذف {{name}} نهائيًا. سيتوقف تطبيق الويب الخاص به، والوصول عبر API، وجميع عمليات سير العمل التي تستخدمه عن العمل فورًا.",+ "roster.deleteDialog.inputLabel": "اكتب <name>{{name}}</name> للتأكيد",+ "roster.deleteDialog.inputPlaceholder": "أدخل اسم الوكيل","roster.deleteDialog.title": "حذف {{name}}؟","roster.deleteFailed": "فشل حذف الوكيل.","roster.duplicateDialog.description": "أنشئ نسخة من {{name}} وخصّص هوية Agent الخاصة بها.",diff --git a/web/i18n/locales/az-AZ/agent-roster.json b/web/i18n/locales/az-AZ/agent-roster.jsonindex fa86345e2bb..ff8ff6aef82 100644--- a/web/i18n/locales/az-AZ/agent-roster.json+++ b/web/i18n/locales/az-AZ/agent-roster.json@@ -12,6 +12,8 @@"roster.createForm.rolePlaceholder": "məsələn, tədqiqat köməkçisi","roster.dateTimeFormat": "DD.MM.YYYY HH:mm:ss","roster.deleteDialog.description": "Bu əməliyyat {{name}} agentini həmişəlik silir. Onun veb tətbiqi, API girişi və ondan istifadə edən iş axınları dərhal fəaliyyətini dayandırır.",+ "roster.deleteDialog.inputLabel": "Təsdiqləmək üçün <name>{{name}}</name> yazın",+ "roster.deleteDialog.inputPlaceholder": "Agentin adını daxil edin","roster.deleteDialog.title": "{{name}} silinsin?","roster.deleteFailed": "Agenti silmək mümkün olmadı.","roster.duplicateDialog.description": "{{name}} agentinin surətini yaradın və onun agent kimliyini fərdiləşdirin.",diff --git a/web/i18n/locales/de-DE/agent-roster.json b/web/i18n/locales/de-DE/agent-roster.jsonindex 2f403429057..f02e02d366b 100644--- a/web/i18n/locales/de-DE/agent-roster.json+++ b/web/i18n/locales/de-DE/agent-roster.json@@ -12,6 +12,8 @@"roster.createForm.rolePlaceholder": "z. B. Research Assistant","roster.dateTimeFormat": "DD.MM.YYYY HH:mm:ss","roster.deleteDialog.description": "Dadurch wird {{name}} dauerhaft gelöscht. Die zugehörige Webapp, der API-Zugriff und alle Workflows, die diesen Agenten verwenden, funktionieren ab sofort nicht mehr.",+ "roster.deleteDialog.inputLabel": "Gib zur Bestätigung <name>{{name}}</name> ein",+ "roster.deleteDialog.inputPlaceholder": "Agentennamen eingeben","roster.deleteDialog.title": "{{name}} löschen?","roster.deleteFailed": "Agent konnte nicht gelöscht werden.","roster.duplicateDialog.description": "Erstellen Sie eine Kopie von {{name}} und passen Sie ihre Agent-Identität an.",diff --git a/web/i18n/locales/en-US/agent-roster.json b/web/i18n/locales/en-US/agent-roster.jsonindex 6693ffcbcdc..7ea6a32eb84 100644--- a/web/i18n/locales/en-US/agent-roster.json+++ b/web/i18n/locales/en-US/agent-roster.json@@ -12,6 +12,8 @@"roster.createForm.rolePlaceholder": "e.g. Research Assistant","roster.dateTimeFormat": "MM/DD/YYYY hh:mm:ss A","roster.deleteDialog.description": "This permanently deletes {{name}}. Its web app, API access, and workflows that use it stop working immediately.",+ "roster.deleteDialog.inputLabel": "Type <name>{{name}}</name> to confirm",+ "roster.deleteDialog.inputPlaceholder": "Enter agent name","roster.deleteDialog.title": "Delete {{name}}?","roster.deleteFailed": "Failed to delete agent.","roster.duplicateDialog.description": "Create a copy of {{name}} and customize its Agent identity.",diff --git a/web/i18n/locales/es-ES/agent-roster.json b/web/i18n/locales/es-ES/agent-roster.jsonindex a620705c651..72f259cea1d 100644--- a/web/i18n/locales/es-ES/agent-roster.json+++ b/web/i18n/locales/es-ES/agent-roster.json@@ -12,6 +12,8 @@"roster.createForm.rolePlaceholder": "p. ej. Asistente de investigación","roster.dateTimeFormat": "DD/MM/YYYY HH:mm:ss","roster.deleteDialog.description": "Esto elimina permanentemente {{name}}. Su aplicación web, el acceso a la API y los flujos de trabajo que lo usan dejarán de funcionar de inmediato.",+ "roster.deleteDialog.inputLabel": "Escribe <name>{{name}}</name> para confirmar",+ "roster.deleteDialog.inputPlaceholder": "Introduce el nombre del agente","roster.deleteDialog.title": "¿Eliminar {{name}}?","roster.deleteFailed": "Error al eliminar el agente.","roster.duplicateDialog.description": "Crea una copia de {{name}} y personaliza su identidad de Agent.",diff --git a/web/i18n/locales/fa-IR/agent-roster.json b/web/i18n/locales/fa-IR/agent-roster.jsonindex 88336cb51dc..6c1f0349a08 100644--- a/web/i18n/locales/fa-IR/agent-roster.json+++ b/web/i18n/locales/fa-IR/agent-roster.json@@ -12,6 +12,8 @@"roster.createForm.rolePlaceholder": "مثلاً دستیار پژوهش","roster.dateTimeFormat": "YYYY/MM/DD HH:mm:ss","roster.deleteDialog.description": "این کار {{name}} را برای همیشه حذف میکند. برنامه وب آن، دسترسی به API و گردشهای کاری که از آن استفاده میکنند، بلافاصله از کار میافتند.",+ "roster.deleteDialog.inputLabel": "برای تأیید، <name>{{name}}</name> را وارد کنید",+ "roster.deleteDialog.inputPlaceholder": "نام عامل را وارد کنید","roster.deleteDialog.title": "حذف {{name}}؟","roster.deleteFailed": "حذف عامل ناموفق بود.","roster.duplicateDialog.description": "یک کپی از {{name}} ایجاد کنید و هویت Agent آن را سفارشی کنید.",diff --git a/web/i18n/locales/fr-FR/agent-roster.json b/web/i18n/locales/fr-FR/agent-roster.jsonindex a0fab5cae44..ca9c1881377 100644--- a/web/i18n/locales/fr-FR/agent-roster.json+++ b/web/i18n/locales/fr-FR/agent-roster.json@@ -12,6 +12,8 @@"roster.createForm.rolePlaceholder": "p. ex. Assistant de recherche","roster.dateTimeFormat": "DD/MM/YYYY HH:mm:ss","roster.deleteDialog.description": "Cette action supprime définitivement {{name}}. Son application web, son accès à l’API et les workflows qui l’utilisent cesseront immédiatement de fonctionner.",+ "roster.deleteDialog.inputLabel": "Saisissez <name>{{name}}</name> pour confirmer",+ "roster.deleteDialog.inputPlaceholder": "Saisissez le nom de l’agent","roster.deleteDialog.title": "Supprimer {{name}} ?","roster.deleteFailed": "Échec de la suppression de l’agent.","roster.duplicateDialog.description": "Créez une copie de {{name}} et personnalisez son identité Agent.",diff --git a/web/i18n/locales/hi-IN/agent-roster.json b/web/i18n/locales/hi-IN/agent-roster.jsonindex 6e2b84a3d9b..7fc66e56c12 100644--- a/web/i18n/locales/hi-IN/agent-roster.json+++ b/web/i18n/locales/hi-IN/agent-roster.json@@ -12,6 +12,8 @@"roster.createForm.rolePlaceholder": "उदा. शोध सहायक","roster.dateTimeFormat": "DD/MM/YYYY hh:mm:ss A","roster.deleteDialog.description": "इससे {{name}} स्थायी रूप से हटा दिया जाएगा। इसका वेब ऐप, API एक्सेस और इसका उपयोग करने वाले वर्कफ़्लो तुरंत काम करना बंद कर देंगे।",+ "roster.deleteDialog.inputLabel": "पुष्टि करने के लिए <name>{{name}}</name> टाइप करें",+ "roster.deleteDialog.inputPlaceholder": "एजेंट का नाम दर्ज करें","roster.deleteDialog.title": "{{name}} हटाएँ?","roster.deleteFailed": "एजेंट हटाने में विफल।","roster.duplicateDialog.description": "{{name}} की एक प्रति बनाएँ और उसकी Agent पहचान को अनुकूलित करें।",diff --git a/web/i18n/locales/id-ID/agent-roster.json b/web/i18n/locales/id-ID/agent-roster.jsonindex b17aea16851..c33614212cd 100644--- a/web/i18n/locales/id-ID/agent-roster.json+++ b/web/i18n/locales/id-ID/agent-roster.json@@ -12,6 +12,8 @@"roster.createForm.rolePlaceholder": "mis. Asisten Riset","roster.dateTimeFormat": "DD/MM/YYYY HH:mm:ss","roster.deleteDialog.description": "Tindakan ini menghapus {{name}} secara permanen. Aplikasi web dan akses API miliknya, serta alur kerja yang menggunakannya, akan langsung berhenti berfungsi.",+ "roster.deleteDialog.inputLabel": "Ketik <name>{{name}}</name> untuk mengonfirmasi",+ "roster.deleteDialog.inputPlaceholder": "Masukkan nama agen","roster.deleteDialog.title": "Hapus {{name}}?","roster.deleteFailed": "Gagal menghapus agen.","roster.duplicateDialog.description": "Buat salinan {{name}} dan sesuaikan identitas Agent-nya.",diff --git a/web/i18n/locales/it-IT/agent-roster.json b/web/i18n/locales/it-IT/agent-roster.jsonindex 95f9cc4d19d..11ea8471363 100644--- a/web/i18n/locales/it-IT/agent-roster.json+++ b/web/i18n/locales/it-IT/agent-roster.json@@ -12,6 +12,8 @@"roster.createForm.rolePlaceholder": "ad es. Assistente di ricerca","roster.dateTimeFormat": "DD/MM/YYYY HH:mm:ss","roster.deleteDialog.description": "Questa azione elimina definitivamente {{name}}. La sua app web, l’accesso API e i workflow che lo utilizzano smetteranno immediatamente di funzionare.",+ "roster.deleteDialog.inputLabel": "Digita <name>{{name}}</name> per confermare",+ "roster.deleteDialog.inputPlaceholder": "Inserisci il nome dell’agente","roster.deleteDialog.title": "Eliminare {{name}}?","roster.deleteFailed": "Impossibile eliminare l’agente.","roster.duplicateDialog.description": "Crea una copia di {{name}} e personalizza la sua identità Agent.",diff --git a/web/i18n/locales/ja-JP/agent-roster.json b/web/i18n/locales/ja-JP/agent-roster.jsonindex 26cd3f65aa1..7316fa8ca0c 100644--- a/web/i18n/locales/ja-JP/agent-roster.json+++ b/web/i18n/locales/ja-JP/agent-roster.json@@ -12,6 +12,8 @@"roster.createForm.rolePlaceholder": "例: リサーチアシスタント","roster.dateTimeFormat": "YYYY/MM/DD HH:mm:ss","roster.deleteDialog.description": "{{name}} を完全に削除します。その Web アプリと API アクセス、これを使用するワークフローは直ちに動作しなくなります。",+ "roster.deleteDialog.inputLabel": "確認のため <name>{{name}}</name> を入力してください",+ "roster.deleteDialog.inputPlaceholder": "エージェント名を入力","roster.deleteDialog.title": "{{name}} を削除しますか?","roster.deleteFailed": "エージェントの削除に失敗しました。","roster.duplicateDialog.description": "{{name}} のコピーを作成し、その Agent ID 情報をカスタマイズします。",diff --git a/web/i18n/locales/ko-KR/agent-roster.json b/web/i18n/locales/ko-KR/agent-roster.jsonindex 50e91f4131e..bf2b6abb9ff 100644--- a/web/i18n/locales/ko-KR/agent-roster.json+++ b/web/i18n/locales/ko-KR/agent-roster.json@@ -12,6 +12,8 @@"roster.createForm.rolePlaceholder": "예: 리서치 어시스턴트","roster.dateTimeFormat": "YYYY-MM-DD HH:mm:ss","roster.deleteDialog.description": "이 작업은 {{name}}을(를) 영구적으로 삭제합니다. 해당 에이전트의 웹 앱과 API 액세스, 그리고 이를 사용하는 워크플로는 즉시 작동을 멈춥니다.",+ "roster.deleteDialog.inputLabel": "확인하려면 <name>{{name}}</name>을(를) 입력하세요",+ "roster.deleteDialog.inputPlaceholder": "에이전트 이름 입력","roster.deleteDialog.title": "{{name}}을(를) 삭제하시겠습니까?","roster.deleteFailed": "에이전트 삭제에 실패했습니다.","roster.duplicateDialog.description": "{{name}} 의 사본을 만들고 Agent ID 정보를 사용자 지정합니다.",diff --git a/web/i18n/locales/lo-LA/agent-roster.json b/web/i18n/locales/lo-LA/agent-roster.jsonindex 007640d74cd..7184220dc6f 100644--- a/web/i18n/locales/lo-LA/agent-roster.json+++ b/web/i18n/locales/lo-LA/agent-roster.json@@ -12,6 +12,8 @@"roster.createForm.rolePlaceholder": "ຕົວຢ່າງ: ຜູ້ຊ່ວຍການວິໄຈ","roster.dateTimeFormat": "DD/MM/YYYY hh:mm:ss A","roster.deleteDialog.description": "ການດຳເນີນການນີ້ຈະລຶບ {{name}} ຢ່າງຖາວອນ. ເວັບແອັບ ແລະ ການເຂົ້າເຖິງ API ຂອງຕົວແທນນີ້, ພ້ອມທັງເວີກໂຟລທີ່ໃຊ້ຕົວແທນນີ້, ຈະຢຸດໃຊ້ງານທັນທີ.",+ "roster.deleteDialog.inputLabel": "ພິມ <name>{{name}}</name> ເພື່ອຢືນຢັນ",+ "roster.deleteDialog.inputPlaceholder": "ປ້ອນຊື່ຕົວແທນ","roster.deleteDialog.title": "ລຶບ {{name}} ບໍ?","roster.deleteFailed": "ລຶບຕົວແທນບໍ່ສຳເລັດ.","roster.duplicateDialog.description": "ສ້າງສຳເນົາຂອງ {{name}} ແລະ ປັບແຕ່ງຕົວຕົນຂອງຕົວແທນ.",diff --git a/web/i18n/locales/nl-NL/agent-roster.json b/web/i18n/locales/nl-NL/agent-roster.jsonindex c8b6ee6fa6c..80fbca95c72 100644--- a/web/i18n/locales/nl-NL/agent-roster.json+++ b/web/i18n/locales/nl-NL/agent-roster.json@@ -12,6 +12,8 @@"roster.createForm.rolePlaceholder": "bv. Research Assistant","roster.dateTimeFormat": "DD-MM-YYYY HH:mm:ss","roster.deleteDialog.description": "Hiermee wordt {{name}} permanent verwijderd. De bijbehorende webapp en API-toegang, evenals workflows die deze Agent gebruiken, werken onmiddellijk niet meer.",+ "roster.deleteDialog.inputLabel": "Typ <name>{{name}}</name> om te bevestigen",+ "roster.deleteDialog.inputPlaceholder": "Voer de agentnaam in","roster.deleteDialog.title": "{{name}} verwijderen?","roster.deleteFailed": "Verwijderen van agent mislukt.","roster.duplicateDialog.description": "Maak een kopie van {{name}} en pas de Agent-identiteit aan.",diff --git a/web/i18n/locales/pl-PL/agent-roster.json b/web/i18n/locales/pl-PL/agent-roster.jsonindex 123b654fd06..754ffc26e64 100644--- a/web/i18n/locales/pl-PL/agent-roster.json+++ b/web/i18n/locales/pl-PL/agent-roster.json@@ -12,6 +12,8 @@"roster.createForm.rolePlaceholder": "np. Asystent badawczy","roster.dateTimeFormat": "DD.MM.YYYY HH:mm:ss","roster.deleteDialog.description": "Spowoduje to trwałe usunięcie {{name}}. Jego aplikacja webowa, dostęp do API oraz workflow, które go używają, natychmiast przestaną działać.",+ "roster.deleteDialog.inputLabel": "Wpisz <name>{{name}}</name>, aby potwierdzić",+ "roster.deleteDialog.inputPlaceholder": "Wpisz nazwę agenta","roster.deleteDialog.title": "Usunąć {{name}}?","roster.deleteFailed": "Nie udało się usunąć agenta.","roster.duplicateDialog.description": "Utwórz kopię {{name}} i dostosuj jej tożsamość Agent.",diff --git a/web/i18n/locales/pt-BR/agent-roster.json b/web/i18n/locales/pt-BR/agent-roster.jsonindex 428f2cd9bb2..70bf701f0bf 100644--- a/web/i18n/locales/pt-BR/agent-roster.json+++ b/web/i18n/locales/pt-BR/agent-roster.json@@ -12,6 +12,8 @@"roster.createForm.rolePlaceholder": "ex.: Assistente de pesquisa","roster.dateTimeFormat": "DD/MM/YYYY HH:mm:ss","roster.deleteDialog.description": "Isso excluirá permanentemente {{name}}. O aplicativo web e o acesso à API desse Agent, bem como os workflows que o utilizam, deixarão de funcionar imediatamente.",+ "roster.deleteDialog.inputLabel": "Digite <name>{{name}}</name> para confirmar",+ "roster.deleteDialog.inputPlaceholder": "Digite o nome do agente","roster.deleteDialog.title": "Excluir {{name}}?","roster.deleteFailed": "Falha ao excluir o agente.","roster.duplicateDialog.description": "Crie uma cópia de {{name}} e personalize sua identidade de Agent.",diff --git a/web/i18n/locales/ro-RO/agent-roster.json b/web/i18n/locales/ro-RO/agent-roster.jsonindex 69976722dc4..0e425f4702c 100644--- a/web/i18n/locales/ro-RO/agent-roster.json+++ b/web/i18n/locales/ro-RO/agent-roster.json@@ -12,6 +12,8 @@"roster.createForm.rolePlaceholder": "de ex. Asistent de cercetare","roster.dateTimeFormat": "DD.MM.YYYY HH:mm:ss","roster.deleteDialog.description": "Această acțiune șterge definitiv {{name}}. Aplicația web și accesul la API ale Agentului, precum și workflow-urile care îl folosesc, vor înceta imediat să funcționeze.",+ "roster.deleteDialog.inputLabel": "Introdu <name>{{name}}</name> pentru a confirma",+ "roster.deleteDialog.inputPlaceholder": "Introdu numele agentului","roster.deleteDialog.title": "Ștergeți {{name}}?","roster.deleteFailed": "Ștergerea agentului a eșuat.","roster.duplicateDialog.description": "Creați o copie a {{name}} și personalizați-i identitatea Agent.",diff --git a/web/i18n/locales/ru-RU/agent-roster.json b/web/i18n/locales/ru-RU/agent-roster.jsonindex 4e2185f1426..389f7eaf647 100644--- a/web/i18n/locales/ru-RU/agent-roster.json+++ b/web/i18n/locales/ru-RU/agent-roster.json@@ -12,6 +12,8 @@"roster.createForm.rolePlaceholder": "напр. Помощник по исследованиям","roster.dateTimeFormat": "DD.MM.YYYY HH:mm:ss","roster.deleteDialog.description": "Это навсегда удалит {{name}}. Веб-приложение и доступ к API этого Agent, а также использующие его рабочие процессы немедленно перестанут работать.",+ "roster.deleteDialog.inputLabel": "Введите <name>{{name}}</name> для подтверждения",+ "roster.deleteDialog.inputPlaceholder": "Введите имя агента","roster.deleteDialog.title": "Удалить {{name}}?","roster.deleteFailed": "Не удалось удалить агента.","roster.duplicateDialog.description": "Создайте копию {{name}} и настройте её идентичность Agent.",diff --git a/web/i18n/locales/sl-SI/agent-roster.json b/web/i18n/locales/sl-SI/agent-roster.jsonindex 873c00ed05a..85ded551629 100644--- a/web/i18n/locales/sl-SI/agent-roster.json+++ b/web/i18n/locales/sl-SI/agent-roster.json@@ -12,6 +12,8 @@"roster.createForm.rolePlaceholder": "npr. Raziskovalni asistent","roster.dateTimeFormat": "DD. MM. YYYY HH:mm:ss","roster.deleteDialog.description": "S tem trajno izbrišete {{name}}. Spletna aplikacija in dostop do API-ja tega Agenta ter poteki dela, ki ga uporabljajo, bodo takoj prenehali delovati.",+ "roster.deleteDialog.inputLabel": "Za potrditev vnesite <name>{{name}}</name>",+ "roster.deleteDialog.inputPlaceholder": "Vnesite ime agenta","roster.deleteDialog.title": "Izbrišem {{name}}?","roster.deleteFailed": "Agenta ni bilo mogoče izbrisati.","roster.duplicateDialog.description": "Ustvarite kopijo {{name}} in prilagodite njeno identiteto Agent.",diff --git a/web/i18n/locales/th-TH/agent-roster.json b/web/i18n/locales/th-TH/agent-roster.jsonindex 389be35897b..281c807afab 100644--- a/web/i18n/locales/th-TH/agent-roster.json+++ b/web/i18n/locales/th-TH/agent-roster.json@@ -12,6 +12,8 @@"roster.createForm.rolePlaceholder": "เช่น ผู้ช่วยวิจัย","roster.dateTimeFormat": "DD/MM/YYYY HH:mm:ss","roster.deleteDialog.description": "การดำเนินการนี้จะลบ {{name}} อย่างถาวร เว็บแอปและการเข้าถึง API ของ Agent นี้ รวมถึงเวิร์กโฟลว์ที่ใช้ Agent นี้ จะหยุดทำงานทันที",+ "roster.deleteDialog.inputLabel": "พิมพ์ <name>{{name}}</name> เพื่อยืนยัน",+ "roster.deleteDialog.inputPlaceholder": "ป้อนชื่อเอเจนต์","roster.deleteDialog.title": "ลบ {{name}} หรือไม่","roster.deleteFailed": "ลบตัวแทนไม่สำเร็จ","roster.duplicateDialog.description": "สร้างสำเนาของ {{name}} และปรับแต่งข้อมูลระบุตัวตนของ Agent",diff --git a/web/i18n/locales/tr-TR/agent-roster.json b/web/i18n/locales/tr-TR/agent-roster.jsonindex e5701c009ba..01218d3346e 100644--- a/web/i18n/locales/tr-TR/agent-roster.json+++ b/web/i18n/locales/tr-TR/agent-roster.json@@ -12,6 +12,8 @@"roster.createForm.rolePlaceholder": "örn. Araştırma Asistanı","roster.dateTimeFormat": "DD/MM/YYYY HH:mm:ss","roster.deleteDialog.description": "Bu işlem {{name}} adlı Agent'ı kalıcı olarak siler. Bu Agent'ın web uygulaması ve API erişimi ile onu kullanan iş akışları hemen çalışmayı durdurur.",+ "roster.deleteDialog.inputLabel": "Onaylamak için <name>{{name}}</name> yazın",+ "roster.deleteDialog.inputPlaceholder": "Aracı adını girin","roster.deleteDialog.title": "{{name}} silinsin mi?","roster.deleteFailed": "Ajan silinemedi.","roster.duplicateDialog.description": "{{name}} kopyasını oluşturun ve Agent kimliğini özelleştirin.",diff --git a/web/i18n/locales/uk-UA/agent-roster.json b/web/i18n/locales/uk-UA/agent-roster.jsonindex f7fa00d2805..a6ed2b66105 100644--- a/web/i18n/locales/uk-UA/agent-roster.json+++ b/web/i18n/locales/uk-UA/agent-roster.json@@ -12,6 +12,8 @@"roster.createForm.rolePlaceholder": "напр. Помічник з досліджень","roster.dateTimeFormat": "DD.MM.YYYY HH:mm:ss","roster.deleteDialog.description": "Це назавжди видалить {{name}}. Вебзастосунок і доступ до API цього Agent, а також робочі процеси, що його використовують, негайно припинять працювати.",+ "roster.deleteDialog.inputLabel": "Введіть <name>{{name}}</name> для підтвердження",+ "roster.deleteDialog.inputPlaceholder": "Введіть ім’я агента","roster.deleteDialog.title": "Видалити {{name}}?","roster.deleteFailed": "Не вдалося видалити агента.","roster.duplicateDialog.description": "Створіть копію {{name}} та налаштуйте її ідентичність Agent.",diff --git a/web/i18n/locales/vi-VN/agent-roster.json b/web/i18n/locales/vi-VN/agent-roster.jsonindex 50e6076e93d..05cf57e6f13 100644--- a/web/i18n/locales/vi-VN/agent-roster.json+++ b/web/i18n/locales/vi-VN/agent-roster.json@@ -12,6 +12,8 @@"roster.createForm.rolePlaceholder": "ví dụ: Trợ lý nghiên cứu","roster.dateTimeFormat": "DD/MM/YYYY HH:mm:ss","roster.deleteDialog.description": "Thao tác này sẽ xóa vĩnh viễn {{name}}. Ứng dụng web, quyền truy cập API và các quy trình làm việc sử dụng Agent này sẽ ngừng hoạt động ngay lập tức.",+ "roster.deleteDialog.inputLabel": "Nhập <name>{{name}}</name> để xác nhận",+ "roster.deleteDialog.inputPlaceholder": "Nhập tên tác nhân","roster.deleteDialog.title": "Xóa {{name}}?","roster.deleteFailed": "Xóa tác nhân thất bại.","roster.duplicateDialog.description": "Tạo một bản sao của {{name}} và tùy chỉnh danh tính Agent của nó.",diff --git a/web/i18n/locales/zh-Hans/agent-roster.json b/web/i18n/locales/zh-Hans/agent-roster.jsonindex 4a514f48f8f..fad89de61c8 100644--- a/web/i18n/locales/zh-Hans/agent-roster.json+++ b/web/i18n/locales/zh-Hans/agent-roster.json@@ -12,6 +12,8 @@"roster.createForm.rolePlaceholder": "例如:研究助理","roster.dateTimeFormat": "YYYY-MM-DD HH:mm:ss","roster.deleteDialog.description": "此操作将永久删除 {{name}}。其 Web 应用、API 访问及使用它的工作流将立即失效。",+ "roster.deleteDialog.inputLabel": "输入 <name>{{name}}</name> 以确认",+ "roster.deleteDialog.inputPlaceholder": "输入 Agent 名称","roster.deleteDialog.title": "删除 {{name}}?","roster.deleteFailed": "Agent 删除失败。","roster.duplicateDialog.description": "创建 {{name}} 的副本,并自定义它的 Agent 身份信息。",diff --git a/web/i18n/locales/zh-Hant/agent-roster.json b/web/i18n/locales/zh-Hant/agent-roster.jsonindex 29d9a047ec0..93318d5a108 100644--- a/web/i18n/locales/zh-Hant/agent-roster.json+++ b/web/i18n/locales/zh-Hant/agent-roster.json@@ -12,6 +12,8 @@"roster.createForm.rolePlaceholder": "例如:研究助理","roster.dateTimeFormat": "YYYY-MM-DD HH:mm:ss","roster.deleteDialog.description": "此操作將永久刪除 {{name}}。其 Web 應用程式、API 存取及使用它的工作流程將立即停止運作。",+ "roster.deleteDialog.inputLabel": "輸入 <name>{{name}}</name> 以確認",+ "roster.deleteDialog.inputPlaceholder": "輸入 Agent 名稱","roster.deleteDialog.title": "刪除 {{name}}?","roster.deleteFailed": "Agent 刪除失敗。","roster.duplicateDialog.description": "建立 {{name}} 的副本,並自訂它的 Agent 身份資訊。",diff --git a/web/i18n/resources.generated.d.ts b/web/i18n/resources.generated.d.tsindex ac784ee7168..98520808a6e 100644--- a/web/i18n/resources.generated.d.ts+++ b/web/i18n/resources.generated.d.ts@@ -117,6 +117,8 @@ export default interface Resources {'roster.createForm.rolePlaceholder': 'e.g. Research Assistant''roster.dateTimeFormat': 'MM/DD/YYYY hh:mm:ss A''roster.deleteDialog.description': 'This permanently deletes {{name}}. Its web app, API access, and workflows that use it stop working immediately.'+ 'roster.deleteDialog.inputLabel': 'Type <name>{{name}}</name> to confirm'+ 'roster.deleteDialog.inputPlaceholder': 'Enter agent name''roster.deleteDialog.title': 'Delete {{name}}?''roster.deleteFailed': 'Failed to delete agent.''roster.duplicateDialog.description': 'Create a copy of {{name}} and customize its Agent identity.'