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
feat(web): add copy action to error toasts (#42480)
Joela60167b39038
diff --git a/packages/dify-ui/src/toast/__tests__/index.spec.tsx b/packages/dify-ui/src/toast/__tests__/index.spec.tsxindex 8c690c134dd..5428a446bc0 100644--- a/packages/dify-ui/src/toast/__tests__/index.spec.tsx+++ b/packages/dify-ui/src/toast/__tests__/index.spec.tsx@@ -1,6 +1,45 @@+import type { ToastManager, ToastViewportProps } from '../index'import { userEvent } from 'vite-plus/test/browser'import { render } from 'vitest-browser-react'-import { createToast, createToastManager, toast, ToastHost } from '../index'+import {+ createToast,+ createToastManager,+ ToastCard,+ ToastPortal,+ ToastProvider,+ ToastViewport,+ useToastManager,+} from '../index'++function ToastCards() {+ const { toasts } = useToastManager<Record<string, never>>()+ return toasts.map((item) => <ToastCard key={item.id} toast={item} />)+}++function ExampleToastHost({+ manager,+ timeout,+ limit,+ offset,+}: {+ manager: ToastManager+ timeout?: number+ limit?: number+ offset?: ToastViewportProps['offset']+}) {+ return (+ <ToastProvider toastManager={manager} timeout={timeout} limit={limit}>+ <ToastPortal>+ <ToastViewport offset={offset}>+ <ToastCards />+ </ToastViewport>+ </ToastPortal>+ </ToastProvider>+ )+}++const manager = createToastManager()+const toast = createToast(manager)const asHTMLElement = (element: HTMLElement | SVGElement) => element as HTMLElement@@ -22,7 +61,7 @@ describe('@langgenius/dify-ui/toast', () => {})it('should render a success toast when called through the typed shortcut', async () => {- const screen = await render(<ToastHost />)+ const screen = await render(<ExampleToastHost manager={manager} />)toast.success('Saved', {description: 'Your changes are available now.',@@ -35,7 +74,7 @@ describe('@langgenius/dify-ui/toast', () => {})it('should keep multiple toast roots mounted in a collapsed stack', async () => {- const screen = await render(<ToastHost />)+ const screen = await render(<ExampleToastHost manager={manager} />)toast('First toast')await expect.element(screen.getByText('First toast')).toBeInTheDocument()@@ -63,7 +102,7 @@ describe('@langgenius/dify-ui/toast', () => {>Underlying action</button>- <ToastHost timeout={0} />+ <ExampleToastHost manager={manager} timeout={0} /></>,)@@ -130,7 +169,7 @@ describe('@langgenius/dify-ui/toast', () => {height: 20,}}/>- <ToastHost timeout={0} offset={{ top: 120 }} />+ <ExampleToastHost manager={manager} timeout={0} offset={{ top: 120 }} /></>,)@@ -190,7 +229,7 @@ describe('@langgenius/dify-ui/toast', () => {height: 20,}}/>- <ToastHost timeout={0} />+ <ExampleToastHost manager={manager} timeout={0} /></>,)@@ -220,7 +259,7 @@ describe('@langgenius/dify-ui/toast', () => {})it('should render a neutral toast when called directly', async () => {- const screen = await render(<ToastHost />)+ const screen = await render(<ExampleToastHost manager={manager} />)toast('Neutral toast')@@ -232,8 +271,8 @@ describe('@langgenius/dify-ui/toast', () => {const localToast = createToast(localManager)const screen = await render(<>- <ToastHost />- <ToastHost manager={localManager} />+ <ExampleToastHost manager={manager} />+ <ExampleToastHost manager={localManager} /></>,)@@ -254,7 +293,7 @@ describe('@langgenius/dify-ui/toast', () => {it('should apply custom positioning to the viewport', async () => {const localManager = createToastManager()const localToast = createToast(localManager)- const screen = await render(<ToastHost manager={localManager} offset={{ top: 80 }} />)+ const screen = await render(<ExampleToastHost manager={localManager} offset={{ top: 80 }} />)localToast('Positioned viewport')@@ -268,7 +307,7 @@ describe('@langgenius/dify-ui/toast', () => {})it('should mark overflow toasts as limited when the stack exceeds the configured limit', async () => {- const screen = await render(<ToastHost limit={1} />)+ const screen = await render(<ExampleToastHost manager={manager} limit={1} />)toast('First toast')toast('Second toast')@@ -278,7 +317,7 @@ describe('@langgenius/dify-ui/toast', () => {})it('should dismiss a toast when dismiss(id) is called', async () => {- const screen = await render(<ToastHost />)+ const screen = await render(<ExampleToastHost manager={manager} />)const toastId = toast('Closable', {description: 'This toast can be removed.',@@ -295,7 +334,7 @@ describe('@langgenius/dify-ui/toast', () => {it('should close a toast when the dismiss button is clicked', async () => {const onClose = vi.fn()- const screen = await render(<ToastHost />)+ const screen = await render(<ExampleToastHost manager={manager} />)toast('Dismiss me', {description: 'Manual dismissal path.',@@ -352,7 +391,7 @@ describe('@langgenius/dify-ui/toast', () => {>Underlying action</button>- <ToastHost />+ <ExampleToastHost manager={manager} /></>,)@@ -397,7 +436,7 @@ describe('@langgenius/dify-ui/toast', () => {})it('should pass the host timeout to added toasts', async () => {- const screen = await render(<ToastHost timeout={1000} />)+ const screen = await render(<ExampleToastHost manager={manager} timeout={1000} />)toast('Auto dismiss')await expect.element(screen.getByText('Auto dismiss')).toBeInTheDocument()@@ -413,7 +452,7 @@ describe('@langgenius/dify-ui/toast', () => {})it('should keep a toast persistent when its timeout is zero', async () => {- const screen = await render(<ToastHost timeout={1000} />)+ const screen = await render(<ExampleToastHost manager={manager} timeout={1000} />)toast('Persistent', {timeout: 0,@@ -426,7 +465,7 @@ describe('@langgenius/dify-ui/toast', () => {})it('should update an existing toast', async () => {- const screen = await render(<ToastHost />)+ const screen = await render(<ExampleToastHost manager={manager} />)const toastId = toast.info('Loading', {description: 'Preparing your data…',@@ -445,7 +484,7 @@ describe('@langgenius/dify-ui/toast', () => {})it('should upsert an existing toast when add is called with the same id', async () => {- const screen = await render(<ToastHost />)+ const screen = await render(<ExampleToastHost manager={manager} />)toast('Draft saving', {id: 'draft-save-status',@@ -468,7 +507,7 @@ describe('@langgenius/dify-ui/toast', () => {it('should render and invoke toast action props', async () => {const onAction = vi.fn()- const screen = await render(<ToastHost />)+ const screen = await render(<ExampleToastHost manager={manager} />)toast('Action toast', {actionProps: {@@ -484,7 +523,7 @@ describe('@langgenius/dify-ui/toast', () => {})it('should transition a promise toast from loading to success', async () => {- const screen = await render(<ToastHost />)+ const screen = await render(<ExampleToastHost manager={manager} />)let resolvePromise: ((value: string) => void) | undefinedconst promise = new Promise<string>((resolve) => {diff --git a/packages/dify-ui/src/toast/index.stories.tsx b/packages/dify-ui/src/toast/index.stories.tsxindex 2a5e480e0cb..331d05d550d 100644--- a/packages/dify-ui/src/toast/index.stories.tsx+++ b/packages/dify-ui/src/toast/index.stories.tsx@@ -1,9 +1,48 @@import type { Meta, StoryObj } from '@storybook/react-vite'+import type { ToastManager, ToastViewportProps } from '.'import * as React from 'react'import { expect, within } from 'storybook/test'-import { toast, ToastHost } from '.'+import {+ createToast,+ createToastManager,+ ToastCard,+ ToastPortal,+ ToastProvider,+ ToastViewport,+ useToastManager,+} from '.'import { Button } from '../button'+function ToastCards() {+ const { toasts } = useToastManager<Record<string, never>>()+ return toasts.map((item) => <ToastCard key={item.id} toast={item} />)+}++function ExampleToastHost({+ manager,+ timeout,+ limit,+ offset,+}: {+ manager: ToastManager+ timeout?: number+ limit?: number+ offset?: ToastViewportProps['offset']+}) {+ return (+ <ToastProvider toastManager={manager} timeout={timeout} limit={limit}>+ <ToastPortal>+ <ToastViewport offset={offset}>+ <ToastCards />+ </ToastViewport>+ </ToastPortal>+ </ToastProvider>+ )+}++const manager = createToastManager()+const toast = createToast(manager)+const longToastTitle ='operation error S3: PutObject, exceeded maximum number of attempts, 3, StatusCode: 0, RequestID: , HostID: , request send failed'const longToastDescription =@@ -329,7 +368,7 @@ const UpdateExamples = () => {const ToastDocsDemo = () => {return (<React.Fragment>- <ToastHost />+ <ExampleToastHost manager={manager} /><div className="min-h-screen bg-background-default-subtle px-6 py-12"><div className="mx-auto flex w-full max-w-6xl flex-col gap-8"><div className="space-y-3">diff --git a/packages/dify-ui/src/toast/index.tsx b/packages/dify-ui/src/toast/index.tsxindex c020fbd607a..b0b11616889 100644--- a/packages/dify-ui/src/toast/index.tsx+++ b/packages/dify-ui/src/toast/index.tsx@@ -79,13 +79,23 @@ type ToastPromiseOptions<Value> = {error: ToastPromiseResultOption<unknown>}-type ToastHostProps = {- timeout?: number- limit?: number- manager?: ToastManager+type ToastCardProps = {+ toast: ToastObject<ToastData>+ /** Additional content composed inside the card. */+ children?: React.ReactNode+}++type ToastViewportProps = {offset?: ToastHostOffset+ children: React.ReactNode}+const ToastProvider = BaseToast.Provider+type ToastProviderProps = BaseToast.Provider.Props+const ToastPortal = BaseToast.Portal+type ToastPortalProps = BaseToast.Portal.Props+const useToastManager = BaseToast.useToastManager+type ToastHostOffset = Pick<React.CSSProperties, 'top' | 'right'>type ToastDismiss = (toastId?: string) => void@@ -161,9 +171,6 @@ function createToastManager(): ToastManager {return BaseToast.createToastManager<ToastData>()}-const defaultToastManager = createToastManager()-const toast = createToast(defaultToastManager)-function ToastIcon({ type }: { type?: ToastRenderType }) {return type ? (<span aria-hidden="true" className={cn('h-5 w-5', TOAST_TONE_STYLES[type].iconClassName)} />@@ -175,7 +182,7 @@ function getToneGradientClasses(type?: ToastRenderType) {return 'from-background-default-subtle to-background-gradient-mask-transparent'}-function ToastCard({ toast: toastItem }: { toast: ToastObject<ToastData> }) {+function ToastCard({ toast: toastItem, children }: ToastCardProps) {const toastType = getToastRenderType(toastItem.type)return (@@ -183,7 +190,7 @@ function ToastCard({ toast: toastItem }: { toast: ToastObject<ToastData> }) {toast={toastItem}swipeDirection={['up', 'right']}className={cn(- 'pointer-events-auto absolute top-0 right-0 w-full origin-top cursor-default rounded-xl select-none focus-visible:ring-2 focus-visible:ring-state-accent-solid focus-visible:outline-hidden',+ 'group/toast pointer-events-auto absolute top-0 right-0 w-full origin-top cursor-default rounded-xl select-none focus-visible:ring-2 focus-visible:ring-state-accent-solid focus-visible:outline-hidden','[--toast-current-height:var(--toast-frontmost-height,var(--toast-height))] [--toast-expanded-offset-y:calc(var(--toast-offset-y)+var(--toast-swipe-movement-y)+(var(--toast-index)*var(--toast-gap)))] [--toast-gap:8px] [--toast-peek:5px] [--toast-scale:calc(1-(var(--toast-index)*0.0225))] [--toast-shrink:calc(1-var(--toast-scale))]','z-[calc(100-var(--toast-index))] h-(--toast-current-height)','[transition:transform_500ms_cubic-bezier(0.22,1,0.36,1),opacity_500ms,height_150ms] motion-reduce:transition-none',@@ -232,6 +239,7 @@ function ToastCard({ toast: toastItem }: { toast: ToastObject<ToastData> }) {</div>)}</div>+ {children}<div className="flex shrink-0 items-center justify-center rounded-md p-0.5"><BaseToast.Closearia-label={toastCloseLabel}@@ -249,32 +257,33 @@ function ToastCard({ toast: toastItem }: { toast: ToastObject<ToastData> }) {)}-function ToastViewport({ offset }: { offset?: ToastHostOffset }) {- const { toasts } = BaseToast.useToastManager<ToastData>()-+function ToastViewport({ offset, children }: ToastViewportProps) {return (<BaseToast.Viewportaria-label={toastViewportLabel}className="group/toast-viewport pointer-events-none fixed top-4 right-4 z-60 w-90 max-w-[calc(100vw-2rem)] overflow-visible sm:right-8"style={offset}>- {toasts.map((toastItem) => (- <ToastCard key={toastItem.id} toast={toastItem} />- ))}+ {children}</BaseToast.Viewport>)}-function ToastHost({ timeout, limit, manager = defaultToastManager, offset }: ToastHostProps) {- return (- <BaseToast.Provider toastManager={manager} timeout={timeout} limit={limit}>- <BaseToast.Portal>- <ToastViewport offset={offset} />- </BaseToast.Portal>- </BaseToast.Provider>- )+export {+ createToast,+ createToastManager,+ ToastCard,+ ToastPortal,+ ToastProvider,+ ToastViewport,+ useToastManager,}-export { createToast, createToastManager, toast, ToastHost }--export type { ToastHostProps }+export type {+ ToastApi,+ ToastCardProps,+ ToastManager,+ ToastPortalProps,+ ToastProviderProps,+ ToastViewportProps,+}diff --git a/web/.storybook/main.ts b/web/.storybook/main.tsindex e5bf0ee65e4..d493da8194b 100644--- a/web/.storybook/main.ts+++ b/web/.storybook/main.ts@@ -4,6 +4,7 @@ const config: StorybookConfig = {stories: ['../app/components/**/*.stories.@(js|jsx|mjs|ts|tsx)','../features/**/*.stories.@(js|jsx|mjs|ts|tsx)',+ '../app/notifications/**/*.stories.@(js|jsx|mjs|ts|tsx)',],addons: [// Not working with Storybook Vite frameworkdiff --git a/web/.storybook/preview.tsx b/web/.storybook/preview.tsxindex e1a1638437d..f91a9f14ba1 100644--- a/web/.storybook/preview.tsx+++ b/web/.storybook/preview.tsx@@ -1,8 +1,8 @@import type { Decorator, Preview } from '@storybook/react'import type { Resource } from 'i18next'-import { ToastHost } from '@langgenius/dify-ui/toast'import { withThemeByDataAttribute } from '@storybook/addon-themes'import { QueryClient, QueryClientProvider } from '@tanstack/react-query'+import { AppToastHost } from '@/app/notifications/host'import { I18nClientProvider as I18N } from '../app/components/provider/i18n'import commonEnUS from '../i18n/locales/en-US/common.json'import '../app/styles/markdown.css'@@ -38,7 +38,7 @@ export const decorators: Decorator[] = [<QueryClientProvider client={queryClient}><I18N locale="en-US" resource={storyResources}><>- <ToastHost />+ <AppToastHost /><Story /></></I18N>diff --git a/web/__tests__/billing/cloud-plan-payment-flow.test.tsx b/web/__tests__/billing/cloud-plan-payment-flow.test.tsxindex 6b2971465a2..66b2e54465f 100644--- a/web/__tests__/billing/cloud-plan-payment-flow.test.tsx+++ b/web/__tests__/billing/cloud-plan-payment-flow.test.tsx@@ -9,12 +9,13 @@*/import type { GetBillingSubscriptionData } from '@dify/contracts/api/console/billing/types.gen'import type { CloudPlan } from '@dify/contracts/api/console/features/types.gen'-import { toast, ToastHost } from '@langgenius/dify-ui/toast'import { cleanup, screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'import * as React from 'react'import { ALL_PLANS } from '@/app/components/billing/config'import { CloudPlanItem } from '@/app/components/billing/pricing/plans/cloud-plan-item'+import { toast } from '@/app/notifications'+import { AppToastHost } from '@/app/notifications/host'import { createConsoleQueryWrapper } from '@/test/console/query-data'import { render } from '@/test/console/render'@@ -86,7 +87,7 @@ const renderCloudPlanItem = ({const { wrapper } = createConsoleQueryWrapper()return render(<>- <ToastHost timeout={0} />+ <AppToastHost timeout={0} /><CloudPlanItemplan={plan}billingInterval={billingInterval}diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/__tests__/panel.spec.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/__tests__/panel.spec.tsxindex a70f7ab2be5..bf98481f13b 100644--- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/__tests__/panel.spec.tsx+++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/__tests__/panel.spec.tsx@@ -41,7 +41,7 @@ vi.mock('@/service/apps', () => ({updateTracingStatus: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: vi.fn(),}))diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/__tests__/provider-config-modal.spec.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/__tests__/provider-config-modal.spec.tsxindex 47880f0e3fd..c9adb3a699f 100644--- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/__tests__/provider-config-modal.spec.tsx+++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/__tests__/provider-config-modal.spec.tsx@@ -10,9 +10,9 @@ import type {TencentConfig,WeaveConfig,} from '../type'-import { toast } from '@langgenius/dify-ui/toast'import { render, screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'+import { toast } from '@/app/notifications'import { addTracingConfig, removeTracingConfig, updateTracingConfig } from '@/service/apps'import ConfigBtn from '../config-button'import ProviderConfigModal from '../provider-config-modal'@@ -24,7 +24,7 @@ vi.mock('@/service/apps', () => ({updateTracingConfig: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: vi.fn(),}))diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/panel.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/panel.tsxindex 7873d05e3a0..254eb41736c 100644--- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/panel.tsx+++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/panel.tsx@@ -16,7 +16,6 @@ import type {import type { TracingStatus } from '@/models/app'import { cn } from '@langgenius/dify-ui/cn'import { StatusDot } from '@langgenius/dify-ui/status-dot'-import { toast } from '@langgenius/dify-ui/toast'import { useSuspenseQuery } from '@tanstack/react-query'import { useBoolean } from 'ahooks'import { useAtomValue } from 'jotai'@@ -38,6 +37,7 @@ import {WeaveIcon,} from '@/app/components/base/icons/src/public/tracing'import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { userProfileQueryOptions } from '@/features/account-profile/client'import { usePathname } from '@/next/navigation'diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/provider-config-modal.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/provider-config-modal.tsxindex d2d05f8d898..a97de487bfc 100644--- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/provider-config-modal.tsx+++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/tracing/provider-config-modal.tsx@@ -23,7 +23,6 @@ import {} from '@langgenius/dify-ui/alert-dialog'import { Button } from '@langgenius/dify-ui/button'import { Dialog, DialogContent } from '@langgenius/dify-ui/dialog'-import { toast } from '@langgenius/dify-ui/toast'import { useBoolean } from 'ahooks'import * as React from 'react'import { useCallback, useState } from 'react'@@ -31,6 +30,7 @@ import { useTranslation } from 'react-i18next'import Divider from '@/app/components/base/divider'import { LinkExternal02 } from '@/app/components/base/icons/src/vender/line/general'import { Lock01 } from '@/app/components/base/icons/src/vender/solid/security'+import { toast } from '@/app/notifications'import { addTracingConfig, removeTracingConfig, updateTracingConfig } from '@/service/apps'import { docURL } from './config'import Field from './field'diff --git a/web/app/(shareLayout)/webapp-reset-password/check-code/page.tsx b/web/app/(shareLayout)/webapp-reset-password/check-code/page.tsxindex 9f7d89ca924..e8435f51d9d 100644--- a/web/app/(shareLayout)/webapp-reset-password/check-code/page.tsx+++ b/web/app/(shareLayout)/webapp-reset-password/check-code/page.tsx@@ -1,12 +1,12 @@'use client'import { Button } from '@langgenius/dify-ui/button'import { Input } from '@langgenius/dify-ui/input'-import { toast } from '@langgenius/dify-ui/toast'import { RiArrowLeftLine, RiMailSendFill } from '@remixicon/react'import { useState } from 'react'import { useTranslation } from 'react-i18next'import { useLocale } from '#i18n'import Countdown from '@/app/components/signin/countdown'+import { toast } from '@/app/notifications'import useDocumentTitle from '@/hooks/use-document-title'import { useRouter, useSearchParams } from '@/next/navigation'import { sendWebAppResetPasswordCode, verifyWebAppResetPasswordCode } from '@/service/common'diff --git a/web/app/(shareLayout)/webapp-reset-password/page.tsx b/web/app/(shareLayout)/webapp-reset-password/page.tsxindex 99449d9d568..7f98a682429 100644--- a/web/app/(shareLayout)/webapp-reset-password/page.tsx+++ b/web/app/(shareLayout)/webapp-reset-password/page.tsx@@ -1,13 +1,13 @@'use client'import { Button } from '@langgenius/dify-ui/button'import { Input } from '@langgenius/dify-ui/input'-import { toast } from '@langgenius/dify-ui/toast'import { RiArrowLeftLine, RiLockPasswordLine } from '@remixicon/react'import { noop } from 'es-toolkit/function'import { useState } from 'react'import { useTranslation } from 'react-i18next'import { useLocale } from '#i18n'import { COUNT_DOWN_TIME_MS, useSetCountdownLeftTime } from '@/app/components/signin/storage'+import { toast } from '@/app/notifications'import { emailRegex } from '@/config'import useDocumentTitle from '@/hooks/use-document-title'import Link from '@/next/link'diff --git a/web/app/(shareLayout)/webapp-reset-password/set-password/page.tsx b/web/app/(shareLayout)/webapp-reset-password/set-password/page.tsxindex 96ce4c1335e..03ee325dcfe 100644--- a/web/app/(shareLayout)/webapp-reset-password/set-password/page.tsx+++ b/web/app/(shareLayout)/webapp-reset-password/set-password/page.tsx@@ -5,11 +5,11 @@ import { Field, FieldDescription, FieldLabel } from '@langgenius/dify-ui/field'import { Form } from '@langgenius/dify-ui/form'import { IconButton } from '@langgenius/dify-ui/icon-button'import { InputGroup, InputGroupAddon, InputGroupInput } from '@langgenius/dify-ui/input-group'-import { toast } from '@langgenius/dify-ui/toast'import { RiCheckboxCircleFill } from '@remixicon/react'import { useCountDown } from 'ahooks'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { validPassword } from '@/config'import useDocumentTitle from '@/hooks/use-document-title'import Link from '@/next/link'diff --git a/web/app/(shareLayout)/webapp-signin/check-code/page.tsx b/web/app/(shareLayout)/webapp-signin/check-code/page.tsxindex e6a953db618..5d113736890 100644--- a/web/app/(shareLayout)/webapp-signin/check-code/page.tsx+++ b/web/app/(shareLayout)/webapp-signin/check-code/page.tsx@@ -2,7 +2,6 @@import type { FormEvent } from 'react'import { Button } from '@langgenius/dify-ui/button'import { Input } from '@langgenius/dify-ui/input'-import { toast } from '@langgenius/dify-ui/toast'import { useEffect, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import { useLocale } from '#i18n'@@ -11,6 +10,7 @@ import {resolveWebAppLoginRedirect,} from '@/app/(shareLayout)/webapp-signin/login-redirect'import Countdown from '@/app/components/signin/countdown'+import { toast } from '@/app/notifications'import { useWebAppStore } from '@/context/web-app-context'import { useRouter, useSearchParams } from '@/next/navigation'import { sendWebAppEMailLoginCode, webAppEmailLoginWithCode } from '@/service/common'diff --git a/web/app/(shareLayout)/webapp-signin/components/external-member-sso-auth.tsx b/web/app/(shareLayout)/webapp-signin/components/external-member-sso-auth.tsxindex b72d3fb3fcb..8e76fcd9d71 100644--- a/web/app/(shareLayout)/webapp-signin/components/external-member-sso-auth.tsx+++ b/web/app/(shareLayout)/webapp-signin/components/external-member-sso-auth.tsx@@ -1,12 +1,12 @@'use client'import { zSsoProtocol } from '@dify/contracts/api/console/system-features/zod.gen'-import { toast } from '@langgenius/dify-ui/toast'import { useSuspenseQuery } from '@tanstack/react-query'import * as React from 'react'import { useCallback, useEffect } from 'react'import { resolveWebAppLoginRedirect } from '@/app/(shareLayout)/webapp-signin/login-redirect'import AppUnavailable from '@/app/components/base/app-unavailable'import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder'+import { toast } from '@/app/notifications'import { systemFeaturesQueryOptions } from '@/features/system-features/client'import { useRouter, useSearchParams } from '@/next/navigation'import { fetchWebOAuth2SSOUrl, fetchWebOIDCSSOUrl, fetchWebSAMLSSOUrl } from '@/service/share'diff --git a/web/app/(shareLayout)/webapp-signin/components/mail-and-code-auth.tsx b/web/app/(shareLayout)/webapp-signin/components/mail-and-code-auth.tsxindex bb67ca8e891..ddbed90e7aa 100644--- a/web/app/(shareLayout)/webapp-signin/components/mail-and-code-auth.tsx+++ b/web/app/(shareLayout)/webapp-signin/components/mail-and-code-auth.tsx@@ -1,11 +1,11 @@import { Button } from '@langgenius/dify-ui/button'import { Input } from '@langgenius/dify-ui/input'-import { toast } from '@langgenius/dify-ui/toast'import { useEffect, useState } from 'react'import { useTranslation } from 'react-i18next'import { useLocale } from '#i18n'import { resolveWebAppLoginRedirect } from '@/app/(shareLayout)/webapp-signin/login-redirect'import { COUNT_DOWN_TIME_MS, useSetCountdownLeftTime } from '@/app/components/signin/storage'+import { toast } from '@/app/notifications'import { emailRegex } from '@/config'import { useRouter, useSearchParams } from '@/next/navigation'import { sendWebAppEMailLoginCode } from '@/service/common'diff --git a/web/app/(shareLayout)/webapp-signin/components/mail-and-password-auth.tsx b/web/app/(shareLayout)/webapp-signin/components/mail-and-password-auth.tsxindex 2fc180f80bb..1d3548a58c4 100644--- a/web/app/(shareLayout)/webapp-signin/components/mail-and-password-auth.tsx+++ b/web/app/(shareLayout)/webapp-signin/components/mail-and-password-auth.tsx@@ -5,13 +5,13 @@ import { Form } from '@langgenius/dify-ui/form'import { IconButton } from '@langgenius/dify-ui/icon-button'import { Input } from '@langgenius/dify-ui/input'import { InputGroup, InputGroupAddon, InputGroupInput } from '@langgenius/dify-ui/input-group'-import { toast } from '@langgenius/dify-ui/toast'import { useEffect, useState } from 'react'import { useTranslation } from 'react-i18next'import {navigateAfterWebAppLogin,resolveWebAppLoginRedirect,} from '@/app/(shareLayout)/webapp-signin/login-redirect'+import { toast } from '@/app/notifications'import { emailRegex } from '@/config'import { useWebAppStore } from '@/context/web-app-context'import Link from '@/next/link'diff --git a/web/app/(shareLayout)/webapp-signin/components/sso-auth.tsx b/web/app/(shareLayout)/webapp-signin/components/sso-auth.tsxindex 73cdffa360f..210a7077e31 100644--- a/web/app/(shareLayout)/webapp-signin/components/sso-auth.tsx+++ b/web/app/(shareLayout)/webapp-signin/components/sso-auth.tsx@@ -2,11 +2,11 @@import type { SsoProtocol } from '@dify/contracts/api/console/system-features/types.gen'import { zSsoProtocol } from '@dify/contracts/api/console/system-features/zod.gen'import { Button } from '@langgenius/dify-ui/button'-import { toast } from '@langgenius/dify-ui/toast'import { useEffect, useState } from 'react'import { useTranslation } from 'react-i18next'import { resolveWebAppLoginRedirect } from '@/app/(shareLayout)/webapp-signin/login-redirect'import { Lock01 } from '@/app/components/base/icons/src/vender/solid/security'+import { toast } from '@/app/notifications'import { useRouter, useSearchParams } from '@/next/navigation'import {fetchMembersOAuth2SSOUrl,diff --git a/web/app/account/(commonLayout)/account-page/AvatarWithEdit.tsx b/web/app/account/(commonLayout)/account-page/AvatarWithEdit.tsxindex bab0d50d9e4..243a7cd6293 100644--- a/web/app/account/(commonLayout)/account-page/AvatarWithEdit.tsx+++ b/web/app/account/(commonLayout)/account-page/AvatarWithEdit.tsx@@ -7,13 +7,13 @@ import type { ImageFile } from '@/types/app'import { Avatar } from '@langgenius/dify-ui/avatar'import { Button } from '@langgenius/dify-ui/button'import { Dialog, DialogContent } from '@langgenius/dify-ui/dialog'-import { toast } from '@langgenius/dify-ui/toast'import * as React from 'react'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'import ImageInput from '@/app/components/base/app-icon-picker/ImageInput'import Divider from '@/app/components/base/divider'import { useLocalFileUploader } from '@/app/components/base/image-uploader/hooks'+import { toast } from '@/app/notifications'import { DISABLE_UPLOAD_IMAGE_AS_ICON } from '@/config'import { updateUserProfile } from '@/service/common'import { createAvatarImageFile, createCroppedAvatarImage } from './avatar-image'diff --git a/web/app/account/(commonLayout)/account-page/email-change-modal.tsx b/web/app/account/(commonLayout)/account-page/email-change-modal.tsxindex 391a8d36281..5bf5cc29f3e 100644--- a/web/app/account/(commonLayout)/account-page/email-change-modal.tsx+++ b/web/app/account/(commonLayout)/account-page/email-change-modal.tsx@@ -4,11 +4,11 @@ import { Dialog, DialogContent, DialogTitle } from '@langgenius/dify-ui/dialog'import { Field, FieldError, FieldLabel } from '@langgenius/dify-ui/field'import { IconButton } from '@langgenius/dify-ui/icon-button'import { Input } from '@langgenius/dify-ui/input'-import { toast } from '@langgenius/dify-ui/toast'import { RiCloseLine } from '@remixicon/react'import { useDebounceFn } from 'ahooks'import { useCallback, useEffect, useRef, useState } from 'react'import { Trans, useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { useRouter } from '@/next/navigation'import { checkEmailExisted, resetEmail, sendVerifyCode, verifyEmail } from '@/service/common'import { useLogout } from '@/service/use-common'diff --git a/web/app/account/(commonLayout)/account-page/index.tsx b/web/app/account/(commonLayout)/account-page/index.tsxindex 6fa3ee3d882..51177d7de45 100644--- a/web/app/account/(commonLayout)/account-page/index.tsx+++ b/web/app/account/(commonLayout)/account-page/index.tsx@@ -8,13 +8,13 @@ import { Field, FieldLabel } from '@langgenius/dify-ui/field'import { IconButton } from '@langgenius/dify-ui/icon-button'import { Input } from '@langgenius/dify-ui/input'import { InputGroup, InputGroupAddon, InputGroupInput } from '@langgenius/dify-ui/input-group'-import { toast } from '@langgenius/dify-ui/toast'import { useQuery, useQueryClient, useSuspenseQuery } from '@tanstack/react-query'import { useId, useState } from 'react'import { useTranslation } from 'react-i18next'import AppIcon from '@/app/components/base/app-icon'import PremiumBadge from '@/app/components/base/premium-badge'import Collapse from '@/app/components/header/account-setting/collapse'+import { toast } from '@/app/notifications'import { validPassword } from '@/config'import { userProfileQueryOptions } from '@/features/account-profile/client'import { systemFeaturesQueryOptions } from '@/features/system-features/client'diff --git a/web/app/account/(commonLayout)/delete-account/components/__tests__/feed-back.spec.tsx b/web/app/account/(commonLayout)/delete-account/components/__tests__/feed-back.spec.tsxindex 6ee1deb284a..2a5649f7fff 100644--- a/web/app/account/(commonLayout)/delete-account/components/__tests__/feed-back.spec.tsx+++ b/web/app/account/(commonLayout)/delete-account/components/__tests__/feed-back.spec.tsx@@ -28,7 +28,7 @@ vi.mock('@/service/use-common', () => ({useLogout: () => ({ mutateAsync: mockLogout }),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: { info: vi.fn() },}))diff --git a/web/app/account/(commonLayout)/delete-account/components/feed-back.tsx b/web/app/account/(commonLayout)/delete-account/components/feed-back.tsxindex 8b40a65adec..754bd7285ad 100644--- a/web/app/account/(commonLayout)/delete-account/components/feed-back.tsx+++ b/web/app/account/(commonLayout)/delete-account/components/feed-back.tsx@@ -4,10 +4,10 @@ import { Dialog, DialogContent, DialogTitle } from '@langgenius/dify-ui/dialog'import { Field, FieldLabel } from '@langgenius/dify-ui/field'import { Form } from '@langgenius/dify-ui/form'import { Textarea } from '@langgenius/dify-ui/textarea'-import { toast } from '@langgenius/dify-ui/toast'import { useSuspenseQuery } from '@tanstack/react-query'import { useCallback } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { userProfileQueryOptions } from '@/features/account-profile/client'import { useRouter } from '@/next/navigation'import { useLogout } from '@/service/use-common'diff --git a/web/app/account/oauth/authorize/page.tsx b/web/app/account/oauth/authorize/page.tsxindex 410aff077c2..2f6ef347f92 100644--- a/web/app/account/oauth/authorize/page.tsx+++ b/web/app/account/oauth/authorize/page.tsx@@ -3,7 +3,6 @@import { Avatar } from '@langgenius/dify-ui/avatar'import { Button, buttonVariants } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import {RiAccountCircleLine,RiGlobalLine,@@ -16,6 +15,7 @@ import * as React from 'react'import { useTranslation } from 'react-i18next'import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder'import { useLanguage } from '@/app/components/header/account-setting/model-provider-page/hooks'+import { toast } from '@/app/notifications'import { isLegacyBase401, userProfileQueryOptions } from '@/features/account-profile/client'import useDocumentTitle from '@/hooks/use-document-title'import Link from '@/next/link'diff --git a/web/app/account/oauth/authorize/use-silent-authorize.ts b/web/app/account/oauth/authorize/use-silent-authorize.tsindex c967cd7cfa4..ad561b2e3f6 100644--- a/web/app/account/oauth/authorize/use-silent-authorize.ts+++ b/web/app/account/oauth/authorize/use-silent-authorize.ts@@ -1,10 +1,10 @@-import { toast } from '@langgenius/dify-ui/toast'import Cookies from 'js-cookie'import { useEffect, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import { flushRegistrationSuccess } from '@/app/components/base/amplitude/registration-tracking'import { flushEvents } from '@/app/components/base/amplitude/utils'import { reportOAuthRegistrationIfNewUser } from '@/app/components/oauth-registration-attribution'+import { toast } from '@/app/notifications'import { useRouter } from '@/next/navigation'export function buildReturnUrl(pathname: string, search: string) {diff --git a/web/app/components/app-sidebar/app-info/__tests__/use-app-info-actions.spec.ts b/web/app/components/app-sidebar/app-info/__tests__/use-app-info-actions.spec.tsindex a07aae99ba1..cf6b8161f60 100644--- a/web/app/components/app-sidebar/app-info/__tests__/use-app-info-actions.spec.ts+++ b/web/app/components/app-sidebar/app-info/__tests__/use-app-info-actions.spec.ts@@ -66,7 +66,7 @@ vi.mock('@/app/components/app/use-export-app-dsl', () => ({}),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: Object.assign(toastMocks.api, {success: vi.fn((message, options) => toastMocks.call({ type: 'success', message, ...options })),error: vi.fn((message, options) => toastMocks.call({ type: 'error', message, ...options })),diff --git a/web/app/components/app-sidebar/app-info/use-app-info-actions.ts b/web/app/components/app-sidebar/app-info/use-app-info-actions.tsindex 6936882a1b1..116c09ad12b 100644--- a/web/app/components/app-sidebar/app-info/use-app-info-actions.ts+++ b/web/app/components/app-sidebar/app-info/use-app-info-actions.ts@@ -6,12 +6,12 @@ import type { Dispatch, SetStateAction } from 'react'import type { DuplicateAppModalProps } from '@/app/components/app/duplicate-modal'import type { CreateAppModalProps } from '@/app/components/explore/create-app-modal'import type { App } from '@/types/app'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useQueryClient, useSuspenseQuery } from '@tanstack/react-query'import { useCallback, useEffect, useState } from 'react'import { useTranslation } from 'react-i18next'import { useStore as useAppStore } from '@/app/components/app/store'import { useExportAppDsl, useExportWorkflowAppDsl } from '@/app/components/app/use-export-app-dsl'+import { toast } from '@/app/notifications'import { systemFeaturesQueryOptions } from '@/features/system-features/client'import { useRouter } from '@/next/navigation'import {diff --git a/web/app/components/app-sidebar/dataset-info/__tests__/dropdown-callbacks.spec.tsx b/web/app/components/app-sidebar/dataset-info/__tests__/dropdown-callbacks.spec.tsxindex 86826918303..91cf28d2b56 100644--- a/web/app/components/app-sidebar/dataset-info/__tests__/dropdown-callbacks.spec.tsx+++ b/web/app/components/app-sidebar/dataset-info/__tests__/dropdown-callbacks.spec.tsx@@ -129,7 +129,7 @@ vi.mock('@/service/datasets', () => ({deleteDataset: (...args: unknown[]) => mockDeleteDataset(...args),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: (...args: unknown[]) => mockToast(...args),},diff --git a/web/app/components/app-sidebar/dataset-info/dropdown.tsx b/web/app/components/app-sidebar/dataset-info/dropdown.tsxindex bfefae17b7e..a1def0ee008 100644--- a/web/app/components/app-sidebar/dataset-info/dropdown.tsx+++ b/web/app/components/app-sidebar/dataset-info/dropdown.tsx@@ -17,12 +17,12 @@ import {DropdownMenuTrigger,} from '@langgenius/dify-ui/dropdown-menu'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { useSuspenseQuery } from '@tanstack/react-query'import { useAtomValue } from 'jotai'import * as React from 'react'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { useDatasetDetailContextWithSelector } from '@/context/dataset-detail'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { userProfileQueryOptions } from '@/features/account-profile/client'diff --git a/web/app/components/app-sidebar/snippet-info/__tests__/dropdown.spec.tsx b/web/app/components/app-sidebar/snippet-info/__tests__/dropdown.spec.tsxindex 801d831b6ec..5d921704730 100644--- a/web/app/components/app-sidebar/snippet-info/__tests__/dropdown.spec.tsx+++ b/web/app/components/app-sidebar/snippet-info/__tests__/dropdown.spec.tsx@@ -37,7 +37,7 @@ vi.mock('@/utils/download', () => ({downloadBlob: (args: { data: Blob; fileName: string }) => mockDownloadBlob(args),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: (...args: unknown[]) => mockToastSuccess(...args),error: (...args: unknown[]) => mockToastError(...args),diff --git a/web/app/components/app-sidebar/snippet-info/dropdown.tsx b/web/app/components/app-sidebar/snippet-info/dropdown.tsxindex c1f69f0ff93..6ddc0d0081d 100644--- a/web/app/components/app-sidebar/snippet-info/dropdown.tsx+++ b/web/app/components/app-sidebar/snippet-info/dropdown.tsx@@ -18,7 +18,6 @@ import {DropdownMenuTrigger,} from '@langgenius/dify-ui/dropdown-menu'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { useAtomValue } from 'jotai'import * as React from 'react'import { useTranslation } from 'react-i18next'@@ -27,6 +26,7 @@ import {canCreateAndModifySnippets,canManageSnippets,} from '@/app/components/snippets/utils/permission'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { useRouter } from '@/next/navigation'import {diff --git a/web/app/components/app/__tests__/use-export-app-dsl.spec.tsx b/web/app/components/app/__tests__/use-export-app-dsl.spec.tsxindex cd54f987bc9..8dd0e69a450 100644--- a/web/app/components/app/__tests__/use-export-app-dsl.spec.tsx+++ b/web/app/components/app/__tests__/use-export-app-dsl.spec.tsx@@ -34,7 +34,7 @@ vi.mock('@/utils/download', () => ({downloadBlob: mocks.downloadBlob,}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: mocks.toastError,promise: mocks.toastPromise,diff --git a/web/app/components/app/access-point/__tests__/environment-access-control.spec.tsx b/web/app/components/app/access-point/__tests__/environment-access-control.spec.tsxindex a3e5376086b..57f3405fe6d 100644--- a/web/app/components/app/access-point/__tests__/environment-access-control.spec.tsx+++ b/web/app/components/app/access-point/__tests__/environment-access-control.spec.tsx@@ -64,7 +64,7 @@ vi.mock('@/service/access-control', () => ({}),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: vi.fn(),success: vi.fn(),diff --git a/web/app/components/app/access-point/__tests__/environment-access-point-cards.spec.tsx b/web/app/components/app/access-point/__tests__/environment-access-point-cards.spec.tsxindex 210dd6b189a..fce4ff54df5 100644--- a/web/app/components/app/access-point/__tests__/environment-access-point-cards.spec.tsx+++ b/web/app/components/app/access-point/__tests__/environment-access-point-cards.spec.tsx@@ -1,8 +1,8 @@import type { ReactElement } from 'react'-import { toast } from '@langgenius/dify-ui/toast'import { QueryClientProvider } from '@tanstack/react-query'import { screen, waitFor, within } from '@testing-library/react'import userEvent from '@testing-library/user-event'+import { toast } from '@/app/notifications'import { render } from '@/test/console/render'import { createTestQueryClient } from '@/test/query-client'import { EnvironmentServiceApiCard } from '../deployed-environment-access-points/environment-service-api-card'@@ -105,7 +105,7 @@ vi.mock('@/app/components/app/access-point/shared/api-secret-key-button', () =>},}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: vi.fn(),success: vi.fn(),diff --git a/web/app/components/app/access-point/__tests__/mcp-card.spec.tsx b/web/app/components/app/access-point/__tests__/mcp-card.spec.tsxindex 2e47e1084bd..b272e10ed63 100644--- a/web/app/components/app/access-point/__tests__/mcp-card.spec.tsx+++ b/web/app/components/app/access-point/__tests__/mcp-card.spec.tsx@@ -1,9 +1,9 @@import type { AccessPointAppInfo, PublishedWorkflow } from '../shared/utils'-import { toast } from '@langgenius/dify-ui/toast'import { QueryClientProvider } from '@tanstack/react-query'import { screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { BlockEnum } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { render } from '@/test/console/render'import { createTestQueryClient } from '@/test/query-client'import { AppModeEnum } from '@/types/app'@@ -20,7 +20,7 @@ const mocks = vi.hoisted(() => ({updateServer: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: vi.fn(),success: vi.fn(),diff --git a/web/app/components/app/access-point/__tests__/service-api-card.spec.tsx b/web/app/components/app/access-point/__tests__/service-api-card.spec.tsxindex f317ef8880a..2f26c1af6bd 100644--- a/web/app/components/app/access-point/__tests__/service-api-card.spec.tsx+++ b/web/app/components/app/access-point/__tests__/service-api-card.spec.tsx@@ -1,9 +1,9 @@import type { AccessPointAppInfo } from '../shared/utils'-import { toast } from '@langgenius/dify-ui/toast'import { QueryClientProvider } from '@tanstack/react-query'import { screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { useStore as useAppStore } from '@/app/components/app/store'+import { toast } from '@/app/notifications'import { render } from '@/test/console/render'import { createTestQueryClient } from '@/test/query-client'import { AppModeEnum } from '@/types/app'@@ -14,7 +14,7 @@ const mocks = vi.hoisted(() => ({apiEnable: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: vi.fn(),success: vi.fn(),diff --git a/web/app/components/app/access-point/__tests__/trigger-card.spec.tsx b/web/app/components/app/access-point/__tests__/trigger-card.spec.tsxindex c07e7592f70..d4c78c09465 100644--- a/web/app/components/app/access-point/__tests__/trigger-card.spec.tsx+++ b/web/app/components/app/access-point/__tests__/trigger-card.spec.tsx@@ -1,9 +1,9 @@import type { AccessPointAppInfo } from '../shared/utils'import type { AppTrigger } from '@/service/use-tools'-import { toast } from '@langgenius/dify-ui/toast'import { QueryClientProvider } from '@tanstack/react-query'import { screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'+import { toast } from '@/app/notifications'import { render } from '@/test/console/render'import { createTestQueryClient } from '@/test/query-client'import { AppModeEnum } from '@/types/app'@@ -19,7 +19,7 @@ const mocks = vi.hoisted(() => ({updateTriggerStatus: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: vi.fn(),success: vi.fn(),diff --git a/web/app/components/app/access-point/__tests__/use-access-point-actions.spec.ts b/web/app/components/app/access-point/__tests__/use-access-point-actions.spec.tsindex b0b169bbc0b..711884b2afa 100644--- a/web/app/components/app/access-point/__tests__/use-access-point-actions.spec.ts+++ b/web/app/components/app/access-point/__tests__/use-access-point-actions.spec.ts@@ -11,7 +11,7 @@ const mocks = vi.hoisted(() => ({updateAppSiteConfig: vi.fn().mockResolvedValue({}),}))-vi.mock('@langgenius/dify-ui/toast', () => ({ toast: mocks.toast }))+vi.mock('@/app/notifications', () => ({ toast: mocks.toast }))vi.mock('@/app/components/app/store', () => ({useStore: (selector: (state: { setAppDetail: typeof mocks.setAppDetail }) => unknown) =>diff --git a/web/app/components/app/access-point/__tests__/web-app-card.spec.tsx b/web/app/components/app/access-point/__tests__/web-app-card.spec.tsxindex 4115a40e206..402b94c5476 100644--- a/web/app/components/app/access-point/__tests__/web-app-card.spec.tsx+++ b/web/app/components/app/access-point/__tests__/web-app-card.spec.tsx@@ -1,11 +1,11 @@import type { AccessPointAppInfo, PublishedWorkflow } from '../shared/utils'import type { InputVar, Node } from '@/app/components/workflow/types'-import { toast } from '@langgenius/dify-ui/toast'import { QueryClientProvider } from '@tanstack/react-query'import { screen, waitFor, within } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { useStore as useAppStore } from '@/app/components/app/store'import { BlockEnum, InputVarType } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { AccessMode } from '@/models/access-control'import { render } from '@/test/console/render'import { createTestQueryClient } from '@/test/query-client'@@ -18,7 +18,7 @@ const mocks = vi.hoisted(() => ({resetSiteAccessToken: vi.fn().mockResolvedValue({}),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: vi.fn(),success: vi.fn(),diff --git a/web/app/components/app/access-point/built-in-access-points/mcp-card.tsx b/web/app/components/app/access-point/built-in-access-points/mcp-card.tsxindex eff1bf597fe..59a754cc314 100644--- a/web/app/components/app/access-point/built-in-access-points/mcp-card.tsx+++ b/web/app/components/app/access-point/built-in-access-points/mcp-card.tsx@@ -11,7 +11,6 @@ import {AlertDialogTitle,} from '@langgenius/dify-ui/alert-dialog'import { Button } from '@langgenius/dify-ui/button'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation } from '@tanstack/react-query'import { useMemo, useState } from 'react'import { useTranslation } from 'react-i18next'@@ -19,6 +18,7 @@ import { AccessPointCard } from '@/app/components/base/access-point/card'import { AccessPointUrl } from '@/app/components/base/access-point/url'import MCPServerModal from '@/app/components/tools/mcp/mcp-server-modal'import { BlockEnum } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { consoleQuery } from '@/service/console'import {useInvalidateMCPServerDetail,diff --git a/web/app/components/app/access-point/built-in-access-points/service-api-card.tsx b/web/app/components/app/access-point/built-in-access-points/service-api-card.tsxindex 09f1506ce88..4b6fa613341 100644--- a/web/app/components/app/access-point/built-in-access-points/service-api-card.tsx+++ b/web/app/components/app/access-point/built-in-access-points/service-api-card.tsx@@ -2,11 +2,11 @@import type { AccessPointAppInfo } from '../shared/utils'import type { AccessPointAvailability } from '@/app/components/base/access-point/status'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation } from '@tanstack/react-query'import { useTranslation } from 'react-i18next'import { useStore as useAppStore } from '@/app/components/app/store'import { getAccessPointStatus } from '@/app/components/base/access-point/status'+import { toast } from '@/app/notifications'import { consoleQuery } from '@/service/console'import { ServiceApiCardView } from '../shared/service-api-card-view'import { getBuiltInAccessUrls } from '../shared/utils'diff --git a/web/app/components/app/access-point/built-in-access-points/trigger-card.tsx b/web/app/components/app/access-point/built-in-access-points/trigger-card.tsxindex a5850a1f8ca..5c46fac1ee6 100644--- a/web/app/components/app/access-point/built-in-access-points/trigger-card.tsx+++ b/web/app/components/app/access-point/built-in-access-points/trigger-card.tsx@@ -5,7 +5,6 @@ import type { TriggerWithProvider } from '@/app/components/workflow/block-selectimport type { AppTrigger } from '@/service/use-tools'import { StatusDot } from '@langgenius/dify-ui/status-dot'import { Switch } from '@langgenius/dify-ui/switch'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation } from '@tanstack/react-query'import { useEffect, useMemo } from 'react'import { useTranslation } from 'react-i18next'@@ -13,6 +12,7 @@ import { AccessPointCard, AccessPointEmptyContent } from '@/app/components/base/import BlockIcon from '@/app/components/workflow/block-icon'import { useTriggerStatusStore } from '@/app/components/workflow/store/trigger-status'import { BlockEnum } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { useDocLink } from '@/context/i18n'import Link from '@/next/link'import { consoleQuery } from '@/service/console'diff --git a/web/app/components/app/access-point/built-in-access-points/web-app-card.tsx b/web/app/components/app/access-point/built-in-access-points/web-app-card.tsxindex 6f7e09de87c..4b8d353990c 100644--- a/web/app/components/app/access-point/built-in-access-points/web-app-card.tsx+++ b/web/app/components/app/access-point/built-in-access-points/web-app-card.tsx@@ -14,7 +14,6 @@ import {AlertDialogTitle,} from '@langgenius/dify-ui/alert-dialog'import { Button } from '@langgenius/dify-ui/button'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation } from '@tanstack/react-query'import { useState } from 'react'import { useTranslation } from 'react-i18next'@@ -28,6 +27,7 @@ import { AccessPointCard } from '@/app/components/base/access-point/card'import { getAccessPointStatus } from '@/app/components/base/access-point/status'import { AccessPointUrl } from '@/app/components/base/access-point/url'import AppIcon from '@/app/components/base/app-icon'+import { toast } from '@/app/notifications'import { AccessMode } from '@/models/access-control'import { useAppWhiteListSubjects } from '@/service/access-control/use-app-access-control'import { consoleQuery } from '@/service/console'diff --git a/web/app/components/app/access-point/deployed-environment-access-points/environment-access-control.tsx b/web/app/components/app/access-point/deployed-environment-access-points/environment-access-control.tsxindex 3213bcb5afc..423d3b0cc2b 100644--- a/web/app/components/app/access-point/deployed-environment-access-points/environment-access-control.tsx+++ b/web/app/components/app/access-point/deployed-environment-access-points/environment-access-control.tsx@@ -6,11 +6,11 @@ import type {AccessControlSubjectsStatus,} from '@/app/components/app/app-access-control/specific-groups-or-members'import type { AccessControlAccount, AccessControlGroup } from '@/models/access-control'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useQuery, useQueryClient, useSuspenseQuery } from '@tanstack/react-query'import { useState } from 'react'import { useTranslation } from 'react-i18next'import { AccessControlForm } from '@/app/components/app/app-access-control/access-control-form'+import { toast } from '@/app/notifications'import { systemFeaturesQueryOptions } from '@/features/system-features/client'import { AccessMode, SubjectType } from '@/models/access-control'import { consoleQuery } from '@/service/console'diff --git a/web/app/components/app/access-point/deployed-environment-access-points/environment-service-api-card.tsx b/web/app/components/app/access-point/deployed-environment-access-points/environment-service-api-card.tsxindex bcc25889b07..02c3e01dde1 100644--- a/web/app/components/app/access-point/deployed-environment-access-points/environment-service-api-card.tsx+++ b/web/app/components/app/access-point/deployed-environment-access-points/environment-service-api-card.tsx@@ -1,9 +1,9 @@'use client'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useQuery } from '@tanstack/react-query'import { useTranslation } from 'react-i18next'import { useStore as useAppStore } from '@/app/components/app/store'+import { toast } from '@/app/notifications'import { consoleQuery } from '@/service/console'import { ServiceApiCardView } from '../shared/service-api-card-view'diff --git a/web/app/components/app/access-point/deployed-environment-access-points/environment-web-app-card.tsx b/web/app/components/app/access-point/deployed-environment-access-points/environment-web-app-card.tsxindex 0e8ce4ca6e6..95de24e62f8 100644--- a/web/app/components/app/access-point/deployed-environment-access-points/environment-web-app-card.tsx+++ b/web/app/components/app/access-point/deployed-environment-access-points/environment-web-app-card.tsx@@ -11,7 +11,6 @@ import {AlertDialogTitle,} from '@langgenius/dify-ui/alert-dialog'import { Button } from '@langgenius/dify-ui/button'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useQuery, useQueryClient, useSuspenseQuery } from '@tanstack/react-query'import { useState } from 'react'import { useTranslation } from 'react-i18next'@@ -21,6 +20,7 @@ import { useStore as useAppStore } from '@/app/components/app/store'import { AccessPointCard } from '@/app/components/base/access-point/card'import { AccessPointUrl } from '@/app/components/base/access-point/url'import AppIcon from '@/app/components/base/app-icon'+import { toast } from '@/app/notifications'import { systemFeaturesQueryOptions } from '@/features/system-features/client'import { AccessMode, isAccessMode } from '@/models/access-control'import { consoleQuery } from '@/service/console'diff --git a/web/app/components/app/access-point/shared/use-access-point-actions.ts b/web/app/components/app/access-point/shared/use-access-point-actions.tsindex eb82d3d5743..ed08627abb1 100644--- a/web/app/components/app/access-point/shared/use-access-point-actions.ts+++ b/web/app/components/app/access-point/shared/use-access-point-actions.ts@@ -3,11 +3,11 @@import type { ConfigParams } from '@/app/components/app/overview/settings'import type { App } from '@/types/app'import type { I18nKeysByPrefix } from '@/types/i18n'-import { toast } from '@langgenius/dify-ui/toast'import { useQueryClient } from '@tanstack/react-query'import { useCallback } from 'react'import { useTranslation } from 'react-i18next'import { useStore as useAppStore } from '@/app/components/app/store'+import { toast } from '@/app/notifications'import { fetchAppDetail, updateAppSiteConfig } from '@/service/apps'import { consoleQuery } from '@/service/console'import { asyncRunSafe } from '@/utils'diff --git a/web/app/components/app/annotation/__tests__/index.spec.tsx b/web/app/components/app/annotation/__tests__/index.spec.tsxindex 865196a19fb..06bd55a94c2 100644--- a/web/app/components/app/annotation/__tests__/index.spec.tsx+++ b/web/app/components/app/annotation/__tests__/index.spec.tsx@@ -2,9 +2,9 @@ import type { ReactElement } from 'react'import type { Mock } from 'vite-plus/test'import type { AnnotationItem } from '../type'import type { App } from '@/types/app'-import { toast } from '@langgenius/dify-ui/toast'import { act, fireEvent, screen, waitFor } from '@testing-library/react'import * as React from 'react'+import { toast } from '@/app/notifications'import {addAnnotation,delAnnotation,diff --git a/web/app/components/app/annotation/add-annotation-modal/__tests__/index.spec.tsx b/web/app/components/app/annotation/add-annotation-modal/__tests__/index.spec.tsxindex dfade0ee399..d53ae4f4746 100644--- a/web/app/components/app/annotation/add-annotation-modal/__tests__/index.spec.tsx+++ b/web/app/components/app/annotation/add-annotation-modal/__tests__/index.spec.tsx@@ -5,7 +5,7 @@ import { renderWithConsoleQuery } from '@/test/console/query-data'import AddAnnotationModal from '../index'const mockToastNotify = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({default: {notify: vi.fn((args) => mockToastNotify(args)),},diff --git a/web/app/components/app/annotation/add-annotation-modal/index.tsx b/web/app/components/app/annotation/add-annotation-modal/index.tsxindex f42400f84d0..5459b456b81 100644--- a/web/app/components/app/annotation/add-annotation-modal/index.tsx+++ b/web/app/components/app/annotation/add-annotation-modal/index.tsx@@ -13,13 +13,13 @@ import {DrawerTitle,DrawerViewport,} from '@langgenius/dify-ui/drawer'-import { toast } from '@langgenius/dify-ui/toast'import { useQuery } from '@tanstack/react-query'import { useAtomValue } from 'jotai'import * as React from 'react'import { useState } from 'react'import { useTranslation } from 'react-i18next'import AnnotationFull from '@/app/components/billing/annotation-full'+import { toast } from '@/app/notifications'import { deploymentEditionAtom } from '@/features/system-features/state'import { consoleQuery } from '@/service/console'import EditItem, { EditItemType } from './edit-item'diff --git a/web/app/components/app/annotation/batch-add-annotation-modal/__tests__/csv-uploader.spec.tsx b/web/app/components/app/annotation/batch-add-annotation-modal/__tests__/csv-uploader.spec.tsxindex 4ce407f3ca3..fb1f689757a 100644--- a/web/app/components/app/annotation/batch-add-annotation-modal/__tests__/csv-uploader.spec.tsx+++ b/web/app/components/app/annotation/batch-add-annotation-modal/__tests__/csv-uploader.spec.tsx@@ -10,7 +10,7 @@ const toastMocks = vi.hoisted(() => ({promise: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: (message: string, options?: Record<string, unknown>) =>toastMocks.notify({ type: 'success', message, ...options }),diff --git a/web/app/components/app/annotation/batch-add-annotation-modal/__tests__/index.spec.tsx b/web/app/components/app/annotation/batch-add-annotation-modal/__tests__/index.spec.tsxindex 7ecd4160d62..22744957f9c 100644--- a/web/app/components/app/annotation/batch-add-annotation-modal/__tests__/index.spec.tsx+++ b/web/app/components/app/annotation/batch-add-annotation-modal/__tests__/index.spec.tsx@@ -42,7 +42,7 @@ vi.mock('@/app/components/billing/annotation-full', () => ({}))const mockNotify = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({default: {notify: (args: unknown) => mockNotify(args),},diff --git a/web/app/components/app/annotation/batch-add-annotation-modal/csv-uploader.tsx b/web/app/components/app/annotation/batch-add-annotation-modal/csv-uploader.tsxindex 38eb1e4ae00..7388d5cea69 100644--- a/web/app/components/app/annotation/batch-add-annotation-modal/csv-uploader.tsx+++ b/web/app/components/app/annotation/batch-add-annotation-modal/csv-uploader.tsx@@ -2,12 +2,12 @@import type { FC } from 'react'import { Button } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { RiDeleteBinLine } from '@remixicon/react'import * as React from 'react'import { useEffect, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import { Csv as CSVIcon } from '@/app/components/base/icons/src/public/files'+import { toast } from '@/app/notifications'export type Props = Readonly<{file: File | undefineddiff --git a/web/app/components/app/annotation/batch-add-annotation-modal/index.tsx b/web/app/components/app/annotation/batch-add-annotation-modal/index.tsxindex ff4d2ba0242..4fb651b70e7 100644--- a/web/app/components/app/annotation/batch-add-annotation-modal/index.tsx+++ b/web/app/components/app/annotation/batch-add-annotation-modal/index.tsx@@ -2,7 +2,6 @@import type { FC } from 'react'import { Button } from '@langgenius/dify-ui/button'import { Dialog, DialogContent } from '@langgenius/dify-ui/dialog'-import { toast } from '@langgenius/dify-ui/toast'import { RiCloseLine } from '@remixicon/react'import { useQuery } from '@tanstack/react-query'import { useAtomValue } from 'jotai'@@ -10,6 +9,7 @@ import * as React from 'react'import { useEffect, useState } from 'react'import { useTranslation } from 'react-i18next'import AnnotationFull from '@/app/components/billing/annotation-full'+import { toast } from '@/app/notifications'import { deploymentEditionAtom } from '@/features/system-features/state'import { annotationBatchImport, checkAnnotationBatchImportProgress } from '@/service/annotation'import { consoleQuery } from '@/service/console'diff --git a/web/app/components/app/annotation/edit-annotation-modal/__tests__/index.spec.tsx b/web/app/components/app/annotation/edit-annotation-modal/__tests__/index.spec.tsxindex 7b2de8b4626..4030169a517 100644--- a/web/app/components/app/annotation/edit-annotation-modal/__tests__/index.spec.tsx+++ b/web/app/components/app/annotation/edit-annotation-modal/__tests__/index.spec.tsx@@ -1,6 +1,6 @@-import { toast } from '@langgenius/dify-ui/toast'import { render, screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'+import { toast } from '@/app/notifications'import EditAnnotationModal from '../index'const { mockEditAnnotation } = vi.hoisted(() => ({diff --git a/web/app/components/app/annotation/edit-annotation-modal/index.tsx b/web/app/components/app/annotation/edit-annotation-modal/index.tsxindex 67ab2207ee9..d3147815aba 100644--- a/web/app/components/app/annotation/edit-annotation-modal/index.tsx+++ b/web/app/components/app/annotation/edit-annotation-modal/index.tsx@@ -18,11 +18,11 @@ import {DrawerTitle,DrawerViewport,} from '@langgenius/dify-ui/drawer'-import { toast } from '@langgenius/dify-ui/toast'import * as React from 'react'import { useState } from 'react'import { useTranslation } from 'react-i18next'import { MessageCheckRemove } from '@/app/components/base/icons/src/vender/line/communication'+import { toast } from '@/app/notifications'import useTimestamp from '@/hooks/use-timestamp'import { editAnnotation } from '@/service/annotation'import EditItem, { EditItemType } from './edit-item'diff --git a/web/app/components/app/annotation/index.tsx b/web/app/components/app/annotation/index.tsxindex 1d41e9cec7e..01db0cb7a27 100644--- a/web/app/components/app/annotation/index.tsx+++ b/web/app/components/app/annotation/index.tsx@@ -8,7 +8,6 @@ import { cn } from '@langgenius/dify-ui/cn'import { IconButton } from '@langgenius/dify-ui/icon-button'import { Pagination } from '@langgenius/dify-ui/pagination'import { Switch } from '@langgenius/dify-ui/switch'-import { toast } from '@langgenius/dify-ui/toast'import { RiEqualizer2Line } from '@remixicon/react'import { useQuery } from '@tanstack/react-query'import { useDebounce } from 'ahooks'@@ -20,6 +19,7 @@ import ConfigParamModal from '@/app/components/base/features/new-feature-panel/aimport { MessageFast } from '@/app/components/base/icons/src/vender/solid/communication'import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder'import AnnotationFullModal from '@/app/components/billing/annotation-full/modal'+import { toast } from '@/app/notifications'import { APP_PAGE_LIMIT } from '@/config'import { useDocLink } from '@/context/i18n'import { deploymentEditionAtom } from '@/features/system-features/state'diff --git a/web/app/components/app/app-access-control/__tests__/index.spec.tsx b/web/app/components/app/app-access-control/__tests__/index.spec.tsxindex 5e41e3cd594..946ba118a9c 100644--- a/web/app/components/app/app-access-control/__tests__/index.spec.tsx+++ b/web/app/components/app/app-access-control/__tests__/index.spec.tsx@@ -1,8 +1,8 @@import type { ReactElement } from 'react'import type { App } from '@/types/app'-import { toast } from '@langgenius/dify-ui/toast'import { screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'+import { toast } from '@/app/notifications'import { AccessMode } from '@/models/access-control'import { renderWithConsoleQuery } from '@/test/console/query-data'import AccessControl from '../index'diff --git a/web/app/components/app/app-access-control/index.tsx b/web/app/components/app/app-access-control/index.tsxindex b6fddfe41d4..92216f70e0b 100644--- a/web/app/components/app/app-access-control/index.tsx+++ b/web/app/components/app/app-access-control/index.tsx@@ -6,10 +6,10 @@ import type {AccessControlSubjectsStatus,} from './specific-groups-or-members'import type { Subject } from '@/models/access-control'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useSuspenseQuery } from '@tanstack/react-query'import { useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { systemFeaturesQueryOptions } from '@/features/system-features/client'import { AccessMode, isAccessMode, SubjectType } from '@/models/access-control'import { useAppWhiteListSubjects } from '@/service/access-control'diff --git a/web/app/components/app/app-publisher/__tests__/index.spec.tsx b/web/app/components/app/app-publisher/__tests__/index.spec.tsxindex 3e9bbb4781f..a4adce4dcca 100644--- a/web/app/components/app/app-publisher/__tests__/index.spec.tsx+++ b/web/app/components/app/app-publisher/__tests__/index.spec.tsx@@ -160,7 +160,7 @@ vi.mock('@/context/permission-state', async () => {}))})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: (...args: unknown[]) => mockToastError(...args),success: (...args: unknown[]) => mockToastSuccess(...args),diff --git a/web/app/components/app/app-publisher/__tests__/version-info-modal.spec.tsx b/web/app/components/app/app-publisher/__tests__/version-info-modal.spec.tsxindex 44c99cc2f29..24697749f7a 100644--- a/web/app/components/app/app-publisher/__tests__/version-info-modal.spec.tsx+++ b/web/app/components/app/app-publisher/__tests__/version-info-modal.spec.tsx@@ -1,8 +1,8 @@-import { toast } from '@langgenius/dify-ui/toast'import { fireEvent, render, screen } from '@testing-library/react'+import { toast } from '@/app/notifications'import VersionInfoModal from '../version-info-modal'-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: vi.fn(),},diff --git a/web/app/components/app/app-publisher/publisher-content/use-marketplace-publish.ts b/web/app/components/app/app-publisher/publisher-content/use-marketplace-publish.tsindex 740ee176c65..2ccdd0c4424 100644--- a/web/app/components/app/app-publisher/publisher-content/use-marketplace-publish.ts+++ b/web/app/components/app/app-publisher/publisher-content/use-marketplace-publish.ts@@ -1,6 +1,6 @@-import { toast } from '@langgenius/dify-ui/toast'import { useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { publishToCreatorsPlatform } from '@/service/apps'export function useMarketplacePublish(appId?: string) {diff --git a/web/app/components/app/app-publisher/publisher-content/use-version-info.ts b/web/app/components/app/app-publisher/publisher-content/use-version-info.tsindex 25f2ee00cba..6e722b96ea0 100644--- a/web/app/components/app/app-publisher/publisher-content/use-version-info.ts+++ b/web/app/components/app/app-publisher/publisher-content/use-version-info.ts@@ -1,8 +1,8 @@import type { WorkflowResponse } from '@dify/contracts/api/console/apps/types.gen'import type { AppModeEnum } from '@/types/app'-import { toast } from '@langgenius/dify-ui/toast'import { useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { useInvalidateAppWorkflow, useUpdateWorkflow } from '@/service/use-workflow'type VersionInfoUpdate = {diff --git a/web/app/components/app/app-publisher/version-info-modal.tsx b/web/app/components/app/app-publisher/version-info-modal.tsxindex 01120b0a44d..8a806e08d8d 100644--- a/web/app/components/app/app-publisher/version-info-modal.tsx+++ b/web/app/components/app/app-publisher/version-info-modal.tsx@@ -5,9 +5,9 @@ import { Dialog, DialogContent } from '@langgenius/dify-ui/dialog'import { Field, FieldLabel } from '@langgenius/dify-ui/field'import { Input } from '@langgenius/dify-ui/input'import { Textarea } from '@langgenius/dify-ui/textarea'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'type VersionInfoModalProps = {isOpen: booleandiff --git a/web/app/components/app/configuration/__tests__/index.spec.tsx b/web/app/components/app/configuration/__tests__/index.spec.tsxindex 049a70c11de..3847c2f5535 100644--- a/web/app/components/app/configuration/__tests__/index.spec.tsx+++ b/web/app/components/app/configuration/__tests__/index.spec.tsx@@ -1,5 +1,5 @@-import { ToastHost } from '@langgenius/dify-ui/toast'import { act, render, screen } from '@testing-library/react'+import { AppToastHost } from '@/app/notifications/host'import Configuration from '../index'import { toast } from '../toast'@@ -23,7 +23,7 @@ describe('Configuration', () => {it('should render configuration notifications in its offset viewport', async () => {render(<>- <ToastHost />+ <AppToastHost /><Configuration /></>,)diff --git a/web/app/components/app/configuration/index.tsx b/web/app/components/app/configuration/index.tsxindex 2dadd0373e3..c88bb02cd2b 100644--- a/web/app/components/app/configuration/index.tsx+++ b/web/app/components/app/configuration/index.tsx@@ -1,6 +1,6 @@'use client'-import { ToastHost } from '@langgenius/dify-ui/toast'import * as React from 'react'+import { AppToastHost } from '@/app/notifications/host'import ConfigurationView from './configuration-view'import { useConfiguration } from './hooks/use-configuration'import { appConfigurationToastManager } from './toast'@@ -9,7 +9,7 @@ const Configuration = () => {const viewModel = useConfiguration()return (<>- <ToastHost manager={appConfigurationToastManager} offset={{ top: 60 }} />+ <AppToastHost manager={appConfigurationToastManager} offset={{ top: 60 }} /><ConfigurationView {...viewModel} /></>)diff --git a/web/app/components/app/configuration/toast.ts b/web/app/components/app/configuration/toast.tsindex f1e64bbc1f8..35678e9c205 100644--- a/web/app/components/app/configuration/toast.ts+++ b/web/app/components/app/configuration/toast.ts@@ -2,7 +2,5 @@import { createToast, createToastManager } from '@langgenius/dify-ui/toast'-const appConfigurationToastManager = createToastManager()-const toast = createToast(appConfigurationToastManager)--export { appConfigurationToastManager, toast }+export const appConfigurationToastManager = createToastManager()+export const toast = createToast(appConfigurationToastManager)diff --git a/web/app/components/app/create-app-dialog/app-list/__tests__/index.spec.tsx b/web/app/components/app/create-app-dialog/app-list/__tests__/index.spec.tsxindex 773b5fad799..4ebf8d9aaaa 100644--- a/web/app/components/app/create-app-dialog/app-list/__tests__/index.spec.tsx+++ b/web/app/components/app/create-app-dialog/app-list/__tests__/index.spec.tsx@@ -122,7 +122,7 @@ vi.mock('@/app/components/explore/create-app-modal', () => ({</div>) : null,}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: (...args: unknown[]) => mockToastSuccess(...args),error: (...args: unknown[]) => mockToastError(...args),diff --git a/web/app/components/app/create-app-dialog/app-list/index.tsx b/web/app/components/app/create-app-dialog/app-list/index.tsxindex a3915247047..5d7e5207c5e 100644--- a/web/app/components/app/create-app-dialog/app-list/index.tsx+++ b/web/app/components/app/create-app-dialog/app-list/index.tsx@@ -5,7 +5,6 @@ import type { App } from '@/models/explore'import { cn } from '@langgenius/dify-ui/cn'import { IconButton } from '@langgenius/dify-ui/icon-button'import { InputGroup, InputGroupAddon, InputGroupInput } from '@langgenius/dify-ui/input-group'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useSuspenseQuery } from '@tanstack/react-query'import { useDebouncedValue } from 'foxact/use-debounced-value'import { useAtomValue } from 'jotai'@@ -17,6 +16,7 @@ import Divider from '@/app/components/base/divider'import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder'import CreateAppModal from '@/app/components/explore/create-app-modal'import { usePluginDependencies } from '@/app/components/workflow/plugin-dependency/hooks'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { userProfileQueryOptions } from '@/features/account-profile/client'import { systemFeaturesQueryOptions } from '@/features/system-features/client'diff --git a/web/app/components/app/create-app-modal/__tests__/index.spec.tsx b/web/app/components/app/create-app-modal/__tests__/index.spec.tsxindex 68af8670fe4..9f011a711de 100644--- a/web/app/components/app/create-app-modal/__tests__/index.spec.tsx+++ b/web/app/components/app/create-app-modal/__tests__/index.spec.tsx@@ -73,7 +73,7 @@ const toastMocks = vi.hoisted(() => ({mockToastSuccess: vi.fn(),mockToastError: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: toastMocks.mockToastSuccess,error: toastMocks.mockToastError,diff --git a/web/app/components/app/create-app-modal/index.tsx b/web/app/components/app/create-app-modal/index.tsxindex 47f2810f4ea..24dafa3d8d8 100644--- a/web/app/components/app/create-app-modal/index.tsx+++ b/web/app/components/app/create-app-modal/index.tsx@@ -8,7 +8,6 @@ import { cn } from '@langgenius/dify-ui/cn'import { Input } from '@langgenius/dify-ui/input'import { Kbd, KbdGroup } from '@langgenius/dify-ui/kbd'import { Textarea } from '@langgenius/dify-ui/textarea'-import { toast } from '@langgenius/dify-ui/toast'import { formatForDisplay, useHotkey } from '@tanstack/react-hotkeys'import { useMutation, useQuery, useSuspenseQuery } from '@tanstack/react-query'import { useDebounceFn } from 'ahooks'@@ -18,6 +17,7 @@ import { useTranslation } from 'react-i18next'import AppIcon from '@/app/components/base/app-icon'import Divider from '@/app/components/base/divider'import AppsFull from '@/app/components/billing/apps-full-in-dialog'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { userProfileQueryOptions } from '@/features/account-profile/client'import { systemFeaturesQueryOptions } from '@/features/system-features/client'diff --git a/web/app/components/app/create-from-dsl-modal/__tests__/index.spec.tsx b/web/app/components/app/create-from-dsl-modal/__tests__/index.spec.tsxindex fc0af74cfae..6b4b9bc4c3d 100644--- a/web/app/components/app/create-from-dsl-modal/__tests__/index.spec.tsx+++ b/web/app/components/app/create-from-dsl-modal/__tests__/index.spec.tsx@@ -132,7 +132,7 @@ vi.mock('@/utils/imported-app-redirection', () => ({mockResolveImportedAppRedirectionTarget(target),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: Object.assign((...args: unknown[]) => toastMocks.call(...args), {success: (...args: unknown[]) => toastMocks.success(...args),error: (...args: unknown[]) => toastMocks.error(...args),diff --git a/web/app/components/app/create-from-dsl-modal/__tests__/uploader.spec.tsx b/web/app/components/app/create-from-dsl-modal/__tests__/uploader.spec.tsxindex 97e2b364f11..2d4084445bd 100644--- a/web/app/components/app/create-from-dsl-modal/__tests__/uploader.spec.tsx+++ b/web/app/components/app/create-from-dsl-modal/__tests__/uploader.spec.tsx@@ -1,10 +1,10 @@-import { toast } from '@langgenius/dify-ui/toast'import { fireEvent, render, screen } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { useState } from 'react'+import { toast } from '@/app/notifications'import { Uploader } from '../uploader'-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: vi.fn(),},diff --git a/web/app/components/app/create-from-dsl-modal/index.tsx b/web/app/components/app/create-from-dsl-modal/index.tsxindex 95a0cdf0ba1..26819825675 100644--- a/web/app/components/app/create-from-dsl-modal/index.tsx+++ b/web/app/components/app/create-from-dsl-modal/index.tsx@@ -17,7 +17,6 @@ import { IconButton } from '@langgenius/dify-ui/icon-button'import { Input } from '@langgenius/dify-ui/input'import { Kbd, KbdGroup } from '@langgenius/dify-ui/kbd'import { Tabs, TabsList, TabsPanel, TabsTab } from '@langgenius/dify-ui/tabs'-import { toast } from '@langgenius/dify-ui/toast'import { formatForDisplay, useHotkey } from '@tanstack/react-hotkeys'import { useMutation, useQuery, useSuspenseQuery } from '@tanstack/react-query'import { useAtomValue } from 'jotai'@@ -25,6 +24,7 @@ import { useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import AppsFull from '@/app/components/billing/apps-full-in-dialog'import { usePluginDependencies } from '@/app/components/workflow/plugin-dependency/hooks'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { userProfileQueryOptions } from '@/features/account-profile/client'import { systemFeaturesQueryOptions } from '@/features/system-features/client'diff --git a/web/app/components/app/create-from-dsl-modal/uploader.tsx b/web/app/components/app/create-from-dsl-modal/uploader.tsxindex 448e07ed7e5..2223d64578f 100644--- a/web/app/components/app/create-from-dsl-modal/uploader.tsx+++ b/web/app/components/app/create-from-dsl-modal/uploader.tsx@@ -3,9 +3,9 @@ import type { ChangeEvent, DragEvent, MouseEvent, RefObject } from 'react'import { Button } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { useId, useLayoutEffect, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { formatFileSize } from '@/utils/format'type Props = Readonly<{diff --git a/web/app/components/app/deploy/__tests__/index.spec.tsx b/web/app/components/app/deploy/__tests__/index.spec.tsxindex 4df3f221db9..83851c64d24 100644--- a/web/app/components/app/deploy/__tests__/index.spec.tsx+++ b/web/app/components/app/deploy/__tests__/index.spec.tsx@@ -19,9 +19,9 @@ import {PluginCategory,RuntimeState,} from '@dify/contracts/enterprise-app-deploy/types.gen'-import { toast } from '@langgenius/dify-ui/toast'import { act, screen, waitFor, within } from '@testing-library/react'import userEvent from '@testing-library/user-event'+import { toast } from '@/app/notifications'import { consoleQuery } from '@/service/console'import {appWorkflowQueryOptions,@@ -852,7 +852,7 @@ vi.mock('#i18n', async (importOriginal) => ({useLocale: () => 'en-US',}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: vi.fn(),},diff --git a/web/app/components/app/deploy/environment-table/row-actions.tsx b/web/app/components/app/deploy/environment-table/row-actions.tsxindex 976807ceab1..5fa3f678454 100644--- a/web/app/components/app/deploy/environment-table/row-actions.tsx+++ b/web/app/components/app/deploy/environment-table/row-actions.tsx@@ -12,10 +12,10 @@ import {DropdownMenuTrigger,} from '@langgenius/dify-ui/dropdown-menu'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { Fragment, useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'import { getWorkflowVersionName } from '@/app/components/workflow/utils/version'+import { toast } from '@/app/notifications'import { getEnvironmentDeploymentActions } from '../utils/environment-deployment'import { UndeployConfirmDialog } from './undeploy-confirm-dialog'diff --git a/web/app/components/app/deploy/hooks/use-undeploy-workflow.ts b/web/app/components/app/deploy/hooks/use-undeploy-workflow.tsindex 7666906fd34..07a7e02fbb0 100644--- a/web/app/components/app/deploy/hooks/use-undeploy-workflow.ts+++ b/web/app/components/app/deploy/hooks/use-undeploy-workflow.ts@@ -1,10 +1,10 @@'use client'import type { EnvironmentDeployment } from '@dify/contracts/enterprise-app-deploy/types.gen'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation } from '@tanstack/react-query'import { useCallback } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { consoleQuery } from '@/service/console'export function useUndeployWorkflow(appId: string) {diff --git a/web/app/components/app/deploy/shared/deployment-configuration/use-deployment-configuration-form.ts b/web/app/components/app/deploy/shared/deployment-configuration/use-deployment-configuration-form.tsindex baa4388d5f1..c2b6efc7c2c 100644--- a/web/app/components/app/deploy/shared/deployment-configuration/use-deployment-configuration-form.ts+++ b/web/app/components/app/deploy/shared/deployment-configuration/use-deployment-configuration-form.ts@@ -3,8 +3,8 @@import type { FormEventHandler } from 'react'import type { DeploymentConfigurationQueryState } from './use-deployment-configuration-queries'import type { DeploymentConfigurationValuesController } from './use-deployment-configuration-values'-import { toast } from '@langgenius/dify-ui/toast'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { useDeployWorkflow } from '../../hooks/use-deploy-workflow'import {credentialProviderName,diff --git a/web/app/components/app/duplicate-modal/__tests__/index.spec.tsx b/web/app/components/app/duplicate-modal/__tests__/index.spec.tsxindex f36ee285ac1..081afa0339e 100644--- a/web/app/components/app/duplicate-modal/__tests__/index.spec.tsx+++ b/web/app/components/app/duplicate-modal/__tests__/index.spec.tsx@@ -14,7 +14,7 @@ const { mockAppQuota, toastErrorMock } = vi.hoisted(() => ({toastErrorMock: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: (...args: unknown[]) => toastErrorMock(...args),},diff --git a/web/app/components/app/duplicate-modal/index.tsx b/web/app/components/app/duplicate-modal/index.tsxindex 85e6cab976b..2f31e1adb21 100644--- a/web/app/components/app/duplicate-modal/index.tsx+++ b/web/app/components/app/duplicate-modal/index.tsx@@ -5,7 +5,6 @@ import { Dialog, DialogContent, DialogTitle } from '@langgenius/dify-ui/dialog'import { Field, FieldLabel } from '@langgenius/dify-ui/field'import { IconButton } from '@langgenius/dify-ui/icon-button'import { Input } from '@langgenius/dify-ui/input'-import { toast } from '@langgenius/dify-ui/toast'import { useQuery } from '@tanstack/react-query'import { useAtomValue } from 'jotai'import * as React from 'react'@@ -13,6 +12,7 @@ import { useState } from 'react'import { useTranslation } from 'react-i18next'import AppIcon from '@/app/components/base/app-icon'import AppsFull from '@/app/components/billing/apps-full-in-dialog'+import { toast } from '@/app/notifications'import { deploymentEditionAtom } from '@/features/system-features/state'import { consoleQuery } from '@/service/console'import AppIconPicker from '../../base/app-icon-picker'diff --git a/web/app/components/app/log/list.tsx b/web/app/components/app/log/list.tsxindex 758229d009e..790f928229c 100644--- a/web/app/components/app/log/list.tsx+++ b/web/app/components/app/log/list.tsx@@ -30,7 +30,6 @@ import {} from '@langgenius/dify-ui/drawer'import { IconButton } from '@langgenius/dify-ui/icon-button'import { StatusDot } from '@langgenius/dify-ui/status-dot'-import { toast } from '@langgenius/dify-ui/toast'import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'import { RiCloseLine, RiEditFill } from '@remixicon/react'import { useQuery } from '@tanstack/react-query'@@ -52,6 +51,7 @@ import CopyIcon from '@/app/components/base/copy-icon'import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder'import MessageLogModal from '@/app/components/base/message-log-modal'import { WorkflowContextProvider } from '@/app/components/workflow/context'+import { toast } from '@/app/notifications'import { userProfileQueryOptions } from '@/features/account-profile/client'import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints'import useTimestamp from '@/hooks/use-timestamp'diff --git a/web/app/components/app/overview/settings/__tests__/index.spec.tsx b/web/app/components/app/overview/settings/__tests__/index.spec.tsxindex 71683d3d37f..e5fce70fcbc 100644--- a/web/app/components/app/overview/settings/__tests__/index.spec.tsx+++ b/web/app/components/app/overview/settings/__tests__/index.spec.tsx@@ -44,7 +44,7 @@ const toastMocks = vi.hoisted(() => ({promise: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: Object.assign(toastMocks.call, {success: vi.fn((message: string, options?: Record<string, unknown>) =>toastMocks.call({ type: 'success', message, ...options }),diff --git a/web/app/components/app/overview/settings/index.tsx b/web/app/components/app/overview/settings/index.tsxindex 00a1b78214c..2ecfba0aec1 100644--- a/web/app/components/app/overview/settings/index.tsx+++ b/web/app/components/app/overview/settings/index.tsx@@ -27,7 +27,6 @@ import {} from '@langgenius/dify-ui/select'import { Switch } from '@langgenius/dify-ui/switch'import { Textarea } from '@langgenius/dify-ui/textarea'-import { toast } from '@langgenius/dify-ui/toast'import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'import { useQuery } from '@tanstack/react-query'import { useAtomValue } from 'jotai'@@ -43,6 +42,7 @@ import {pricingQueryParamName,pricingQueryParser,} from '@/app/components/billing/pricing/query-params'+import { toast } from '@/app/notifications'import { deploymentEditionAtom } from '@/features/system-features/state'import { languages } from '@/i18n/language'import Link from '@/next/link'diff --git a/web/app/components/app/switch-app-modal/__tests__/index.spec.tsx b/web/app/components/app/switch-app-modal/__tests__/index.spec.tsxindex 35f7a381bef..9ce404cad91 100644--- a/web/app/components/app/switch-app-modal/__tests__/index.spec.tsx+++ b/web/app/components/app/switch-app-modal/__tests__/index.spec.tsx@@ -102,7 +102,7 @@ const toastMocks = vi.hoisted(() => ({promise: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: (message: string, options?: Record<string, unknown>) =>toastMocks.notify({ type: 'success', message, ...options }),diff --git a/web/app/components/app/switch-app-modal/index.tsx b/web/app/components/app/switch-app-modal/index.tsxindex ba56025dbf8..c70a90a57e0 100644--- a/web/app/components/app/switch-app-modal/index.tsx+++ b/web/app/components/app/switch-app-modal/index.tsx@@ -16,13 +16,13 @@ import { Checkbox } from '@langgenius/dify-ui/checkbox'import { cn } from '@langgenius/dify-ui/cn'import { Dialog, DialogContent } from '@langgenius/dify-ui/dialog'import { Input } from '@langgenius/dify-ui/input'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useQuery, useSuspenseQuery } from '@tanstack/react-query'import { useId, useState } from 'react'import { useTranslation } from 'react-i18next'import { useStore as useAppStore } from '@/app/components/app/store'import AppIcon from '@/app/components/base/app-icon'import AppsFull from '@/app/components/billing/apps-full-in-dialog'+import { toast } from '@/app/notifications'import { systemFeaturesQueryOptions } from '@/features/system-features/client'import { useRouter } from '@/next/navigation'import { consoleQuery } from '@/service/console'diff --git a/web/app/components/app/text-generate/item/__tests__/action-groups.spec.tsx b/web/app/components/app/text-generate/item/__tests__/action-groups.spec.tsxindex 775f0e3cc57..d32565093a4 100644--- a/web/app/components/app/text-generate/item/__tests__/action-groups.spec.tsx+++ b/web/app/components/app/text-generate/item/__tests__/action-groups.spec.tsx@@ -14,7 +14,7 @@ vi.mock('copy-to-clipboard', () => ({default: (...args: unknown[]) => mockCopy(...args),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: (...args: unknown[]) => mockSuccess(...args),},diff --git a/web/app/components/app/text-generate/item/__tests__/index.spec.tsx b/web/app/components/app/text-generate/item/__tests__/index.spec.tsxindex 8b1f7b35110..45f153f997e 100644--- a/web/app/components/app/text-generate/item/__tests__/index.spec.tsx+++ b/web/app/components/app/text-generate/item/__tests__/index.spec.tsx@@ -56,7 +56,7 @@ vi.mock('@/app/components/base/markdown', () => ({Markdown: ({ content }: { content: string }) => <div>{`markdown:${content}`}</div>,}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {warning: (...args: unknown[]) => mockToastWarning(...args),success: vi.fn(),diff --git a/web/app/components/app/text-generate/item/action-groups.tsx b/web/app/components/app/text-generate/item/action-groups.tsxindex b07a224ba59..1c16273a321 100644--- a/web/app/components/app/text-generate/item/action-groups.tsx+++ b/web/app/components/app/text-generate/item/action-groups.tsx@@ -4,11 +4,11 @@ import type { FeedbackType } from '@/app/components/base/chat/chat/type'import type { WorkflowProcess } from '@/app/components/base/chat/types'import type { AppSourceType } from '@/service/share'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { Toggle } from '@langgenius/dify-ui/toggle'import copy from 'copy-to-clipboard'import { useTranslation } from 'react-i18next'import NewAudioButton from '@/app/components/base/new-audio-button'+import { toast } from '@/app/notifications'import { AppSourceType as AppSourceTypeEnum } from '@/service/share'import { getCopyContent, MAX_GENERATION_DEPTH } from './utils'diff --git a/web/app/components/app/text-generate/item/index.tsx b/web/app/components/app/text-generate/item/index.tsxindex da2c0683474..7541f973c6c 100644--- a/web/app/components/app/text-generate/item/index.tsx+++ b/web/app/components/app/text-generate/item/index.tsx@@ -5,7 +5,6 @@ import type { FeedbackType } from '@/app/components/base/chat/chat/type'import type { WorkflowProcess } from '@/app/components/base/chat/types'import type { SiteInfo } from '@/models/share'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { RiPlayList2Line, RiSparklingFill } from '@remixicon/react'import { useBoolean } from 'ahooks'import * as React from 'react'@@ -15,6 +14,7 @@ import { useStore as useAppStore } from '@/app/components/app/store'import { useChatContext } from '@/app/components/base/chat/chat/context'import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder'import { Markdown } from '@/app/components/base/markdown'+import { toast } from '@/app/notifications'import { useParams } from '@/next/navigation'import { fetchTextGenerationMessage } from '@/service/debug'import {diff --git a/web/app/components/app/text-generate/saved-items/__tests__/index.spec.tsx b/web/app/components/app/text-generate/saved-items/__tests__/index.spec.tsxindex d48f2ea8905..93863263268 100644--- a/web/app/components/app/text-generate/saved-items/__tests__/index.spec.tsx+++ b/web/app/components/app/text-generate/saved-items/__tests__/index.spec.tsx@@ -1,9 +1,9 @@import type { ISavedItemsProps } from '../index'-import { toast } from '@langgenius/dify-ui/toast'import { fireEvent, render, screen } from '@testing-library/react'import copy from 'copy-to-clipboard'import * as React from 'react'import { beforeEach, describe, expect, it, vi } from 'vite-plus/test'+import { toast } from '@/app/notifications'import SavedItems from '../index'vi.mock('copy-to-clipboard', () => ({diff --git a/web/app/components/app/text-generate/saved-items/index.tsx b/web/app/components/app/text-generate/saved-items/index.tsxindex 1f8fdc3e763..bb7e80cd219 100644--- a/web/app/components/app/text-generate/saved-items/index.tsx+++ b/web/app/components/app/text-generate/saved-items/index.tsx@@ -3,13 +3,13 @@ import type { FC } from 'react'import type { SavedMessage } from '@/models/debug'import { cn } from '@langgenius/dify-ui/cn'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { RiClipboardLine, RiDeleteBinLine } from '@remixicon/react'import copy from 'copy-to-clipboard'import * as React from 'react'import { useTranslation } from 'react-i18next'import { Markdown } from '@/app/components/base/markdown'import NewAudioButton from '@/app/components/base/new-audio-button'+import { toast } from '@/app/notifications'import NoData from './no-data'export type ISavedItemsProps = {diff --git a/web/app/components/app/use-export-app-dsl.ts b/web/app/components/app/use-export-app-dsl.tsindex 32533de40d4..927e9da58af 100644--- a/web/app/components/app/use-export-app-dsl.ts+++ b/web/app/components/app/use-export-app-dsl.ts@@ -1,10 +1,10 @@'use client'import type { EnvironmentVariableItemResponse } from '@dify/contracts/api/console/apps/types.gen'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation } from '@tanstack/react-query'import { useCallback } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { consoleClient } from '@/service/console'import { downloadBlob } from '@/utils/download'diff --git a/web/app/components/apps/__tests__/app-card.spec.tsx b/web/app/components/apps/__tests__/app-card.spec.tsxindex e7e4b988469..e164657fe1b 100644--- a/web/app/components/apps/__tests__/app-card.spec.tsx+++ b/web/app/components/apps/__tests__/app-card.spec.tsx@@ -141,7 +141,7 @@ const toastMocks = vi.hoisted(() => {}})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: toastMocks.api,}))diff --git a/web/app/components/apps/app-card/index.tsx b/web/app/components/apps/app-card/index.tsxindex a7676157440..6e441135c8a 100644--- a/web/app/components/apps/app-card/index.tsx+++ b/web/app/components/apps/app-card/index.tsx@@ -4,7 +4,6 @@ import type { AppPartial } from '@dify/contracts/api/console/apps/types.gen'import type { WorkflowOnlineUser } from '@/models/app'import { zIconType } from '@dify/contracts/api/console/apps/zod.gen'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { useSuspenseQuery } from '@tanstack/react-query'import { useAtomValue } from 'jotai'import { memo, useCallback, useId, useMemo } from 'react'@@ -12,6 +11,7 @@ import { useTranslation } from 'react-i18next'import { AppTypeIcon } from '@/app/components/app/type-selector'import AppIcon from '@/app/components/base/app-icon'import { UserAvatarList } from '@/app/components/base/user-avatar-list'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { userProfileQueryOptions } from '@/features/account-profile/client'import { systemFeaturesQueryOptions } from '@/features/system-features/client'diff --git a/web/app/components/apps/app-card/interactions.tsx b/web/app/components/apps/app-card/interactions.tsxindex 23713d5439f..5b38e3e5943 100644--- a/web/app/components/apps/app-card/interactions.tsx+++ b/web/app/components/apps/app-card/interactions.tsx@@ -36,7 +36,6 @@ import {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 { toast } from '@langgenius/dify-ui/toast'import { Toggle } from '@langgenius/dify-ui/toggle'import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'import { useMutation, useSuspenseQuery } from '@tanstack/react-query'@@ -50,6 +49,7 @@ import {getStepByStepTourDropdownMenuContentProps,useStepByStepTourControlledDropdown,} from '@/app/components/step-by-step-tour/dropdown-menu'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { userProfileQueryOptions } from '@/features/account-profile/client'import { systemFeaturesQueryOptions } from '@/features/system-features/client'diff --git a/web/app/components/apps/import-from-marketplace-template-modal.tsx b/web/app/components/apps/import-from-marketplace-template-modal.tsxindex d92dfdc1053..13227a97bb9 100644--- a/web/app/components/apps/import-from-marketplace-template-modal.tsx+++ b/web/app/components/apps/import-from-marketplace-template-modal.tsx@@ -2,11 +2,11 @@import { Button } from '@langgenius/dify-ui/button'import { Dialog, DialogClose, DialogContent, DialogTitle } from '@langgenius/dify-ui/dialog'-import { toast } from '@langgenius/dify-ui/toast'import { RiCloseLine } from '@remixicon/react'import { useCallback, useMemo, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import AppIcon from '@/app/components/base/app-icon'+import { toast } from '@/app/notifications'import { MARKETPLACE_API_PREFIX } from '@/config'import {fetchMarketplaceTemplateDSL,diff --git a/web/app/components/apps/starred-app-card.tsx b/web/app/components/apps/starred-app-card.tsxindex 253ee98af87..f71b18291ad 100644--- a/web/app/components/apps/starred-app-card.tsx+++ b/web/app/components/apps/starred-app-card.tsx@@ -3,13 +3,13 @@import type { AppPartial } from '@dify/contracts/api/console/apps/types.gen'import { zIconType } from '@dify/contracts/api/console/apps/zod.gen'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { useSuspenseQuery } from '@tanstack/react-query'import { useAtomValue } from 'jotai'import { memo, useCallback, useId, useMemo } from 'react'import { useTranslation } from 'react-i18next'import { AppTypeIcon } from '@/app/components/app/type-selector'import AppIcon from '@/app/components/base/app-icon'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { userProfileQueryOptions } from '@/features/account-profile/client'import { systemFeaturesQueryOptions } from '@/features/system-features/client'diff --git a/web/app/components/base/agent-log-modal/__tests__/detail.spec.tsx b/web/app/components/base/agent-log-modal/__tests__/detail.spec.tsxindex fe52d3d9e06..db020f292ef 100644--- a/web/app/components/base/agent-log-modal/__tests__/detail.spec.tsx+++ b/web/app/components/base/agent-log-modal/__tests__/detail.spec.tsx@@ -23,7 +23,7 @@ vi.mock('@/service/log', () => ({fetchAgentLogDetail: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: mockToast,}))diff --git a/web/app/components/base/agent-log-modal/__tests__/index.spec.tsx b/web/app/components/base/agent-log-modal/__tests__/index.spec.tsxindex 5f6d1ee5fde..3cfa551f2f7 100644--- a/web/app/components/base/agent-log-modal/__tests__/index.spec.tsx+++ b/web/app/components/base/agent-log-modal/__tests__/index.spec.tsx@@ -21,7 +21,7 @@ vi.mock('@/service/log', () => ({fetchAgentLogDetail: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: mockToast,}))diff --git a/web/app/components/base/agent-log-modal/detail.tsx b/web/app/components/base/agent-log-modal/detail.tsxindex 9e0bd43e163..d32076e7db3 100644--- a/web/app/components/base/agent-log-modal/detail.tsx+++ b/web/app/components/base/agent-log-modal/detail.tsx@@ -3,7 +3,6 @@ import type { FC } from 'react'import type { IChatItem } from '@/app/components/base/chat/chat/type'import type { AgentIteration, AgentLogDetailResponse } from '@/models/log'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { uniq } from 'es-toolkit/array'import { flatten } from 'es-toolkit/compat'import * as React from 'react'@@ -11,6 +10,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react'import { useTranslation } from 'react-i18next'import { useStore as useAppStore } from '@/app/components/app/store'import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder'+import { toast } from '@/app/notifications'import { fetchAgentLogDetail } from '@/service/log'import ResultPanel from './result'import TracingPanel from './tracing'diff --git a/web/app/components/base/agent-log-modal/index.stories.tsx b/web/app/components/base/agent-log-modal/index.stories.tsxindex 7008274c8a6..8279a45e37d 100644--- a/web/app/components/base/agent-log-modal/index.stories.tsx+++ b/web/app/components/base/agent-log-modal/index.stories.tsx@@ -1,9 +1,9 @@import type { Meta, StoryObj } from '@storybook/nextjs-vite'import type { IChatItem } from '@/app/components/base/chat/chat/type'import type { AgentLogDetailResponse } from '@/models/log'-import { ToastHost } from '@langgenius/dify-ui/toast'import { useEffect, useRef } from 'react'import { useStore as useAppStore } from '@/app/components/app/store'+import { AppToastHost } from '@/app/notifications/host'import AgentLogModal from '.'const MOCK_RESPONSE: AgentLogDetailResponse = {@@ -104,7 +104,7 @@ const AgentLogModalDemo = ({ width = 960 }: { width?: number }) => {return (<>- <ToastHost />+ <AppToastHost /><div className="relative min-h-135 w-full bg-background-default-subtle p-6"><AgentLogModalcurrentLogItem={MOCK_CHAT_ITEM}diff --git a/web/app/components/base/audio-gallery/AudioPlayer.tsx b/web/app/components/base/audio-gallery/AudioPlayer.tsxindex 1df62f6680a..a4718c3b469 100644--- a/web/app/components/base/audio-gallery/AudioPlayer.tsx+++ b/web/app/components/base/audio-gallery/AudioPlayer.tsx@@ -1,8 +1,8 @@import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import * as React from 'react'import { useCallback, useEffect, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import useTheme from '@/hooks/use-theme'import { Theme } from '@/types/app'diff --git a/web/app/components/base/audio-gallery/__tests__/AudioPlayer.spec.tsx b/web/app/components/base/audio-gallery/__tests__/AudioPlayer.spec.tsxindex 87bd10cc40b..5595bdb167a 100644--- a/web/app/components/base/audio-gallery/__tests__/AudioPlayer.spec.tsx+++ b/web/app/components/base/audio-gallery/__tests__/AudioPlayer.spec.tsx@@ -1,5 +1,5 @@-import { toast } from '@langgenius/dify-ui/toast'import { act, fireEvent, render, screen } from '@testing-library/react'+import { toast } from '@/app/notifications'import useThemeMock from '@/hooks/use-theme'import { Theme } from '@/types/app'import AudioPlayer from '../AudioPlayer'diff --git a/web/app/components/base/chat/chat-with-history/__tests__/hooks.spec.tsx b/web/app/components/base/chat/chat-with-history/__tests__/hooks.spec.tsxindex e4370a88690..d3bc4c2f809 100644--- a/web/app/components/base/chat/chat-with-history/__tests__/hooks.spec.tsx+++ b/web/app/components/base/chat/chat-with-history/__tests__/hooks.spec.tsx@@ -2,9 +2,9 @@ import type { InstalledAppResponse } from '@dify/contracts/api/console/installedimport type { ReactNode } from 'react'import type { ChatConfig } from '../../types'import type { AppConversationData, AppData, AppMeta, ConversationItem } from '@/models/share'-import { ToastHost } from '@langgenius/dify-ui/toast'import { QueryClient, QueryClientProvider } from '@tanstack/react-query'import { act, renderHook, waitFor } from '@testing-library/react'+import { AppToastHost } from '@/app/notifications/host'import {AppSourceType,delConversation,@@ -98,7 +98,7 @@ const createQueryClient = () =>const createWrapper = (queryClient: QueryClient) => {return ({ children }: { children: ReactNode }) => (<QueryClientProvider client={queryClient}>- <ToastHost />+ <AppToastHost />{children}</QueryClientProvider>)diff --git a/web/app/components/base/chat/chat-with-history/hooks.tsx b/web/app/components/base/chat/chat-with-history/hooks.tsxindex c1625ef99a9..c39b263122d 100644--- a/web/app/components/base/chat/chat-with-history/hooks.tsx+++ b/web/app/components/base/chat/chat-with-history/hooks.tsx@@ -3,7 +3,6 @@ import type { ExtraContent } from '../chat/type'import type { Callback, ChatConfig, ChatItem, OnFeedback } from '../types'import type { AppData, ConversationItem } from '@/models/share'import type { HumanInputFilledFormData, HumanInputFormData } from '@/types/workflow'-import { toast } from '@langgenius/dify-ui/toast'import { noop } from 'es-toolkit/function'import { produce } from 'immer'import { useCallback, useEffect, useMemo, useRef, useState } from 'react'@@ -14,6 +13,7 @@ import {} from '@/app/components/base/chat/storage'import { getProcessedFilesFromResponse } from '@/app/components/base/file-uploader/utils'import { InputVarType } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { useWebAppStore } from '@/context/web-app-context'import { useAppFavicon } from '@/hooks/use-app-favicon'import { changeLanguage } from '@/i18n/client'diff --git a/web/app/components/base/chat/chat/__tests__/check-input-forms-hooks.spec.tsx b/web/app/components/base/chat/chat/__tests__/check-input-forms-hooks.spec.tsxindex a9c3a7af1b3..ee344841691 100644--- a/web/app/components/base/chat/chat/__tests__/check-input-forms-hooks.spec.tsx+++ b/web/app/components/base/chat/chat/__tests__/check-input-forms-hooks.spec.tsx@@ -5,7 +5,7 @@ import { TransferMethod } from '@/types/app'import { useCheckInputsForms } from '../check-input-forms-hooks'const mockNotify = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({default: {notify: (args: unknown) => mockNotify(args),},diff --git a/web/app/components/base/chat/chat/__tests__/hooks.spec.tsx b/web/app/components/base/chat/chat/__tests__/hooks.spec.tsxindex acaabee1935..e37bcca4d93 100644--- a/web/app/components/base/chat/chat/__tests__/hooks.spec.tsx+++ b/web/app/components/base/chat/chat/__tests__/hooks.spec.tsx@@ -24,7 +24,7 @@ vi.mock('@/app/components/base/audio-btn/audio.player.manager', () => ({},}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({default: { notify: vi.fn() },toast: {success: vi.fn(),diff --git a/web/app/components/base/chat/chat/__tests__/question.spec.tsx b/web/app/components/base/chat/chat/__tests__/question.spec.tsxindex fa1fa3cba37..2d5cc31ac0b 100644--- a/web/app/components/base/chat/chat/__tests__/question.spec.tsx+++ b/web/app/components/base/chat/chat/__tests__/question.spec.tsx@@ -1,11 +1,11 @@import type { Theme } from '../../embedded-chatbot/theme/theme'import type { ChatConfig, ChatItem, OnRegenerate } from '../../types'import type { FileEntity } from '@/app/components/base/file-uploader/types'-import { toast } from '@langgenius/dify-ui/toast'import { act, fireEvent, render, screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'import copy from 'copy-to-clipboard'import * as React from 'react'+import { toast } from '@/app/notifications'import { createTheme } from '../../embedded-chatbot/theme/theme'import { ChatContextProvider } from '../context-provider'import Question from '../question'diff --git a/web/app/components/base/chat/chat/answer/__tests__/operation.spec.tsx b/web/app/components/base/chat/chat/answer/__tests__/operation.spec.tsxindex 67e7bbd8bbc..431cc4fccd9 100644--- a/web/app/components/base/chat/chat/answer/__tests__/operation.spec.tsx+++ b/web/app/components/base/chat/chat/answer/__tests__/operation.spec.tsx@@ -15,7 +15,7 @@ const { mockSetShowAnnotationFullModal, mockT, mockAddAnnotation } = vi.hoisted(vi.mock('copy-to-clipboard', () => ({ default: vi.fn() }))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: { success: vi.fn() },}))diff --git a/web/app/components/base/chat/chat/answer/operation.tsx b/web/app/components/base/chat/chat/answer/operation.tsxindex cecf5d452b2..05db31c0633 100644--- a/web/app/components/base/chat/chat/answer/operation.tsx+++ b/web/app/components/base/chat/chat/answer/operation.tsx@@ -12,7 +12,6 @@ import {} from '@langgenius/dify-ui/dialog'import { IconButton } from '@langgenius/dify-ui/icon-button'import { Textarea } from '@langgenius/dify-ui/textarea'-import { toast } from '@langgenius/dify-ui/toast'import { Toggle } from '@langgenius/dify-ui/toggle'import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'import copy from 'copy-to-clipboard'@@ -22,6 +21,7 @@ import EditReplyModal from '@/app/components/app/annotation/edit-annotation-modaimport Log from '@/app/components/base/chat/chat/log'import AnnotationCtrlButton from '@/app/components/base/features/new-feature-panel/annotation-reply/annotation-ctrl-button'import NewAudioButton from '@/app/components/base/new-audio-button'+import { toast } from '@/app/notifications'import { useChatContext } from '../context'type OperationProps = {diff --git a/web/app/components/base/chat/chat/chat-input-area/__tests__/index.spec.tsx b/web/app/components/base/chat/chat/chat-input-area/__tests__/index.spec.tsxindex dcb894fca7b..1df89f887e3 100644--- a/web/app/components/base/chat/chat/chat-input-area/__tests__/index.spec.tsx+++ b/web/app/components/base/chat/chat/chat-input-area/__tests__/index.spec.tsx@@ -122,7 +122,7 @@ vi.mock('@/app/components/base/features/hooks', () => ({// ---------------------------------------------------------------------------// Toast context// ----------------------------------------------------------------------------vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({default: {notify: (args: unknown) => mockNotify(args),},diff --git a/web/app/components/base/chat/chat/chat-input-area/index.tsx b/web/app/components/base/chat/chat/chat-input-area/index.tsxindex 3d10ce26157..e276b293528 100644--- a/web/app/components/base/chat/chat/chat-input-area/index.tsx+++ b/web/app/components/base/chat/chat/chat-input-area/index.tsx@@ -5,7 +5,6 @@ import type { InputForm } from '../type'import type { FileUpload } from '@/app/components/base/features/types'import type { SpeechToTextTarget } from '@/app/components/base/voice-input/types'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { noop } from 'es-toolkit/function'import { decode } from 'html-entities'import { useCallback, useRef, useState } from 'react'@@ -17,6 +16,7 @@ import { useFile } from '@/app/components/base/file-uploader/hooks'import { FileContextProvider, useFileStore } from '@/app/components/base/file-uploader/store'import { Infotip } from '@/app/components/base/infotip'import VoiceInput from '@/app/components/base/voice-input'+import { toast } from '@/app/notifications'import { TransferMethod } from '@/types/app'import { useCheckInputsForms } from '../check-input-forms-hooks'import { useTextAreaHeight } from './hooks'diff --git a/web/app/components/base/chat/chat/check-input-forms-hooks.ts b/web/app/components/base/chat/chat/check-input-forms-hooks.tsindex 1230b15ccd6..3237a0d804f 100644--- a/web/app/components/base/chat/chat/check-input-forms-hooks.ts+++ b/web/app/components/base/chat/chat/check-input-forms-hooks.ts@@ -1,8 +1,8 @@import type { InputForm } from './type'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback } from 'react'import { useTranslation } from 'react-i18next'import { InputVarType } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { TransferMethod } from '@/types/app'export const useCheckInputsForms = () => {diff --git a/web/app/components/base/chat/chat/hooks.ts b/web/app/components/base/chat/chat/hooks.tsindex c35af2fb373..5bd16f0b853 100644--- a/web/app/components/base/chat/chat/hooks.ts+++ b/web/app/components/base/chat/chat/hooks.ts@@ -6,7 +6,6 @@ import type { Annotation } from '@/models/log'import type { IOnDataMoreInfo, IOtherOptions } from '@/service/base'import type { VisionFile } from '@/types/app'import type { FileResponse, ReasoningChunkResponse } from '@/types/workflow'-import { toast } from '@langgenius/dify-ui/toast'import { uniqBy } from 'es-toolkit/compat'import { noop } from 'es-toolkit/function'import { produce, setAutoFreeze } from 'immer'@@ -22,6 +21,7 @@ import {import { isInstalledAppPath } from '@/app/components/explore/installed-app/routes'import { addFileInfos, sortAgentSorts } from '@/app/components/tools/utils'import { NodeRunningStatus, WorkflowRunningStatus } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import useTimestamp from '@/hooks/use-timestamp'import { useParams, usePathname } from '@/next/navigation'import { sseGet, ssePost } from '@/service/base'diff --git a/web/app/components/base/chat/chat/question.tsx b/web/app/components/base/chat/chat/question.tsxindex 254e0accb0a..41f68b1ab29 100644--- a/web/app/components/base/chat/chat/question.tsx+++ b/web/app/components/base/chat/chat/question.tsx@@ -4,7 +4,6 @@ import type { ChatItem } from '../types'import { Button } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import copy from 'copy-to-clipboard'import { memo, useCallback, useEffect, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'@@ -12,6 +11,7 @@ import Textarea from 'react-textarea-autosize'import { FileList } from '@/app/components/base/file-uploader'import { User } from '@/app/components/base/icons/src/public/avatar'import { Markdown } from '@/app/components/base/markdown'+import { toast } from '@/app/notifications'import { CssTransform } from '../embedded-chatbot/theme/utils'import ContentSwitch from './content-switch'import { useChatContext } from './context'diff --git a/web/app/components/base/chat/embedded-chatbot/__tests__/hooks.spec.tsx b/web/app/components/base/chat/embedded-chatbot/__tests__/hooks.spec.tsxindex 32fe04d931a..6508db8e4d8 100644--- a/web/app/components/base/chat/embedded-chatbot/__tests__/hooks.spec.tsx+++ b/web/app/components/base/chat/embedded-chatbot/__tests__/hooks.spec.tsx@@ -1,10 +1,10 @@import type { ReactNode } from 'react'import type { ChatConfig } from '../../types'import type { AppConversationData, AppData, AppMeta, ConversationItem } from '@/models/share'-import { ToastHost } from '@langgenius/dify-ui/toast'import { QueryClient, QueryClientProvider } from '@tanstack/react-query'import { act, renderHook, waitFor } from '@testing-library/react'import { InputVarType } from '@/app/components/workflow/types'+import { AppToastHost } from '@/app/notifications/host'import {AppSourceType,fetchChatList,@@ -111,7 +111,7 @@ const createQueryClient = () =>const createWrapper = (queryClient: QueryClient) => {return ({ children }: { children: ReactNode }) => (<QueryClientProvider client={queryClient}>- <ToastHost />+ <AppToastHost />{children}</QueryClientProvider>)diff --git a/web/app/components/base/chat/embedded-chatbot/hooks.tsx b/web/app/components/base/chat/embedded-chatbot/hooks.tsxindex 9be176dc322..4cb7a2cd050 100644--- a/web/app/components/base/chat/embedded-chatbot/hooks.tsx+++ b/web/app/components/base/chat/embedded-chatbot/hooks.tsx@@ -2,7 +2,6 @@ import type { ChatConfig, ChatItem, OnFeedback } from '../types'import type { InputValueTypes } from '@/app/components/share/text-generation/types'import type { Locale } from '@/i18n'import type { AppData, ConversationItem } from '@/models/share'-import { toast } from '@langgenius/dify-ui/toast'import { noop } from 'es-toolkit/function'import { produce } from 'immer'import { useCallback, useEffect, useMemo, useRef, useState } from 'react'@@ -10,6 +9,7 @@ import { useTranslation } from 'react-i18next'import { useConversationSelection } from '@/app/components/base/chat/storage'import { addFileInfos, sortAgentSorts } from '@/app/components/tools/utils'import { InputVarType } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { useWebAppStore } from '@/context/web-app-context'import { changeLanguage } from '@/i18n/client'import { AppSourceType, updateFeedback } from '@/service/share'diff --git a/web/app/components/base/chat/embedded-chatbot/inputs-form/__tests__/content.spec.tsx b/web/app/components/base/chat/embedded-chatbot/inputs-form/__tests__/content.spec.tsxindex a1317158c63..70a9b2eb0ec 100644--- a/web/app/components/base/chat/embedded-chatbot/inputs-form/__tests__/content.spec.tsx+++ b/web/app/components/base/chat/embedded-chatbot/inputs-form/__tests__/content.spec.tsx@@ -15,7 +15,7 @@ vi.mock('@/next/navigation', () => ({useSearchParams: () => new URLSearchParams(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({}))+vi.mock('@/app/notifications', () => ({}))// Mock CodeEditor to trigger onChange easilyvi.mock('@/app/components/workflow/nodes/_base/components/editor/code-editor', () => ({diff --git a/web/app/components/base/features/new-feature-panel/annotation-reply/__tests__/annotation-ctrl-button.spec.tsx b/web/app/components/base/features/new-feature-panel/annotation-reply/__tests__/annotation-ctrl-button.spec.tsxindex 36a9039e4d6..b4387ed2087 100644--- a/web/app/components/base/features/new-feature-panel/annotation-reply/__tests__/annotation-ctrl-button.spec.tsx+++ b/web/app/components/base/features/new-feature-panel/annotation-reply/__tests__/annotation-ctrl-button.spec.tsx@@ -21,7 +21,7 @@ vi.mock('@/service/annotation', () => ({addAnnotation: (...args: unknown[]) => mockAddAnnotation(...args),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({default: { notify: vi.fn() },toast: {success: vi.fn(),diff --git a/web/app/components/base/features/new-feature-panel/annotation-reply/__tests__/config-param-modal.spec.tsx b/web/app/components/base/features/new-feature-panel/annotation-reply/__tests__/config-param-modal.spec.tsxindex 71796e9f1c8..9e4da19f767 100644--- a/web/app/components/base/features/new-feature-panel/annotation-reply/__tests__/config-param-modal.spec.tsx+++ b/web/app/components/base/features/new-feature-panel/annotation-reply/__tests__/config-param-modal.spec.tsx@@ -1,5 +1,5 @@-import { toast } from '@langgenius/dify-ui/toast'import { fireEvent, render, screen, waitFor } from '@testing-library/react'+import { toast } from '@/app/notifications'import ConfigParamModal from '../config-param-modal'let mockHooksReturn: {diff --git a/web/app/components/base/features/new-feature-panel/annotation-reply/annotation-ctrl-button.tsx b/web/app/components/base/features/new-feature-panel/annotation-reply/annotation-ctrl-button.tsxindex a1a09a71167..80dce9ca088 100644--- a/web/app/components/base/features/new-feature-panel/annotation-reply/annotation-ctrl-button.tsx+++ b/web/app/components/base/features/new-feature-panel/annotation-reply/annotation-ctrl-button.tsx@@ -1,13 +1,13 @@'use client'import type { FC } from 'react'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'import { RiEditLine, RiFileEditLine } from '@remixicon/react'import { useQuery } from '@tanstack/react-query'import { useAtomValue } from 'jotai'import * as React from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { useModalContext } from '@/context/modal-context'import { deploymentEditionAtom } from '@/features/system-features/state'import { addAnnotation } from '@/service/annotation'diff --git a/web/app/components/base/features/new-feature-panel/annotation-reply/config-param-modal.tsx b/web/app/components/base/features/new-feature-panel/annotation-reply/config-param-modal.tsxindex fb48515d053..b7d13a8a29c 100644--- a/web/app/components/base/features/new-feature-panel/annotation-reply/config-param-modal.tsx+++ b/web/app/components/base/features/new-feature-panel/annotation-reply/config-param-modal.tsx@@ -3,13 +3,13 @@ import type { FC } from 'react'import type { AnnotationReplyConfig } from '@/models/debug'import { Button } from '@langgenius/dify-ui/button'import { Dialog, DialogContent } from '@langgenius/dify-ui/dialog'-import { toast } from '@langgenius/dify-ui/toast'import * as React from 'react'import { useState } from 'react'import { useTranslation } from 'react-i18next'import { ModelTypeEnum } from '@/app/components/header/account-setting/model-provider-page/declarations'import { useModelListAndDefaultModelAndCurrentProviderAndModel } from '@/app/components/header/account-setting/model-provider-page/hooks'import { ModelSelector } from '@/app/components/header/account-setting/model-provider-page/model-selector'+import { toast } from '@/app/notifications'import { ANNOTATION_DEFAULT } from '@/config'import { Item } from './config-param'import ScoreSlider from './score-slider'diff --git a/web/app/components/base/features/new-feature-panel/moderation/__tests__/moderation-setting-modal.spec.tsx b/web/app/components/base/features/new-feature-panel/moderation/__tests__/moderation-setting-modal.spec.tsxindex 392c79e689f..a41ce22b909 100644--- a/web/app/components/base/features/new-feature-panel/moderation/__tests__/moderation-setting-modal.spec.tsx+++ b/web/app/components/base/features/new-feature-panel/moderation/__tests__/moderation-setting-modal.spec.tsx@@ -7,7 +7,7 @@ import { withSelectorKey } from '@/test/i18n-mock'import ModerationSettingModal from '../moderation-setting-modal'const mockNotify = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: (message: string) => mockNotify({ type: 'error', message }),},diff --git a/web/app/components/base/features/new-feature-panel/moderation/moderation-setting-modal.tsx b/web/app/components/base/features/new-feature-panel/moderation/moderation-setting-modal.tsxindex 148b1a56d34..67d50a360b2 100644--- a/web/app/components/base/features/new-feature-panel/moderation/moderation-setting-modal.tsx+++ b/web/app/components/base/features/new-feature-panel/moderation/moderation-setting-modal.tsx@@ -5,7 +5,6 @@ import { Button } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'import { Dialog, DialogContent } from '@langgenius/dify-ui/dialog'import { Textarea } from '@langgenius/dify-ui/textarea'-import { toast } from '@langgenius/dify-ui/toast'import { useQueryState } from 'nuqs'import { useCallback, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'@@ -17,6 +16,7 @@ import {settingsQueryParamName,settingsQueryParser,} from '@/app/components/header/account-setting/query-params'+import { toast } from '@/app/notifications'import { useDocLink } from '@/context/i18n'import { LanguagesSupported } from '@/i18n/language'import { useCodeBasedExtensions, useModelProviderDetails } from '@/service/use-common'diff --git a/web/app/components/base/features/new-feature-panel/text-to-speech/__tests__/voice-settings.spec.tsx b/web/app/components/base/features/new-feature-panel/text-to-speech/__tests__/voice-settings.spec.tsxindex 781f95af9b4..c7d288740a7 100644--- a/web/app/components/base/features/new-feature-panel/text-to-speech/__tests__/voice-settings.spec.tsx+++ b/web/app/components/base/features/new-feature-panel/text-to-speech/__tests__/voice-settings.spec.tsx@@ -3,7 +3,7 @@ import type { Features } from '../../../types'import { fireEvent, render, screen } from '@testing-library/react'import { FeaturesProvider } from '../../../context'import VoiceSettings from '../voice-settings'-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: vi.fn(),error: vi.fn(),diff --git a/web/app/components/base/file-uploader/__tests__/hooks.spec.ts b/web/app/components/base/file-uploader/__tests__/hooks.spec.tsindex 3ba3ce25395..7272a52090a 100644--- a/web/app/components/base/file-uploader/__tests__/hooks.spec.ts+++ b/web/app/components/base/file-uploader/__tests__/hooks.spec.ts@@ -23,7 +23,7 @@ vi.mock('../upload-context', () => ({useFileUploadContext: () => mockFileUploadContext,}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: (message: string) => mockNotify({ type: 'error', message }),},diff --git a/web/app/components/base/file-uploader/file-uploader-in-attachment/index.stories.tsx b/web/app/components/base/file-uploader/file-uploader-in-attachment/index.stories.tsxindex 626a175e448..0a4e924be01 100644--- a/web/app/components/base/file-uploader/file-uploader-in-attachment/index.stories.tsx+++ b/web/app/components/base/file-uploader/file-uploader-in-attachment/index.stories.tsx@@ -1,11 +1,11 @@import type { Meta, StoryObj } from '@storybook/nextjs-vite'import type { FileEntity } from '../types'import type { FileUpload } from '@/app/components/base/features/types'-import { ToastHost } from '@langgenius/dify-ui/toast'import { useState } from 'react'import { fn } from 'storybook/test'import { PreviewMode } from '@/app/components/base/features/types'import { SupportUploadFileTypes } from '@/app/components/workflow/types'+import { AppToastHost } from '@/app/notifications/host'import { TransferMethod } from '@/types/app'import FileUploaderInAttachmentWrapper from './index'@@ -86,7 +86,7 @@ const AttachmentDemo = (props: React.ComponentProps<typeof FileUploaderInAttachmreturn (<>- <ToastHost />+ <AppToastHost /><div className="w-[320px] rounded-2xl border border-divider-subtle bg-components-panel-bg p-4 shadow-xs"><FileUploaderInAttachmentWrapper {...props} value={files} onChange={setFiles} /></div>diff --git a/web/app/components/base/file-uploader/file-uploader-in-chat-input/index.stories.tsx b/web/app/components/base/file-uploader/file-uploader-in-chat-input/index.stories.tsxindex 133850ea895..b4b399df005 100644--- a/web/app/components/base/file-uploader/file-uploader-in-chat-input/index.stories.tsx+++ b/web/app/components/base/file-uploader/file-uploader-in-chat-input/index.stories.tsx@@ -1,9 +1,9 @@import type { Meta, StoryObj } from '@storybook/nextjs-vite'import type { FileEntity } from '../types'import type { FileUpload } from '@/app/components/base/features/types'-import { ToastHost } from '@langgenius/dify-ui/toast'import { useState } from 'react'import { SupportUploadFileTypes } from '@/app/components/workflow/types'+import { AppToastHost } from '@/app/notifications/host'import { TransferMethod } from '@/types/app'import FileUploaderInChatInput from '.'import { FileList } from '../file-uploader-in-chat-input/file-list'@@ -37,7 +37,7 @@ const ChatInputDemo = ({ initialFiles = mockFiles, ...props }: ChatInputDemoPropreturn (<>- <ToastHost />+ <AppToastHost /><FileContextProvider value={files} onChange={setFiles}><div className="w-90 rounded-2xl border border-divider-subtle bg-components-panel-bg p-4"><div className="mb-3 text-xs text-text-secondary">Simulated chat input</div>diff --git a/web/app/components/base/file-uploader/hooks.ts b/web/app/components/base/file-uploader/hooks.tsindex 1e62e59ab3b..da92adbdd09 100644--- a/web/app/components/base/file-uploader/hooks.ts+++ b/web/app/components/base/file-uploader/hooks.ts@@ -2,7 +2,6 @@ import type { ClipboardEvent } from 'react'import type { FileEntity } from './types'import type { FileUpload } from '@/app/components/base/features/types'import type { FileUploadConfigResponse } from '@/models/common'-import { toast } from '@langgenius/dify-ui/toast'import { noop } from 'es-toolkit/function'import { produce } from 'immer'import { useCallback, useState } from 'react'@@ -17,6 +16,7 @@ import {VIDEO_SIZE_LIMIT,} from '@/app/components/base/file-uploader/constants'import { SupportUploadFileTypes } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { useParams, usePathname } from '@/next/navigation'import { uploadRemoteFileInfo } from '@/service/common'import { uploadHumanInputFormLocalFile, uploadHumanInputFormRemoteFileInfo } from '@/service/share'diff --git a/web/app/components/base/form/components/base/__tests__/validation-accessibility.spec.tsx b/web/app/components/base/form/components/base/__tests__/validation-accessibility.spec.tsxindex 175889b5d38..5a54a364b65 100644--- a/web/app/components/base/form/components/base/__tests__/validation-accessibility.spec.tsx+++ b/web/app/components/base/form/components/base/__tests__/validation-accessibility.spec.tsx@@ -13,7 +13,7 @@ vi.mock('@/service/use-triggers', () => ({useTriggerPluginDynamicOptions: () => ({ data: undefined, isLoading: false, error: null }),}))-vi.mock('@langgenius/dify-ui/toast', () => ({ toast: { error: vi.fn() } }))+vi.mock('@/app/notifications', () => ({ toast: { error: vi.fn() } }))const requiredSchema = (label: string): FormSchema => ({name: 'token',diff --git a/web/app/components/base/form/hooks/__tests__/use-check-validated.spec.ts b/web/app/components/base/form/hooks/__tests__/use-check-validated.spec.tsindex 96f7aa0a83b..d7494bb69cd 100644--- a/web/app/components/base/form/hooks/__tests__/use-check-validated.spec.ts+++ b/web/app/components/base/form/hooks/__tests__/use-check-validated.spec.ts@@ -5,7 +5,7 @@ import { useCheckValidated } from '../use-check-validated'const mockNotify = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({default: {notify: (args: unknown) => mockNotify(args),},diff --git a/web/app/components/base/form/hooks/use-check-validated.ts b/web/app/components/base/form/hooks/use-check-validated.tsindex d7ca22616b0..9dbdaca8016 100644--- a/web/app/components/base/form/hooks/use-check-validated.ts+++ b/web/app/components/base/form/hooks/use-check-validated.ts@@ -1,7 +1,7 @@import type { AnyFormApi } from '@tanstack/react-form'import type { FormSchema } from '@/app/components/base/form/types'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback } from 'react'+import { toast } from '@/app/notifications'export const useCheckValidated = (form: AnyFormApi,diff --git a/web/app/components/base/image-uploader/__tests__/hooks.spec.ts b/web/app/components/base/image-uploader/__tests__/hooks.spec.tsindex 586ffc93357..e59dce6cc7d 100644--- a/web/app/components/base/image-uploader/__tests__/hooks.spec.ts+++ b/web/app/components/base/image-uploader/__tests__/hooks.spec.ts@@ -4,7 +4,7 @@ import { TransferMethod } from '@/types/app'import { useImageFiles, useLocalFileUploader } from '../hooks'const mockNotify = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: (message: string) => mockNotify({ type: 'error', message }),},diff --git a/web/app/components/base/image-uploader/__tests__/image-preview.spec.tsx b/web/app/components/base/image-uploader/__tests__/image-preview.spec.tsxindex 66a7cf69f8a..81e9cbe0b5a 100644--- a/web/app/components/base/image-uploader/__tests__/image-preview.spec.tsx+++ b/web/app/components/base/image-uploader/__tests__/image-preview.spec.tsx@@ -11,7 +11,7 @@ const mocks = vi.hoisted(() => ({clipboardWrite: vi.fn<(items: ClipboardItem[]) => Promise<void>>(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({default: {notify: (...args: Parameters<typeof mocks.notify>) => mocks.notify(...args),},diff --git a/web/app/components/base/image-uploader/hooks.ts b/web/app/components/base/image-uploader/hooks.tsindex 0f363f8b1dd..e8d12b193b8 100644--- a/web/app/components/base/image-uploader/hooks.ts+++ b/web/app/components/base/image-uploader/hooks.ts@@ -1,7 +1,7 @@import type { ImageFile } from '@/types/app'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback, useMemo, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { useParams } from '@/next/navigation'import { ALLOW_FILE_EXTENSIONS, TransferMethod } from '@/types/app'import { getImageUploadErrorMessage, imageUpload } from './utils'diff --git a/web/app/components/base/image-uploader/image-preview.tsx b/web/app/components/base/image-uploader/image-preview.tsxindex 97328610afa..69db31c78cc 100644--- a/web/app/components/base/image-uploader/image-preview.tsx+++ b/web/app/components/base/image-uploader/image-preview.tsx@@ -1,12 +1,12 @@import type { FC } from 'react'import { Dialog, DialogContent } from '@langgenius/dify-ui/dialog'-import { toast } from '@langgenius/dify-ui/toast'import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'import { useHotkey } from '@tanstack/react-hotkeys'import { noop } from 'es-toolkit/function'import * as React from 'react'import { useCallback, useEffect, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { downloadUrl } from '@/utils/download'type ImagePreviewProps = {diff --git a/web/app/components/base/tag-input/__tests__/index.spec.tsx b/web/app/components/base/tag-input/__tests__/index.spec.tsxindex 983c4ac4df6..8eddf775564 100644--- a/web/app/components/base/tag-input/__tests__/index.spec.tsx+++ b/web/app/components/base/tag-input/__tests__/index.spec.tsx@@ -5,7 +5,7 @@ import TagInput from '../index'const mockNotify = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({default: {notify: (args: unknown) => mockNotify(args),},diff --git a/web/app/components/base/tag-input/index.tsx b/web/app/components/base/tag-input/index.tsxindex f40b8e7c418..3250c00acc5 100644--- a/web/app/components/base/tag-input/index.tsx+++ b/web/app/components/base/tag-input/index.tsx@@ -1,8 +1,8 @@import type { ChangeEvent, InputHTMLAttributes, KeyboardEvent } from 'react'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'type TagInputProps = Pick<InputHTMLAttributes<HTMLInputElement>,diff --git a/web/app/components/base/text-generation/__tests__/hooks.spec.ts b/web/app/components/base/text-generation/__tests__/hooks.spec.tsindex 74a57b32380..6f626df6202 100644--- a/web/app/components/base/text-generation/__tests__/hooks.spec.ts+++ b/web/app/components/base/text-generation/__tests__/hooks.spec.ts@@ -12,7 +12,7 @@ const mockSsePost =) => void>()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({default: {notify: (args: unknown) => mockNotify(args),},diff --git a/web/app/components/base/text-generation/hooks.ts b/web/app/components/base/text-generation/hooks.tsindex 08d8c1ea394..b0a6738e655 100644--- a/web/app/components/base/text-generation/hooks.ts+++ b/web/app/components/base/text-generation/hooks.ts@@ -1,6 +1,6 @@-import { toast } from '@langgenius/dify-ui/toast'import { useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { ssePost } from '@/service/base'type SendOptions = {diff --git a/web/app/components/billing/hooks/use-education-discount.ts b/web/app/components/billing/hooks/use-education-discount.tsindex 10dbd209ec8..a2ccd0ca101 100644--- a/web/app/components/billing/hooks/use-education-discount.ts+++ b/web/app/components/billing/hooks/use-education-discount.ts@@ -1,8 +1,8 @@'use client'-import { toast } from '@langgenius/dify-ui/toast'import { useAtomValue } from 'jotai'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { isCurrentWorkspaceManagerAtom } from '@/context/workspace-state'import { consoleClient } from '@/service/console'diff --git a/web/app/components/billing/pricing/plans/cloud-plan-item/index.tsx b/web/app/components/billing/pricing/plans/cloud-plan-item/index.tsxindex b0590c7ce5b..2468ed745d2 100644--- a/web/app/components/billing/pricing/plans/cloud-plan-item/index.tsx+++ b/web/app/components/billing/pricing/plans/cloud-plan-item/index.tsx@@ -10,10 +10,10 @@ import {DialogTitle,} from '@langgenius/dify-ui/dialog'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { useAtomValue } from 'jotai'import * as React from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { isCurrentWorkspaceManagerAtom } from '@/context/workspace-state'import { useAsyncWindowOpen } from '@/hooks/use-async-window-open'import { consoleClient } from '@/service/console'diff --git a/web/app/components/custom/custom-page/__tests__/index.spec.tsx b/web/app/components/custom/custom-page/__tests__/index.spec.tsxindex b68a53937cf..ac3fc103f0a 100644--- a/web/app/components/custom/custom-page/__tests__/index.spec.tsx+++ b/web/app/components/custom/custom-page/__tests__/index.spec.tsx@@ -62,7 +62,7 @@ const { mockToast } = vi.hoisted(() => {return { mockToast }})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: mockToast,}))diff --git a/web/app/components/custom/custom-web-app-brand/hooks/__tests__/use-web-app-brand.spec.tsx b/web/app/components/custom/custom-web-app-brand/hooks/__tests__/use-web-app-brand.spec.tsxindex a8eb5060e94..ef6a6bc4577 100644--- a/web/app/components/custom/custom-web-app-brand/hooks/__tests__/use-web-app-brand.spec.tsx+++ b/web/app/components/custom/custom-web-app-brand/hooks/__tests__/use-web-app-brand.spec.tsx@@ -54,7 +54,7 @@ const consoleStateRef = vi.hoisted(() => ({}))const mockUpdateCustomConfig = vi.hoisted(() => vi.fn())-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: mockToast,}))vi.mock('@/service/console', async (importOriginal) => {diff --git a/web/app/components/custom/custom-web-app-brand/hooks/use-web-app-brand.ts b/web/app/components/custom/custom-web-app-brand/hooks/use-web-app-brand.tsindex 7dd76072233..65a52000335 100644--- a/web/app/components/custom/custom-web-app-brand/hooks/use-web-app-brand.ts+++ b/web/app/components/custom/custom-web-app-brand/hooks/use-web-app-brand.ts@@ -1,11 +1,11 @@import type { WorkspaceCustomConfigPayload } from '@dify/contracts/api/console/workspaces/types.gen'import type { ChangeEvent } from 'react'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useQuery, useQueryClient, useSuspenseQuery } from '@tanstack/react-query'import { useAtomValue } from 'jotai'import { useState } from 'react'import { useTranslation } from 'react-i18next'import { getImageUploadErrorMessage, imageUpload } from '@/app/components/base/image-uploader/utils'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { systemFeaturesQueryOptions } from '@/features/system-features/client'import { consoleQuery } from '@/service/console'diff --git a/web/app/components/datasets/common/document-status-with-action/__tests__/auto-disabled-document.spec.tsx b/web/app/components/datasets/common/document-status-with-action/__tests__/auto-disabled-document.spec.tsxindex 619dc6a5922..23d795c26fa 100644--- a/web/app/components/datasets/common/document-status-with-action/__tests__/auto-disabled-document.spec.tsx+++ b/web/app/components/datasets/common/document-status-with-action/__tests__/auto-disabled-document.spec.tsx@@ -1,8 +1,8 @@-import { toast } from '@langgenius/dify-ui/toast'import { queryOptions, useQuery } from '@tanstack/react-query'import { act, fireEvent, render, screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { beforeEach, describe, expect, it, vi } from 'vite-plus/test'+import { toast } from '@/app/notifications'import { useAutoDisabledDocuments } from '@/service/knowledge/use-document'import { createConsoleQueryWrapper } from '@/test/console/query-data'import AutoDisabledDocument from '../auto-disabled-document'@@ -33,7 +33,7 @@ vi.mock('@/service/knowledge/use-document', () => ({useInvalidDisabledDocument: vi.fn(() => mockInvalidDisabledDocument),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: mockToastSuccess,},diff --git a/web/app/components/datasets/common/document-status-with-action/auto-disabled-document.tsx b/web/app/components/datasets/common/document-status-with-action/auto-disabled-document.tsxindex ee034e8810e..7f91928582e 100644--- a/web/app/components/datasets/common/document-status-with-action/auto-disabled-document.tsx+++ b/web/app/components/datasets/common/document-status-with-action/auto-disabled-document.tsx@@ -1,8 +1,8 @@'use client'import type { FC } from 'react'-import { toast } from '@langgenius/dify-ui/toast'import * as React from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import {useAutoDisabledDocuments,useDocumentEnable,diff --git a/web/app/components/datasets/common/image-uploader/hooks/__tests__/use-upload.spec.tsx b/web/app/components/datasets/common/image-uploader/hooks/__tests__/use-upload.spec.tsxindex d2d92d0e190..2abf79ace6b 100644--- a/web/app/components/datasets/common/image-uploader/hooks/__tests__/use-upload.spec.tsx+++ b/web/app/components/datasets/common/image-uploader/hooks/__tests__/use-upload.spec.tsx@@ -1,9 +1,9 @@import type { PropsWithChildren } from 'react'import type { FileEntity } from '../../types'-import { toast } from '@langgenius/dify-ui/toast'import { act, fireEvent, render, renderHook, screen, waitFor } from '@testing-library/react'import * as React from 'react'import { beforeEach, describe, expect, it, vi } from 'vite-plus/test'+import { toast } from '@/app/notifications'import { FileContextProvider } from '../../store'import { useUpload } from '../use-upload'@@ -21,7 +21,7 @@ vi.mock('@/service/use-common', () => ({})),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: mockToastError,},diff --git a/web/app/components/datasets/common/image-uploader/hooks/use-upload.ts b/web/app/components/datasets/common/image-uploader/hooks/use-upload.tsindex 9969e28874b..30a2295ebcf 100644--- a/web/app/components/datasets/common/image-uploader/hooks/use-upload.ts+++ b/web/app/components/datasets/common/image-uploader/hooks/use-upload.ts@@ -1,10 +1,10 @@import type { FileEntity, FileUploadConfig } from '../types'-import { toast } from '@langgenius/dify-ui/toast'import { produce } from 'immer'import { useCallback, useEffect, useMemo, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import { v4 as uuid4 } from 'uuid'import { fileUpload, getFileUploadErrorMessage } from '@/app/components/base/file-uploader/utils'+import { toast } from '@/app/notifications'import { useFileUploadConfig } from '@/service/use-common'import { ACCEPT_TYPES } from '../constants'import { useFileStore } from '../store'diff --git a/web/app/components/datasets/common/retrieval-param-config/__tests__/index.spec.tsx b/web/app/components/datasets/common/retrieval-param-config/__tests__/index.spec.tsxindex a191c70bcc8..a4fc6898a97 100644--- a/web/app/components/datasets/common/retrieval-param-config/__tests__/index.spec.tsx+++ b/web/app/components/datasets/common/retrieval-param-config/__tests__/index.spec.tsx@@ -5,7 +5,7 @@ import { RETRIEVE_METHOD } from '@/types/app'import RetrievalParamConfig from '../index'const mockNotify = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: (message: string) => mockNotify(message),},diff --git a/web/app/components/datasets/common/retrieval-param-config/index.tsx b/web/app/components/datasets/common/retrieval-param-config/index.tsxindex aa48a542549..12095534151 100644--- a/web/app/components/datasets/common/retrieval-param-config/index.tsx+++ b/web/app/components/datasets/common/retrieval-param-config/index.tsx@@ -4,7 +4,6 @@ import type { RetrievalConfig } from '@/types/app'import { cn } from '@langgenius/dify-ui/cn'import { RadioGroup } from '@langgenius/dify-ui/radio-group'import { Switch } from '@langgenius/dify-ui/switch'-import { toast } from '@langgenius/dify-ui/toast'import * as React from 'react'import { useCallback, useMemo } from 'react'import { useTranslation } from 'react-i18next'@@ -20,6 +19,7 @@ import {useModelListAndDefaultModel,} from '@/app/components/header/account-setting/model-provider-page/hooks'import { ModelSelector } from '@/app/components/header/account-setting/model-provider-page/model-selector'+import { toast } from '@/app/notifications'import { DEFAULT_WEIGHTED_SCORE, RerankingModeEnum, WeightedScoreEnum } from '@/models/datasets'import { RETRIEVE_METHOD } from '@/types/app'import ProgressIndicator from '../../create/assets/progress-indicator.svg'diff --git a/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/__tests__/index.spec.tsx b/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/__tests__/index.spec.tsxindex 6a8344b5f9f..83574c22c92 100644--- a/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/__tests__/index.spec.tsx+++ b/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/__tests__/index.spec.tsx@@ -60,7 +60,7 @@ const toastMocks = vi.hoisted(() => {}})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: toastMocks.api,}))diff --git a/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/__tests__/uploader.spec.tsx b/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/__tests__/uploader.spec.tsxindex d38576ebecf..d9b4a80249b 100644--- a/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/__tests__/uploader.spec.tsx+++ b/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/__tests__/uploader.spec.tsx@@ -15,7 +15,7 @@ const { mockToast } = vi.hoisted(() => {return { mockToast }})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: mockToast,}))diff --git a/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/hooks/__tests__/use-dsl-import.spec.tsx b/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/hooks/__tests__/use-dsl-import.spec.tsxindex 40163a3c226..c2fdfac60bb 100644--- a/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/hooks/__tests__/use-dsl-import.spec.tsx+++ b/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/hooks/__tests__/use-dsl-import.spec.tsx@@ -59,7 +59,7 @@ const toastMocks = vi.hoisted(() => {}})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: toastMocks.api,}))diff --git a/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/hooks/use-dsl-import.ts b/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/hooks/use-dsl-import.tsindex 6228668fabe..4737b6192fb 100644--- a/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/hooks/use-dsl-import.ts+++ b/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/hooks/use-dsl-import.ts@@ -1,9 +1,9 @@'use client'-import { toast } from '@langgenius/dify-ui/toast'import { useDebounceFn } from 'ahooks'import { useCallback, useMemo, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import { usePluginDependencies } from '@/app/components/workflow/plugin-dependency/hooks'+import { toast } from '@/app/notifications'import { DSLImportMode, DSLImportStatus } from '@/models/app'import { useRouter } from '@/next/navigation'import { useImportPipelineDSL, useImportPipelineDSLConfirm } from '@/service/use-pipeline'diff --git a/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/uploader.tsx b/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/uploader.tsxindex 97c601ba43d..e68b40b68bb 100644--- a/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/uploader.tsx+++ b/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/uploader.tsx@@ -2,11 +2,11 @@import type { FC } from 'react'import { cn } from '@langgenius/dify-ui/cn'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { RiDeleteBinLine, RiNodeTree, RiUploadCloud2Line } from '@remixicon/react'import * as React from 'react'import { useEffect, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { formatFileSize } from '@/utils/format'type Props = Readonly<{diff --git a/web/app/components/datasets/create-from-pipeline/list/__tests__/create-card.spec.tsx b/web/app/components/datasets/create-from-pipeline/list/__tests__/create-card.spec.tsxindex badb3274000..3ee202ab480 100644--- a/web/app/components/datasets/create-from-pipeline/list/__tests__/create-card.spec.tsx+++ b/web/app/components/datasets/create-from-pipeline/list/__tests__/create-card.spec.tsx@@ -17,8 +17,8 @@ const { mockToastSuccess, mockToastError } = vi.hoisted(() => ({mockToastError: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', async (importOriginal) => {- const actual = await importOriginal<typeof import('@langgenius/dify-ui/toast')>()+vi.mock('@/app/notifications', async (importOriginal) => {+ const actual = await importOriginal<typeof import('@/app/notifications')>()return {...actual,toast: {diff --git a/web/app/components/datasets/create-from-pipeline/list/create-card.tsx b/web/app/components/datasets/create-from-pipeline/list/create-card.tsxindex 5daf9a51b95..c9ed34224d0 100644--- a/web/app/components/datasets/create-from-pipeline/list/create-card.tsx+++ b/web/app/components/datasets/create-from-pipeline/list/create-card.tsx@@ -1,9 +1,9 @@-import { toast } from '@langgenius/dify-ui/toast'import { RiAddCircleLine } from '@remixicon/react'import * as React from 'react'import { useCallback } from 'react'import { useTranslation } from 'react-i18next'import { trackEvent } from '@/app/components/base/amplitude'+import { toast } from '@/app/notifications'import { useRouter } from '@/next/navigation'import { useCreatePipelineDataset } from '@/service/knowledge/use-create-dataset'import { useInvalidDatasetList } from '@/service/knowledge/use-dataset'diff --git a/web/app/components/datasets/create-from-pipeline/list/template-card/__tests__/edit-pipeline-info.spec.tsx b/web/app/components/datasets/create-from-pipeline/list/template-card/__tests__/edit-pipeline-info.spec.tsxindex 24c28a0071b..52527e64d48 100644--- a/web/app/components/datasets/create-from-pipeline/list/template-card/__tests__/edit-pipeline-info.spec.tsx+++ b/web/app/components/datasets/create-from-pipeline/list/template-card/__tests__/edit-pipeline-info.spec.tsx@@ -29,8 +29,8 @@ const { mockToastError } = vi.hoisted(() => ({mockToastError: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', async (importOriginal) => {- const actual = await importOriginal<typeof import('@langgenius/dify-ui/toast')>()+vi.mock('@/app/notifications', async (importOriginal) => {+ const actual = await importOriginal<typeof import('@/app/notifications')>()return {...actual,toast: {diff --git a/web/app/components/datasets/create-from-pipeline/list/template-card/__tests__/index.spec.tsx b/web/app/components/datasets/create-from-pipeline/list/template-card/__tests__/index.spec.tsxindex 09540e47775..631d1e49b6f 100644--- a/web/app/components/datasets/create-from-pipeline/list/template-card/__tests__/index.spec.tsx+++ b/web/app/components/datasets/create-from-pipeline/list/template-card/__tests__/index.spec.tsx@@ -20,8 +20,8 @@ const { mockToastSuccess, mockToastError } = vi.hoisted(() => ({mockToastError: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', async (importOriginal) => {- const actual = await importOriginal<typeof import('@langgenius/dify-ui/toast')>()+vi.mock('@/app/notifications', async (importOriginal) => {+ const actual = await importOriginal<typeof import('@/app/notifications')>()return {...actual,toast: {diff --git a/web/app/components/datasets/create-from-pipeline/list/template-card/edit-pipeline-info.tsx b/web/app/components/datasets/create-from-pipeline/list/template-card/edit-pipeline-info.tsxindex 9515d4ea854..6fa341c2f8d 100644--- a/web/app/components/datasets/create-from-pipeline/list/template-card/edit-pipeline-info.tsx+++ b/web/app/components/datasets/create-from-pipeline/list/template-card/edit-pipeline-info.tsx@@ -6,12 +6,12 @@ import { Field, FieldLabel } from '@langgenius/dify-ui/field'import { IconButton } from '@langgenius/dify-ui/icon-button'import { Input } from '@langgenius/dify-ui/input'import { Textarea } from '@langgenius/dify-ui/textarea'-import { toast } from '@langgenius/dify-ui/toast'import * as React from 'react'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'import AppIcon from '@/app/components/base/app-icon'import AppIconPicker from '@/app/components/base/app-icon-picker'+import { toast } from '@/app/notifications'import { useInvalidCustomizedTemplateList, useUpdateTemplateInfo } from '@/service/use-pipeline'type EditPipelineInfoProps = {diff --git a/web/app/components/datasets/create-from-pipeline/list/template-card/index.tsx b/web/app/components/datasets/create-from-pipeline/list/template-card/index.tsxindex 39bfc89fe6a..5bc3f8a5a43 100644--- a/web/app/components/datasets/create-from-pipeline/list/template-card/index.tsx+++ b/web/app/components/datasets/create-from-pipeline/list/template-card/index.tsx@@ -9,12 +9,12 @@ import {AlertDialogTitle,} from '@langgenius/dify-ui/alert-dialog'import { Dialog, DialogContent } from '@langgenius/dify-ui/dialog'-import { toast } from '@langgenius/dify-ui/toast'import * as React from 'react'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'import { trackEvent } from '@/app/components/base/amplitude'import { usePluginDependencies } from '@/app/components/workflow/plugin-dependency/hooks'+import { toast } from '@/app/notifications'import { useRouter } from '@/next/navigation'import { useCreatePipelineDatasetFromCustomized } from '@/service/knowledge/use-create-dataset'import { useInvalidDatasetList } from '@/service/knowledge/use-dataset'diff --git a/web/app/components/datasets/create/empty-dataset-creation-modal/__tests__/index.spec.tsx b/web/app/components/datasets/create/empty-dataset-creation-modal/__tests__/index.spec.tsxindex 884fc5b9446..ffc7cbf5dfc 100644--- a/web/app/components/datasets/create/empty-dataset-creation-modal/__tests__/index.spec.tsx+++ b/web/app/components/datasets/create/empty-dataset-creation-modal/__tests__/index.spec.tsx@@ -19,7 +19,7 @@ const { mockNotify, mockToast } = vi.hoisted(() => {return { mockNotify, mockToast }})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: mockToast,}))diff --git a/web/app/components/datasets/create/empty-dataset-creation-modal/index.tsx b/web/app/components/datasets/create/empty-dataset-creation-modal/index.tsxindex c725e3a7d17..1280dfb6df6 100644--- a/web/app/components/datasets/create/empty-dataset-creation-modal/index.tsx+++ b/web/app/components/datasets/create/empty-dataset-creation-modal/index.tsx@@ -5,11 +5,11 @@ import { Dialog, DialogContent, DialogTitle } from '@langgenius/dify-ui/dialog'import { Field, FieldLabel } from '@langgenius/dify-ui/field'import { Form } from '@langgenius/dify-ui/form'import { Input } from '@langgenius/dify-ui/input'-import { toast } from '@langgenius/dify-ui/toast'import * as React from 'react'import { useState } from 'react'import { useTranslation } from 'react-i18next'import { trackEvent } from '@/app/components/base/amplitude'+import { toast } from '@/app/notifications'import { useRouter } from '@/next/navigation'import { createEmptyDataset } from '@/service/datasets'import { useInvalidDatasetList } from '@/service/knowledge/use-dataset'diff --git a/web/app/components/datasets/create/file-uploader/hooks/__tests__/use-file-upload.spec.tsx b/web/app/components/datasets/create/file-uploader/hooks/__tests__/use-file-upload.spec.tsxindex 5586bb01ea4..aebf6f625b9 100644--- a/web/app/components/datasets/create/file-uploader/hooks/__tests__/use-file-upload.spec.tsx+++ b/web/app/components/datasets/create/file-uploader/hooks/__tests__/use-file-upload.spec.tsx@@ -10,7 +10,7 @@ import { useFileUpload } from '../use-file-upload'// Mock notify functionconst mockNotify = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: (message: string) => mockNotify({ type: 'error', message }),},diff --git a/web/app/components/datasets/create/file-uploader/hooks/use-file-upload.ts b/web/app/components/datasets/create/file-uploader/hooks/use-file-upload.tsindex 2606889e901..5ff3a677a91 100644--- a/web/app/components/datasets/create/file-uploader/hooks/use-file-upload.ts+++ b/web/app/components/datasets/create/file-uploader/hooks/use-file-upload.ts@@ -1,12 +1,12 @@'use client'import type { RefObject } from 'react'import type { CustomFile as File, FileItem } from '@/models/datasets'-import { toast } from '@langgenius/dify-ui/toast'import { useSuspenseQuery } from '@tanstack/react-query'import { useCallback, useEffect, useMemo, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import { useLocale } from '#i18n'import { getFileUploadErrorMessage } from '@/app/components/base/file-uploader/utils'+import { toast } from '@/app/notifications'import { systemFeaturesQueryOptions } from '@/features/system-features/client'import { LanguagesSupported } from '@/i18n/language'import { upload } from '@/service/base'diff --git a/web/app/components/datasets/create/step-two/hooks/__tests__/use-document-creation.spec.ts b/web/app/components/datasets/create/step-two/hooks/__tests__/use-document-creation.spec.tsindex 04f1c2ebd5b..f2065bc673a 100644--- a/web/app/components/datasets/create/step-two/hooks/__tests__/use-document-creation.spec.ts+++ b/web/app/components/datasets/create/step-two/hooks/__tests__/use-document-creation.spec.ts@@ -19,7 +19,7 @@ const mocks = vi.hoisted(() => ({invalidDatasetList: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({default: { notify: mocks.toastNotify },toast: {success: (message: string) => mocks.toastNotify({ type: 'success', message }),diff --git a/web/app/components/datasets/create/step-two/hooks/use-document-creation.ts b/web/app/components/datasets/create/step-two/hooks/use-document-creation.tsindex 7c7b38af414..54734679c11 100644--- a/web/app/components/datasets/create/step-two/hooks/use-document-creation.ts+++ b/web/app/components/datasets/create/step-two/hooks/use-document-creation.ts@@ -13,11 +13,11 @@ import type {SummaryIndexSetting as SummaryIndexSettingType,} from '@/models/datasets'import type { RetrievalConfig, RETRIEVE_METHOD } from '@/types/app'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback } from 'react'import { useTranslation } from 'react-i18next'import { trackEvent } from '@/app/components/base/amplitude'import { isReRankModelSelected } from '@/app/components/datasets/common/check-rerank-model'+import { toast } from '@/app/notifications'import { DataSourceProvider } from '@/models/common'import { DataSourceType } from '@/models/datasets'import {diff --git a/web/app/components/datasets/create/step-two/index.tsx b/web/app/components/datasets/create/step-two/index.tsxindex 5ed0e40578b..f574b2f291d 100644--- a/web/app/components/datasets/create/step-two/index.tsx+++ b/web/app/components/datasets/create/step-two/index.tsx@@ -3,11 +3,11 @@import type { FC } from 'react'import type { StepTwoProps } from './types'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback, useEffect, useState } from 'react'import { useTranslation } from 'react-i18next'import { useLocale } from '#i18n'import Divider from '@/app/components/base/divider'+import { toast } from '@/app/notifications'import { useDatasetDetailContextWithSelector } from '@/context/dataset-detail'import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints'import { LanguagesSupported } from '@/i18n/language'diff --git a/web/app/components/datasets/create/website/firecrawl/index.tsx b/web/app/components/datasets/create/website/firecrawl/index.tsxindex 211bcfb5854..5204e9a3d56 100644--- a/web/app/components/datasets/create/website/firecrawl/index.tsx+++ b/web/app/components/datasets/create/website/firecrawl/index.tsx@@ -1,7 +1,6 @@'use client'import type { FC } from 'react'import type { CrawlOptions, CrawlResultItem } from '@/models/datasets'-import { toast } from '@langgenius/dify-ui/toast'import { useQueryState } from 'nuqs'import * as React from 'react'import { useCallback, useEffect, useRef, useState } from 'react'@@ -10,6 +9,7 @@ import {settingsQueryParamName,settingsQueryParser,} from '@/app/components/header/account-setting/query-params'+import { toast } from '@/app/notifications'import { checkFirecrawlTaskStatus, createFirecrawlTask } from '@/service/datasets'import { sleep } from '@/utils'import CrawledResult from '../base/crawled-result'diff --git a/web/app/components/datasets/create/website/jina-reader/index.tsx b/web/app/components/datasets/create/website/jina-reader/index.tsxindex 3f85f5c69d2..6998baaea35 100644--- a/web/app/components/datasets/create/website/jina-reader/index.tsx+++ b/web/app/components/datasets/create/website/jina-reader/index.tsx@@ -1,7 +1,6 @@'use client'import type { FC } from 'react'import type { CrawlOptions, CrawlResultItem } from '@/models/datasets'-import { toast } from '@langgenius/dify-ui/toast'import { useQueryState } from 'nuqs'import * as React from 'react'import { useCallback, useState } from 'react'@@ -10,6 +9,7 @@ import {settingsQueryParamName,settingsQueryParser,} from '@/app/components/header/account-setting/query-params'+import { toast } from '@/app/notifications'import { checkJinaReaderTaskStatus, createJinaReaderTask } from '@/service/datasets'import { sleep } from '@/utils'import CrawledResult from '../base/crawled-result'diff --git a/web/app/components/datasets/create/website/watercrawl/index.tsx b/web/app/components/datasets/create/website/watercrawl/index.tsxindex cff8845bf0d..09f0c0cfd3d 100644--- a/web/app/components/datasets/create/website/watercrawl/index.tsx+++ b/web/app/components/datasets/create/website/watercrawl/index.tsx@@ -1,7 +1,6 @@'use client'import type { FC } from 'react'import type { CrawlOptions, CrawlResultItem } from '@/models/datasets'-import { toast } from '@langgenius/dify-ui/toast'import { useQueryState } from 'nuqs'import * as React from 'react'import { useCallback, useState } from 'react'@@ -10,6 +9,7 @@ import {settingsQueryParamName,settingsQueryParser,} from '@/app/components/header/account-setting/query-params'+import { toast } from '@/app/notifications'import { checkWatercrawlTaskStatus, createWatercrawlTask } from '@/service/datasets'import { sleep } from '@/utils'import CrawledResult from '../base/crawled-result'diff --git a/web/app/components/datasets/documents/components/__tests__/operations.spec.tsx b/web/app/components/datasets/documents/components/__tests__/operations.spec.tsxindex c1abe441b1d..da2b79c295f 100644--- a/web/app/components/datasets/documents/components/__tests__/operations.spec.tsx+++ b/web/app/components/datasets/documents/components/__tests__/operations.spec.tsx@@ -24,7 +24,7 @@ const { mockToast } = vi.hoisted(() => {return { mockToast }})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: mockToast,}))diff --git a/web/app/components/datasets/documents/components/__tests__/rename-modal.spec.tsx b/web/app/components/datasets/documents/components/__tests__/rename-modal.spec.tsxindex f6fe6688041..228d71f9129 100644--- a/web/app/components/datasets/documents/components/__tests__/rename-modal.spec.tsx+++ b/web/app/components/datasets/documents/components/__tests__/rename-modal.spec.tsx@@ -15,7 +15,7 @@ vi.mock('@/service/datasets', () => ({renameDocumentName: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: mockToastSuccess,error: mockToastError,diff --git a/web/app/components/datasets/documents/components/document-list/hooks/__tests__/use-document-actions.spec.ts b/web/app/components/datasets/documents/components/document-list/hooks/__tests__/use-document-actions.spec.tsindex a31216c1144..97052acdf35 100644--- a/web/app/components/datasets/documents/components/document-list/hooks/__tests__/use-document-actions.spec.ts+++ b/web/app/components/datasets/documents/components/document-list/hooks/__tests__/use-document-actions.spec.ts@@ -27,7 +27,7 @@ vi.mock('@/service/knowledge/use-document', () => ({useDocumentDownloadZip: () => ({ mutateAsync: mockDownloadZip, isPending: mockIsDownloadingZip }),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: mockToastSuccess,error: mockToastError,diff --git a/web/app/components/datasets/documents/components/document-list/hooks/use-document-actions.ts b/web/app/components/datasets/documents/components/document-list/hooks/use-document-actions.tsindex cf48ee5bc80..8dead17f351 100644--- a/web/app/components/datasets/documents/components/document-list/hooks/use-document-actions.ts+++ b/web/app/components/datasets/documents/components/document-list/hooks/use-document-actions.ts@@ -1,7 +1,7 @@import type { CommonResponse } from '@/models/common'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback, useMemo } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { DocumentActionType } from '@/models/datasets'import {useDocumentArchive,diff --git a/web/app/components/datasets/documents/components/operations.tsx b/web/app/components/datasets/documents/components/operations.tsxindex 4d0280721cd..2a29c64db3f 100644--- a/web/app/components/datasets/documents/components/operations.tsx+++ b/web/app/components/datasets/documents/components/operations.tsx@@ -18,7 +18,6 @@ import {} from '@langgenius/dify-ui/dropdown-menu'import { Popover, PopoverContent, PopoverTrigger } from '@langgenius/dify-ui/popover'import { Switch } from '@langgenius/dify-ui/switch'-import { toast } from '@langgenius/dify-ui/toast'import { useSuspenseQuery } from '@tanstack/react-query'import { useBoolean, useDebounceFn } from 'ahooks'import { noop } from 'es-toolkit/function'@@ -26,6 +25,7 @@ import * as React from 'react'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'import Divider from '@/app/components/base/divider'+import { toast } from '@/app/notifications'import { systemFeaturesQueryOptions } from '@/features/system-features/client'import { DataSourceType, DocumentActionType } from '@/models/datasets'import { useRouter } from '@/next/navigation'diff --git a/web/app/components/datasets/documents/components/rename-modal.tsx b/web/app/components/datasets/documents/components/rename-modal.tsxindex 1875e23f385..0e783bf43f2 100644--- a/web/app/components/datasets/documents/components/rename-modal.tsx+++ b/web/app/components/datasets/documents/components/rename-modal.tsx@@ -5,11 +5,11 @@ import { Dialog, DialogContent, DialogTitle } from '@langgenius/dify-ui/dialog'import { Field, FieldLabel } from '@langgenius/dify-ui/field'import { Form } from '@langgenius/dify-ui/form'import { Input } from '@langgenius/dify-ui/input'-import { toast } from '@langgenius/dify-ui/toast'import { useBoolean } from 'ahooks'import * as React from 'react'import { useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { renameDocumentName } from '@/service/datasets'type Props = Readonly<{diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/hooks/__tests__/use-local-file-upload.spec.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/hooks/__tests__/use-local-file-upload.spec.tsxindex d6e9047723f..b098f25b348 100644--- a/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/hooks/__tests__/use-local-file-upload.spec.tsx+++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/hooks/__tests__/use-local-file-upload.spec.tsx@@ -19,7 +19,7 @@ const { mockNotify, mockToast } = vi.hoisted(() => {return { mockNotify, mockToast }})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: mockToast,}))diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/online-documents/__tests__/index.spec.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source/online-documents/__tests__/index.spec.tsxindex 7d7d40c8345..f0636b4b838 100644--- a/web/app/components/datasets/documents/create-from-pipeline/data-source/online-documents/__tests__/index.spec.tsx+++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/online-documents/__tests__/index.spec.tsx@@ -38,8 +38,8 @@ const { mockToastError } = vi.hoisted(() => ({mockToastError: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', async (importOriginal) => {- const actual = await importOriginal<typeof import('@langgenius/dify-ui/toast')>()+vi.mock('@/app/notifications', async (importOriginal) => {+ const actual = await importOriginal<typeof import('@/app/notifications')>()return {...actual,toast: {diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/online-documents/index.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source/online-documents/index.tsxindex 76e1e62c4d0..937bfcfd918 100644--- a/web/app/components/datasets/documents/create-from-pipeline/data-source/online-documents/index.tsx+++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/online-documents/index.tsx@@ -1,7 +1,6 @@import type { DataSourceNodeType } from '@/app/components/workflow/nodes/data-source/types'import type { DataSourceNotionPageMap, DataSourceNotionWorkspace } from '@/models/common'import type { DataSourceNodeCompletedResponse, DataSourceNodeErrorResponse } from '@/types/pipeline'-import { toast } from '@langgenius/dify-ui/toast'import { useQueryState } from 'nuqs'import { useCallback, useEffect, useMemo } from 'react'import { useShallow } from 'zustand/react/shallow'@@ -11,6 +10,7 @@ import {settingsQueryParamName,settingsQueryParser,} from '@/app/components/header/account-setting/query-params'+import { toast } from '@/app/notifications'import { useDatasetDetailContextWithSelector } from '@/context/dataset-detail'import { useDocLink } from '@/context/i18n'import { DatasourceType } from '@/models/pipeline'diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/__tests__/index.spec.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/__tests__/index.spec.tsxindex aa2b6cef6e3..38f8efbad42 100644--- a/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/__tests__/index.spec.tsx+++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/__tests__/index.spec.tsx@@ -61,8 +61,8 @@ vi.mock('@/service/use-datasource', () => ({useGetDataSourceAuth: (...args: unknown[]) => mocks.useGetDataSourceAuth(...args),}))-vi.mock('@langgenius/dify-ui/toast', async (importOriginal) => {- const actual = await importOriginal<typeof import('@langgenius/dify-ui/toast')>()+vi.mock('@/app/notifications', async (importOriginal) => {+ const actual = await importOriginal<typeof import('@/app/notifications')>()return {...actual,toast: {diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/index.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/index.tsxindex 12c0306c63d..9652ba65e41 100644--- a/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/index.tsx+++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/index.tsx@@ -1,7 +1,6 @@import type { DataSourceNodeType } from '@/app/components/workflow/nodes/data-source/types'import type { OnlineDriveFile } from '@/models/pipeline'import type { DataSourceNodeCompletedResponse, DataSourceNodeErrorResponse } from '@/types/pipeline'-import { toast } from '@langgenius/dify-ui/toast'import { produce } from 'immer'import { useQueryState } from 'nuqs'import { useCallback, useEffect, useMemo, useRef, useState } from 'react'@@ -10,6 +9,7 @@ import {settingsQueryParamName,settingsQueryParser,} from '@/app/components/header/account-setting/query-params'+import { toast } from '@/app/notifications'import { useDatasetDetailContextWithSelector } from '@/context/dataset-detail'import { useDocLink } from '@/context/i18n'import { DatasourceType, OnlineDriveFileType } from '@/models/pipeline'diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/base/options/__tests__/index.spec.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/base/options/__tests__/index.spec.tsxindex 7c44569960b..f77c4be751c 100644--- a/web/app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/base/options/__tests__/index.spec.tsx+++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/base/options/__tests__/index.spec.tsx@@ -11,8 +11,8 @@ const { mockToastError } = vi.hoisted(() => ({mockToastError: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', async (importOriginal) => {- const actual = await importOriginal<typeof import('@langgenius/dify-ui/toast')>()+vi.mock('@/app/notifications', async (importOriginal) => {+ const actual = await importOriginal<typeof import('@/app/notifications')>()return {...actual,toast: {diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/base/options/index.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/base/options/index.tsxindex 2866e4f2533..852fdb95752 100644--- a/web/app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/base/options/index.tsx+++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/base/options/index.tsx@@ -1,7 +1,6 @@import type { RAGPipelineVariables } from '@/models/pipeline'import { Button } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { RiPlayLargeLine } from '@remixicon/react'import { useBoolean } from 'ahooks'import { useEffect, useId, useMemo } from 'react'@@ -14,6 +13,7 @@ import {useConfigurations,useInitialData,} from '@/app/components/rag-pipeline/hooks/use-input-fields'+import { toast } from '@/app/notifications'import { CrawlStep } from '@/models/datasets'const I18N_PREFIX = 'stepOne.website'diff --git a/web/app/components/datasets/documents/create-from-pipeline/preview/__tests__/online-document-preview.spec.tsx b/web/app/components/datasets/documents/create-from-pipeline/preview/__tests__/online-document-preview.spec.tsxindex abbefcd97aa..821f3744b54 100644--- a/web/app/components/datasets/documents/create-from-pipeline/preview/__tests__/online-document-preview.spec.tsx+++ b/web/app/components/datasets/documents/create-from-pipeline/preview/__tests__/online-document-preview.spec.tsx@@ -9,8 +9,8 @@ const { mockToastError } = vi.hoisted(() => ({mockToastError: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', async (importOriginal) => {- const actual = await importOriginal<typeof import('@langgenius/dify-ui/toast')>()+vi.mock('@/app/notifications', async (importOriginal) => {+ const actual = await importOriginal<typeof import('@/app/notifications')>()return {...actual,toast: {diff --git a/web/app/components/datasets/documents/create-from-pipeline/preview/online-document-preview.tsx b/web/app/components/datasets/documents/create-from-pipeline/preview/online-document-preview.tsxindex 00a649bd5ac..57f42d6e832 100644--- a/web/app/components/datasets/documents/create-from-pipeline/preview/online-document-preview.tsx+++ b/web/app/components/datasets/documents/create-from-pipeline/preview/online-document-preview.tsx@@ -1,12 +1,12 @@'use client'import type { NotionPage } from '@/models/common'-import { toast } from '@langgenius/dify-ui/toast'import { RiCloseLine } from '@remixicon/react'import * as React from 'react'import { useEffect, useState } from 'react'import { useTranslation } from 'react-i18next'import { Notion } from '@/app/components/base/icons/src/public/common'import { Markdown } from '@/app/components/base/markdown'+import { toast } from '@/app/notifications'import { useDatasetDetailContextWithSelector } from '@/context/dataset-detail'import { usePreviewOnlineDocument } from '@/service/use-pipeline'import { formatNumberAbbreviated } from '@/utils/format'diff --git a/web/app/components/datasets/documents/create-from-pipeline/process-documents/__tests__/components.spec.tsx b/web/app/components/datasets/documents/create-from-pipeline/process-documents/__tests__/components.spec.tsxindex c0783b294cf..ff05fda5eee 100644--- a/web/app/components/datasets/documents/create-from-pipeline/process-documents/__tests__/components.spec.tsx+++ b/web/app/components/datasets/documents/create-from-pipeline/process-documents/__tests__/components.spec.tsx@@ -11,8 +11,8 @@ const { mockToastError } = vi.hoisted(() => ({mockToastError: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', async (importOriginal) => {- const actual = await importOriginal<typeof import('@langgenius/dify-ui/toast')>()+vi.mock('@/app/notifications', async (importOriginal) => {+ const actual = await importOriginal<typeof import('@/app/notifications')>()return {...actual,toast: {diff --git a/web/app/components/datasets/documents/create-from-pipeline/process-documents/__tests__/form.spec.tsx b/web/app/components/datasets/documents/create-from-pipeline/process-documents/__tests__/form.spec.tsxindex bf5a749ba96..8e2e3198161 100644--- a/web/app/components/datasets/documents/create-from-pipeline/process-documents/__tests__/form.spec.tsx+++ b/web/app/components/datasets/documents/create-from-pipeline/process-documents/__tests__/form.spec.tsx@@ -8,8 +8,8 @@ const { mockToastError } = vi.hoisted(() => ({mockToastError: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', async (importOriginal) => {- const actual = await importOriginal<typeof import('@langgenius/dify-ui/toast')>()+vi.mock('@/app/notifications', async (importOriginal) => {+ const actual = await importOriginal<typeof import('@/app/notifications')>()return {...actual,toast: {diff --git a/web/app/components/datasets/documents/create-from-pipeline/process-documents/form.tsx b/web/app/components/datasets/documents/create-from-pipeline/process-documents/form.tsxindex 4a29e4fd7cb..c89f71eab0d 100644--- a/web/app/components/datasets/documents/create-from-pipeline/process-documents/form.tsx+++ b/web/app/components/datasets/documents/create-from-pipeline/process-documents/form.tsx@@ -1,9 +1,9 @@import type { ZodSchema } from 'zod'import type { BaseConfiguration } from '@/app/components/base/form/form-scenarios/base/types'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback, useImperativeHandle } from 'react'import { useAppForm } from '@/app/components/base/form'import BaseField from '@/app/components/base/form/form-scenarios/base/field'+import { toast } from '@/app/notifications'import Header from './header'type OptionsProps = {diff --git a/web/app/components/datasets/documents/detail/__tests__/index.spec.tsx b/web/app/components/datasets/documents/detail/__tests__/index.spec.tsxindex cb933dc1a92..3a6d3d2e7c7 100644--- a/web/app/components/datasets/documents/detail/__tests__/index.spec.tsx+++ b/web/app/components/datasets/documents/detail/__tests__/index.spec.tsx@@ -89,7 +89,7 @@ vi.mock('@/service/use-base', () => ({},}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({default: { notify: mocks.toastNotify },}))diff --git a/web/app/components/datasets/documents/detail/__tests__/new-segment.spec.tsx b/web/app/components/datasets/documents/detail/__tests__/new-segment.spec.tsxindex ecbfb1f0fee..a39adfedf6d 100644--- a/web/app/components/datasets/documents/detail/__tests__/new-segment.spec.tsx+++ b/web/app/components/datasets/documents/detail/__tests__/new-segment.spec.tsx@@ -1,6 +1,7 @@-import { toast, ToastHost } from '@langgenius/dify-ui/toast'import { fireEvent, render, screen, waitFor } from '@testing-library/react'import { beforeEach, describe, expect, it, vi } from 'vite-plus/test'+import { toast } from '@/app/notifications'+import { AppToastHost } from '@/app/notifications/host'import { ChunkingMode } from '@/models/datasets'import { IndexingType } from '../../../create/step-two'import NewSegmentModal from '../new-segment'@@ -459,7 +460,7 @@ describe('NewSegmentModal', () => {render(<>- <ToastHost timeout={0} />+ <AppToastHost timeout={0} /><NewSegmentModal{...defaultProps}docForm={ChunkingMode.text}diff --git a/web/app/components/datasets/documents/detail/batch-modal/__tests__/csv-uploader.spec.tsx b/web/app/components/datasets/documents/detail/batch-modal/__tests__/csv-uploader.spec.tsxindex 25a6353dae8..d8de2327aa8 100644--- a/web/app/components/datasets/documents/detail/batch-modal/__tests__/csv-uploader.spec.tsx+++ b/web/app/components/datasets/documents/detail/batch-modal/__tests__/csv-uploader.spec.tsx@@ -41,7 +41,7 @@ const toastMocks = vi.hoisted(() => {}})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: toastMocks.api,}))diff --git a/web/app/components/datasets/documents/detail/batch-modal/csv-uploader.tsx b/web/app/components/datasets/documents/detail/batch-modal/csv-uploader.tsxindex 7bf1952a98c..8d3d89206e5 100644--- a/web/app/components/datasets/documents/detail/batch-modal/csv-uploader.tsx+++ b/web/app/components/datasets/documents/detail/batch-modal/csv-uploader.tsx@@ -3,7 +3,6 @@ import type { FC } from 'react'import type { FileItem } from '@/models/datasets'import { Button } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { RiDeleteBinLine } from '@remixicon/react'import * as React from 'react'import { useCallback, useEffect, useMemo, useRef, useState } from 'react'@@ -11,6 +10,7 @@ import { useTranslation } from 'react-i18next'import { getFileUploadErrorMessage } from '@/app/components/base/file-uploader/utils'import { Csv as CSVIcon } from '@/app/components/base/icons/src/public/files'import SimplePieChart from '@/app/components/base/simple-pie-chart'+import { toast } from '@/app/notifications'import useTheme from '@/hooks/use-theme'import { upload } from '@/service/base'import { useFileUploadConfig } from '@/service/use-common'diff --git a/web/app/components/datasets/documents/detail/completed/__tests__/index.spec.tsx b/web/app/components/datasets/documents/detail/completed/__tests__/index.spec.tsxindex 0d6055f7838..6a8e2f24970 100644--- a/web/app/components/datasets/documents/detail/completed/__tests__/index.spec.tsx+++ b/web/app/components/datasets/documents/detail/completed/__tests__/index.spec.tsx@@ -78,7 +78,7 @@ vi.mock('../../context', () => ({},}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: mockToast,}))diff --git a/web/app/components/datasets/documents/detail/completed/__tests__/new-child-segment.spec.tsx b/web/app/components/datasets/documents/detail/completed/__tests__/new-child-segment.spec.tsxindex 3ed01d9a9ca..4b476364495 100644--- a/web/app/components/datasets/documents/detail/completed/__tests__/new-child-segment.spec.tsx+++ b/web/app/components/datasets/documents/detail/completed/__tests__/new-child-segment.spec.tsx@@ -1,6 +1,7 @@-import { toast, ToastHost } from '@langgenius/dify-ui/toast'import { fireEvent, render, screen, waitFor } from '@testing-library/react'import { beforeEach, describe, expect, it, vi } from 'vite-plus/test'+import { toast } from '@/app/notifications'+import { AppToastHost } from '@/app/notifications/host'import NewChildSegmentModal from '../new-child-segment'vi.mock('@/next/navigation', () => ({@@ -385,7 +386,7 @@ describe('NewChildSegmentModal', () => {render(<>- <ToastHost timeout={0} />+ <AppToastHost timeout={0} /><NewChildSegmentModal{...defaultProps}viewNewlyAddedChildChunk={mockViewNewlyAddedChildChunk}diff --git a/web/app/components/datasets/documents/detail/completed/hooks/__tests__/use-child-segment-data.spec.ts b/web/app/components/datasets/documents/detail/completed/hooks/__tests__/use-child-segment-data.spec.tsindex 13f86fe2cac..7c2a5618dd0 100644--- a/web/app/components/datasets/documents/detail/completed/hooks/__tests__/use-child-segment-data.spec.ts+++ b/web/app/components/datasets/documents/detail/completed/hooks/__tests__/use-child-segment-data.spec.ts@@ -69,7 +69,7 @@ vi.mock('../../../context', () => ({},}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: (message: string) => mockNotify({ type: 'success', message }),error: (message: string) => mockNotify({ type: 'error', message }),diff --git a/web/app/components/datasets/documents/detail/completed/hooks/__tests__/use-segment-list-data.spec.ts b/web/app/components/datasets/documents/detail/completed/hooks/__tests__/use-segment-list-data.spec.tsindex caa917c8a97..bee656a85bb 100644--- a/web/app/components/datasets/documents/detail/completed/hooks/__tests__/use-segment-list-data.spec.ts+++ b/web/app/components/datasets/documents/detail/completed/hooks/__tests__/use-segment-list-data.spec.ts@@ -107,7 +107,7 @@ vi.mock('../../../context', () => ({},}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: (message: string) => mockNotify({ type: 'success', message }),error: (message: string) => mockNotify({ type: 'error', message }),diff --git a/web/app/components/datasets/documents/detail/completed/hooks/use-child-segment-data.ts b/web/app/components/datasets/documents/detail/completed/hooks/use-child-segment-data.tsindex 8ed8a687fac..b8f5759fec1 100644--- a/web/app/components/datasets/documents/detail/completed/hooks/use-child-segment-data.ts+++ b/web/app/components/datasets/documents/detail/completed/hooks/use-child-segment-data.ts@@ -4,10 +4,10 @@ import type {SegmentDetailModel,SegmentUpdater,} from '@/models/datasets'-import { toast } from '@langgenius/dify-ui/toast'import { useQueryClient } from '@tanstack/react-query'import { useCallback, useEffect, useMemo, useRef } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { useEventEmitterContextContext } from '@/context/event-emitter'import {useChildSegmentList,diff --git a/web/app/components/datasets/documents/detail/completed/hooks/use-segment-list-data.ts b/web/app/components/datasets/documents/detail/completed/hooks/use-segment-list-data.tsindex f61e7a64d93..9f11a0df03c 100644--- a/web/app/components/datasets/documents/detail/completed/hooks/use-segment-list-data.ts+++ b/web/app/components/datasets/documents/detail/completed/hooks/use-segment-list-data.ts@@ -1,10 +1,10 @@import type { FileEntity } from '@/app/components/datasets/common/image-uploader/types'import type { SegmentDetailModel, SegmentsResponse, SegmentUpdater } from '@/models/datasets'import type { SegmentImportStatus } from '@/types/dataset'-import { toast } from '@langgenius/dify-ui/toast'import { useQueryClient } from '@tanstack/react-query'import { useCallback, useEffect, useMemo, useRef } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { useEventEmitterContextContext } from '@/context/event-emitter'import { ChunkingMode } from '@/models/datasets'import { usePathname } from '@/next/navigation'diff --git a/web/app/components/datasets/documents/detail/completed/new-child-segment.tsx b/web/app/components/datasets/documents/detail/completed/new-child-segment.tsxindex c7ba7e3e318..ccf728955bb 100644--- a/web/app/components/datasets/documents/detail/completed/new-child-segment.tsx+++ b/web/app/components/datasets/documents/detail/completed/new-child-segment.tsx@@ -1,11 +1,11 @@import type { FC } from 'react'import type { ChildChunkDetail, SegmentUpdater } from '@/models/datasets'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { RiCloseLine, RiExpandDiagonalLine } from '@remixicon/react'import { memo, useState } from 'react'import { useTranslation } from 'react-i18next'import Divider from '@/app/components/base/divider'+import { toast } from '@/app/notifications'import { ChunkingMode } from '@/models/datasets'import { useParams } from '@/next/navigation'import { useAddChildSegment } from '@/service/knowledge/use-segment'diff --git a/web/app/components/datasets/documents/detail/embedding/__tests__/index.spec.tsx b/web/app/components/datasets/documents/detail/embedding/__tests__/index.spec.tsxindex 7397d49bb4d..77c25e20dd8 100644--- a/web/app/components/datasets/documents/detail/embedding/__tests__/index.spec.tsx+++ b/web/app/components/datasets/documents/detail/embedding/__tests__/index.spec.tsx@@ -28,7 +28,7 @@ const { mockToast } = vi.hoisted(() => {vi.mock('@/service/datasets')vi.mock('@/service/knowledge/use-dataset')-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: mockToast,}))diff --git a/web/app/components/datasets/documents/detail/embedding/index.tsx b/web/app/components/datasets/documents/detail/embedding/index.tsxindex a36ec10960e..aba1995795f 100644--- a/web/app/components/datasets/documents/detail/embedding/index.tsx+++ b/web/app/components/datasets/documents/detail/embedding/index.tsx@@ -1,10 +1,10 @@import type { FC } from 'react'import type { IndexingType } from '../../../create/step-two'import type { RETRIEVE_METHOD } from '@/types/app'-import { toast } from '@langgenius/dify-ui/toast'import * as React from 'react'import { useCallback } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { useProcessRule } from '@/service/knowledge/use-dataset'import { useDocumentContext } from '../context'import { ProgressBar, RuleDetail, SegmentProgress, StatusHeader } from './components'diff --git a/web/app/components/datasets/documents/detail/index.tsx b/web/app/components/datasets/documents/detail/index.tsxindex c6ca1e714bd..4b03ff319b5 100644--- a/web/app/components/datasets/documents/detail/index.tsx+++ b/web/app/components/datasets/documents/detail/index.tsx@@ -5,7 +5,6 @@ import type { DocumentDisplayStatus, FileItem, FullDocumentDetail } from '@/modeimport type { SegmentImportStatus } from '@/types/dataset'import { cn } from '@langgenius/dify-ui/cn'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { useSuspenseQuery } from '@tanstack/react-query'import { useAtomValue } from 'jotai'import * as React from 'react'@@ -15,6 +14,7 @@ import Divider from '@/app/components/base/divider'import FloatRightContainer from '@/app/components/base/float-right-container'import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder'import Metadata from '@/app/components/datasets/metadata/metadata-document'+import { toast } from '@/app/notifications'import { useDatasetDetailContextWithSelector } from '@/context/dataset-detail'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { userProfileQueryOptions } from '@/features/account-profile/client'diff --git a/web/app/components/datasets/documents/detail/new-segment.tsx b/web/app/components/datasets/documents/detail/new-segment.tsxindex 392b888a48a..5c27f970927 100644--- a/web/app/components/datasets/documents/detail/new-segment.tsx+++ b/web/app/components/datasets/documents/detail/new-segment.tsx@@ -2,12 +2,12 @@ import type { FC } from 'react'import type { FileEntity } from '@/app/components/datasets/common/image-uploader/types'import type { SegmentUpdater } from '@/models/datasets'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { RiCloseLine, RiExpandDiagonalLine } from '@remixicon/react'import { memo, useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'import Divider from '@/app/components/base/divider'import ImageUploaderInChunk from '@/app/components/datasets/common/image-uploader/image-uploader-in-chunk'+import { toast } from '@/app/notifications'import { useDatasetDetailContextWithSelector } from '@/context/dataset-detail'import { ChunkingMode } from '@/models/datasets'import { useParams } from '@/next/navigation'diff --git a/web/app/components/datasets/documents/status-item/__tests__/index.spec.tsx b/web/app/components/datasets/documents/status-item/__tests__/index.spec.tsxindex f0d72b55ac4..a955140f274 100644--- a/web/app/components/datasets/documents/status-item/__tests__/index.spec.tsx+++ b/web/app/components/datasets/documents/status-item/__tests__/index.spec.tsx@@ -37,7 +37,7 @@ vi.mock('use-context-selector', () => ({useContextSelector: (context: unknown, selector: (state: unknown) => unknown) => selector({}),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: toastMocks.api,}))diff --git a/web/app/components/datasets/documents/status-item/index.tsx b/web/app/components/datasets/documents/status-item/index.tsxindex 15215060be3..21eeceb58b1 100644--- a/web/app/components/datasets/documents/status-item/index.tsx+++ b/web/app/components/datasets/documents/status-item/index.tsx@@ -5,13 +5,13 @@ import type { DocumentDisplayStatus } from '@/models/datasets'import { cn } from '@langgenius/dify-ui/cn'import { StatusDot } from '@langgenius/dify-ui/status-dot'import { Switch } from '@langgenius/dify-ui/switch'-import { toast } from '@langgenius/dify-ui/toast'import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'import { useDebounceFn } from 'ahooks'import * as React from 'react'import { useMemo } from 'react'import { useTranslation } from 'react-i18next'import { Infotip } from '@/app/components/base/infotip'+import { toast } from '@/app/notifications'import {useDocumentDelete,useDocumentDisable,diff --git a/web/app/components/datasets/external-api/external-api-modal/__tests__/index.spec.tsx b/web/app/components/datasets/external-api/external-api-modal/__tests__/index.spec.tsxindex fa1a78e7b22..a2ee9f93dba 100644--- a/web/app/components/datasets/external-api/external-api-modal/__tests__/index.spec.tsx+++ b/web/app/components/datasets/external-api/external-api-modal/__tests__/index.spec.tsx@@ -13,7 +13,7 @@ vi.mock('@/service/datasets', () => ({}))const mockNotify = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({default: {notify: (args: unknown) => mockNotify(args),},diff --git a/web/app/components/datasets/external-api/external-api-modal/index.tsx b/web/app/components/datasets/external-api/external-api-modal/index.tsxindex 2b1e39a7075..7739406f24f 100644--- a/web/app/components/datasets/external-api/external-api-modal/index.tsx+++ b/web/app/components/datasets/external-api/external-api-modal/index.tsx@@ -13,10 +13,10 @@ import { Button } from '@langgenius/dify-ui/button'import { Dialog, DialogContent, DialogTitle } from '@langgenius/dify-ui/dialog'import { IconButton } from '@langgenius/dify-ui/icon-button'import { Popover, PopoverContent, PopoverTrigger } from '@langgenius/dify-ui/popover'-import { toast } from '@langgenius/dify-ui/toast'import { RiBook2Line, RiCloseLine, RiInformation2Line, RiLock2Fill } from '@remixicon/react'import { memo, useId, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { createExternalAPI } from '@/service/datasets'import Form from './Form'diff --git a/web/app/components/datasets/external-knowledge-base/connector/__tests__/index.spec.tsx b/web/app/components/datasets/external-knowledge-base/connector/__tests__/index.spec.tsxindex 972214965cc..74366f7e285 100644--- a/web/app/components/datasets/external-knowledge-base/connector/__tests__/index.spec.tsx+++ b/web/app/components/datasets/external-knowledge-base/connector/__tests__/index.spec.tsx@@ -27,8 +27,8 @@ vi.mock('@/context/i18n', () => ({const mockToastSuccess = vi.hoisted(() => vi.fn())const mockToastError = vi.hoisted(() => vi.fn())-vi.mock('@langgenius/dify-ui/toast', async (importOriginal) => {- const actual = await importOriginal<typeof import('@langgenius/dify-ui/toast')>()+vi.mock('@/app/notifications', async (importOriginal) => {+ const actual = await importOriginal<typeof import('@/app/notifications')>()return {...actual,toast: {diff --git a/web/app/components/datasets/external-knowledge-base/connector/index.tsx b/web/app/components/datasets/external-knowledge-base/connector/index.tsxindex f8194ff84d7..fedce465e3f 100644--- a/web/app/components/datasets/external-knowledge-base/connector/index.tsx+++ b/web/app/components/datasets/external-knowledge-base/connector/index.tsx@@ -1,12 +1,12 @@'use client'import type { CreateKnowledgeBaseReq } from '@/app/components/datasets/external-knowledge-base/create/declarations'-import { toast } from '@langgenius/dify-ui/toast'import * as React from 'react'import { useState } from 'react'import { useTranslation } from 'react-i18next'import { trackEvent } from '@/app/components/base/amplitude'import ExternalKnowledgeBaseCreate from '@/app/components/datasets/external-knowledge-base/create'+import { toast } from '@/app/notifications'import useDocumentTitle from '@/hooks/use-document-title'import { useRouter } from '@/next/navigation'import { createExternalKnowledgeBase } from '@/service/datasets'diff --git a/web/app/components/datasets/hit-testing/__tests__/modify-retrieval-modal.spec.tsx b/web/app/components/datasets/hit-testing/__tests__/modify-retrieval-modal.spec.tsxindex 4a9582db78b..d214187b9bc 100644--- a/web/app/components/datasets/hit-testing/__tests__/modify-retrieval-modal.spec.tsx+++ b/web/app/components/datasets/hit-testing/__tests__/modify-retrieval-modal.spec.tsx@@ -20,7 +20,7 @@ const { mockToast } = vi.hoisted(() => {return { mockToast }})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: mockToast,}))diff --git a/web/app/components/datasets/hit-testing/modify-retrieval-modal.tsx b/web/app/components/datasets/hit-testing/modify-retrieval-modal.tsxindex dce7f4d080e..0a1a63ca871 100644--- a/web/app/components/datasets/hit-testing/modify-retrieval-modal.tsx+++ b/web/app/components/datasets/hit-testing/modify-retrieval-modal.tsx@@ -3,7 +3,6 @@ import type { FC } from 'react'import type { IndexingType } from '../create/step-two'import type { RetrievalConfig } from '@/types/app'import { Button } from '@langgenius/dify-ui/button'-import { toast } from '@langgenius/dify-ui/toast'import { RiCloseLine } from '@remixicon/react'import { useQuery } from '@tanstack/react-query'import * as React from 'react'@@ -12,6 +11,7 @@ import { useTranslation } from 'react-i18next'import { isReRankModelSelected } from '@/app/components/datasets/common/check-rerank-model'import EconomicalRetrievalMethodConfig from '@/app/components/datasets/common/economical-retrieval-method-config'import RetrievalMethodConfig from '@/app/components/datasets/common/retrieval-method-config'+import { toast } from '@/app/notifications'import { useDatasetDetailContextWithSelector } from '@/context/dataset-detail'import { useDocLink } from '@/context/i18n'import { consoleQuery } from '@/service/console'diff --git a/web/app/components/datasets/list/dataset-card/__tests__/index.spec.tsx b/web/app/components/datasets/list/dataset-card/__tests__/index.spec.tsxindex 0e5de21a2c7..5199b4eff3a 100644--- a/web/app/components/datasets/list/dataset-card/__tests__/index.spec.tsx+++ b/web/app/components/datasets/list/dataset-card/__tests__/index.spec.tsx@@ -51,7 +51,7 @@ const toastMocks = vi.hoisted(() => {return { record, api }})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: toastMocks.api,}))diff --git a/web/app/components/datasets/list/dataset-card/hooks/use-dataset-card-state.ts b/web/app/components/datasets/list/dataset-card/hooks/use-dataset-card-state.tsindex a2431ef9931..d807c486711 100644--- a/web/app/components/datasets/list/dataset-card/hooks/use-dataset-card-state.ts+++ b/web/app/components/datasets/list/dataset-card/hooks/use-dataset-card-state.ts@@ -1,8 +1,8 @@import type { DataSet } from '@/models/datasets'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useQueryClient } from '@tanstack/react-query'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { useRouter } from '@/next/navigation'import { consoleQuery } from '@/service/console'import { useExportPipelineDSL } from '@/service/use-pipeline'diff --git a/web/app/components/datasets/list/dataset-card/index.tsx b/web/app/components/datasets/list/dataset-card/index.tsxindex 695c9e9c80b..97b156aefbe 100644--- a/web/app/components/datasets/list/dataset-card/index.tsx+++ b/web/app/components/datasets/list/dataset-card/index.tsx@@ -3,11 +3,11 @@import type { KeyboardEvent, MouseEvent } from 'react'import type { DataSet } from '@/models/datasets'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { useSuspenseQuery } from '@tanstack/react-query'import { useAtomValue } from 'jotai'import { useMemo } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { userProfileQueryOptions } from '@/features/account-profile/client'import { DatasetCardTags } from '@/features/tag-management/components/dataset-card-tags'diff --git a/web/app/components/datasets/metadata/edit-metadata-batch/__tests__/modal.spec.tsx b/web/app/components/datasets/metadata/edit-metadata-batch/__tests__/modal.spec.tsxindex 0702456d07b..b848e9e69c5 100644--- a/web/app/components/datasets/metadata/edit-metadata-batch/__tests__/modal.spec.tsx+++ b/web/app/components/datasets/metadata/edit-metadata-batch/__tests__/modal.spec.tsx@@ -31,7 +31,7 @@ vi.mock('../../hooks/use-check-metadata-name', () => ({// Mock Toast to verify notificationsconst mockToastNotify = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({default: {notify: (args: unknown) => mockToastNotify(args),},diff --git a/web/app/components/datasets/metadata/edit-metadata-batch/modal.tsx b/web/app/components/datasets/metadata/edit-metadata-batch/modal.tsxindex d84bb5763f4..7d7c5c459ea 100644--- a/web/app/components/datasets/metadata/edit-metadata-batch/modal.tsx+++ b/web/app/components/datasets/metadata/edit-metadata-batch/modal.tsx@@ -5,12 +5,12 @@ import { Button } from '@langgenius/dify-ui/button'import { Checkbox } from '@langgenius/dify-ui/checkbox'import { Dialog, DialogClose, DialogContent, DialogTitle } from '@langgenius/dify-ui/dialog'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { produce } from 'immer'import * as React from 'react'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'import Divider from '@/app/components/base/divider'+import { toast } from '@/app/notifications'import { useCreateMetaData } from '@/service/knowledge/use-metadata'import { Infotip } from '../../../base/infotip'import useCheckMetadataName from '../hooks/use-check-metadata-name'diff --git a/web/app/components/datasets/metadata/hooks/__tests__/use-batch-edit-document-metadata.spec.ts b/web/app/components/datasets/metadata/hooks/__tests__/use-batch-edit-document-metadata.spec.tsindex b96d12547ce..540d7a5c68f 100644--- a/web/app/components/datasets/metadata/hooks/__tests__/use-batch-edit-document-metadata.spec.ts+++ b/web/app/components/datasets/metadata/hooks/__tests__/use-batch-edit-document-metadata.spec.ts@@ -34,7 +34,7 @@ vi.mock('@/service/knowledge/use-metadata', () => ({}),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: vi.fn(),error: vi.fn(),diff --git a/web/app/components/datasets/metadata/hooks/__tests__/use-edit-dataset-metadata.spec.ts b/web/app/components/datasets/metadata/hooks/__tests__/use-edit-dataset-metadata.spec.tsindex 4f704dff420..dea5dc81291 100644--- a/web/app/components/datasets/metadata/hooks/__tests__/use-edit-dataset-metadata.spec.ts+++ b/web/app/components/datasets/metadata/hooks/__tests__/use-edit-dataset-metadata.spec.ts@@ -40,7 +40,7 @@ vi.mock('@/service/knowledge/use-metadata', () => ({}),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({default: {notify: vi.fn(),},diff --git a/web/app/components/datasets/metadata/hooks/__tests__/use-metadata-document.spec.ts b/web/app/components/datasets/metadata/hooks/__tests__/use-metadata-document.spec.tsindex 19f05e8218d..9d1ae745959 100644--- a/web/app/components/datasets/metadata/hooks/__tests__/use-metadata-document.spec.ts+++ b/web/app/components/datasets/metadata/hooks/__tests__/use-metadata-document.spec.ts@@ -81,7 +81,7 @@ vi.mock('@/hooks/use-metadata', () => ({}),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({default: {notify: vi.fn(),},diff --git a/web/app/components/datasets/metadata/hooks/use-batch-edit-document-metadata.ts b/web/app/components/datasets/metadata/hooks/use-batch-edit-document-metadata.tsindex ae76e5933eb..d08b4d75fef 100644--- a/web/app/components/datasets/metadata/hooks/use-batch-edit-document-metadata.ts+++ b/web/app/components/datasets/metadata/hooks/use-batch-edit-document-metadata.ts@@ -5,10 +5,10 @@ import type {MetadataItemWithValue,} from '../types'import type { SimpleDocumentDetail } from '@/models/datasets'-import { toast } from '@langgenius/dify-ui/toast'import { useBoolean } from 'ahooks'import { t } from 'i18next'import { useMemo } from 'react'+import { toast } from '@/app/notifications'import { useBatchUpdateDocMetadata } from '@/service/knowledge/use-metadata'import { UpdateType } from '../types'diff --git a/web/app/components/datasets/metadata/hooks/use-edit-dataset-metadata.ts b/web/app/components/datasets/metadata/hooks/use-edit-dataset-metadata.tsindex 619eacfa98b..def012190d4 100644--- a/web/app/components/datasets/metadata/hooks/use-edit-dataset-metadata.ts+++ b/web/app/components/datasets/metadata/hooks/use-edit-dataset-metadata.ts@@ -1,9 +1,9 @@import type { BuiltInMetadataItem, MetadataItemWithValueLength } from '../types'import type { DataSet } from '@/models/datasets'-import { toast } from '@langgenius/dify-ui/toast'import { useBoolean } from 'ahooks'import { useCallback, useEffect, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import {useBuiltInMetaDataFields,useCreateMetaData,diff --git a/web/app/components/datasets/metadata/hooks/use-metadata-document.ts b/web/app/components/datasets/metadata/hooks/use-metadata-document.tsindex 42b84eb6231..f8f2463bb2e 100644--- a/web/app/components/datasets/metadata/hooks/use-metadata-document.ts+++ b/web/app/components/datasets/metadata/hooks/use-metadata-document.ts@@ -1,9 +1,9 @@import type { BuiltInMetadataItem, MetadataItemWithValue } from '../types'import type { FullDocumentDetail } from '@/models/datasets'-import { toast } from '@langgenius/dify-ui/toast'import { get } from 'es-toolkit/compat'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { useDatasetDetailContext } from '@/context/dataset-detail'import { useLanguages, useMetadataMap } from '@/hooks/use-metadata'import {diff --git a/web/app/components/datasets/metadata/metadata-dataset/__tests__/dataset-metadata-drawer.spec.tsx b/web/app/components/datasets/metadata/metadata-dataset/__tests__/dataset-metadata-drawer.spec.tsxindex 0f12c67b2e0..abb9d2025ff 100644--- a/web/app/components/datasets/metadata/metadata-dataset/__tests__/dataset-metadata-drawer.spec.tsx+++ b/web/app/components/datasets/metadata/metadata-dataset/__tests__/dataset-metadata-drawer.spec.tsx@@ -21,7 +21,7 @@ vi.mock('../../hooks/use-check-metadata-name', () => ({}))const mockToastNotify = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({default: {notify: (args: unknown) => mockToastNotify(args),},diff --git a/web/app/components/datasets/metadata/metadata-dataset/dataset-metadata-drawer.tsx b/web/app/components/datasets/metadata/metadata-dataset/dataset-metadata-drawer.tsxindex e0d19bebb9a..4098b01dc05 100644--- a/web/app/components/datasets/metadata/metadata-dataset/dataset-metadata-drawer.tsx+++ b/web/app/components/datasets/metadata/metadata-dataset/dataset-metadata-drawer.tsx@@ -25,7 +25,6 @@ import {} from '@langgenius/dify-ui/drawer'import { Input } from '@langgenius/dify-ui/input'import { Switch } from '@langgenius/dify-ui/switch'-import { toast } from '@langgenius/dify-ui/toast'import { RiAddLine, RiDeleteBinLine, RiEditLine } from '@remixicon/react'import { useBoolean, useHover } from 'ahooks'import * as React from 'react'@@ -33,6 +32,7 @@ import { useCallback, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import { Infotip } from '@/app/components/base/infotip'import { CreateMetadataModal } from '@/app/components/datasets/metadata/metadata-dataset/create-metadata-modal'+import { toast } from '@/app/notifications'import { getIconClassName } from '../utils/get-icon'import Field from './field'diff --git a/web/app/components/datasets/rename-modal/__tests__/index.spec.tsx b/web/app/components/datasets/rename-modal/__tests__/index.spec.tsxindex 52ed523e6b8..98773598bbc 100644--- a/web/app/components/datasets/rename-modal/__tests__/index.spec.tsx+++ b/web/app/components/datasets/rename-modal/__tests__/index.spec.tsx@@ -19,7 +19,7 @@ const { mockToast } = vi.hoisted(() => {return { mockToast }})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: mockToast,}))diff --git a/web/app/components/datasets/rename-modal/index.tsx b/web/app/components/datasets/rename-modal/index.tsxindex 9f82f925385..47d9190f31b 100644--- a/web/app/components/datasets/rename-modal/index.tsx+++ b/web/app/components/datasets/rename-modal/index.tsx@@ -7,9 +7,9 @@ import { Field, FieldLabel } from '@langgenius/dify-ui/field'import { IconButton } from '@langgenius/dify-ui/icon-button'import { Input } from '@langgenius/dify-ui/input'import { Textarea } from '@langgenius/dify-ui/textarea'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { updateDatasetSetting } from '@/service/datasets'import AppIcon from '../../base/app-icon'import AppIconPicker from '../../base/app-icon-picker'diff --git a/web/app/components/datasets/settings/form/__tests__/index.spec.tsx b/web/app/components/datasets/settings/form/__tests__/index.spec.tsxindex 461e1eb7255..a8f6e484d02 100644--- a/web/app/components/datasets/settings/form/__tests__/index.spec.tsx+++ b/web/app/components/datasets/settings/form/__tests__/index.spec.tsx@@ -208,7 +208,7 @@ vi.mock('@/app/components/datasets/common/check-rerank-model', () => ({isReRankModelSelected: () => true,}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: mockToastError,success: vi.fn(),@@ -402,7 +402,7 @@ describe('Form', () => {})it('should show error when trying to save with empty name', async () => {- const { toast } = await import('@langgenius/dify-ui/toast')+ const { toast } = await import('@/app/notifications')render(<Form />)// Clear the namediff --git a/web/app/components/datasets/settings/form/hooks/__tests__/use-form-state.spec.ts b/web/app/components/datasets/settings/form/hooks/__tests__/use-form-state.spec.tsindex 736e8ec15d9..53ccd46eeaf 100644--- a/web/app/components/datasets/settings/form/hooks/__tests__/use-form-state.spec.ts+++ b/web/app/components/datasets/settings/form/hooks/__tests__/use-form-state.spec.ts@@ -182,7 +182,7 @@ vi.mock('@/app/components/datasets/common/check-rerank-model', () => ({isReRankModelSelected: () => true,}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: mockToastSuccess,error: mockToastError,@@ -490,7 +490,7 @@ describe('useFormState', () => {describe('handleSave', () => {it('should show error toast when name is empty', async () => {- const { toast } = await import('@langgenius/dify-ui/toast')+ const { toast } = await import('@/app/notifications')const { result } = renderHook(() => useFormState())act(() => {@@ -505,7 +505,7 @@ describe('useFormState', () => {})it('should show error toast when name is whitespace only', async () => {- const { toast } = await import('@langgenius/dify-ui/toast')+ const { toast } = await import('@/app/notifications')const { result } = renderHook(() => useFormState())act(() => {@@ -553,7 +553,7 @@ describe('useFormState', () => {})it('should show success toast on successful save', async () => {- const { toast } = await import('@langgenius/dify-ui/toast')+ const { toast } = await import('@/app/notifications')const { result } = renderHook(() => useFormState())await act(async () => {@@ -628,7 +628,7 @@ describe('useFormState', () => {it('should show error toast on save failure', async () => {const { updateDatasetSetting } = await import('@/service/datasets')- const { toast } = await import('@langgenius/dify-ui/toast')+ const { toast } = await import('@/app/notifications')vi.mocked(updateDatasetSetting).mockRejectedValueOnce(new Error('Network error'))const { result } = renderHook(() => useFormState())diff --git a/web/app/components/datasets/settings/form/hooks/use-form-state.ts b/web/app/components/datasets/settings/form/hooks/use-form-state.tsindex 3fa3ac4ca36..354487d14e7 100644--- a/web/app/components/datasets/settings/form/hooks/use-form-state.ts+++ b/web/app/components/datasets/settings/form/hooks/use-form-state.ts@@ -4,13 +4,13 @@ import type { DefaultModel } from '@/app/components/header/account-setting/modelimport type { Member } from '@/models/common'import type { IconInfo, SummaryIndexSetting as SummaryIndexSettingType } from '@/models/datasets'import type { RetrievalConfig } from '@/types/app'-import { toast } from '@langgenius/dify-ui/toast'import { useQuery, useSuspenseQuery } from '@tanstack/react-query'import { useAtomValue } from 'jotai'import { useCallback, useMemo, useState } from 'react'import { useTranslation } from 'react-i18next'import { isReRankModelSelected } from '@/app/components/datasets/common/check-rerank-model'import { ModelTypeEnum } from '@/app/components/header/account-setting/model-provider-page/declarations'+import { toast } from '@/app/notifications'import { useDatasetDetailContextWithSelector } from '@/context/dataset-detail'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { userProfileQueryOptions } from '@/features/account-profile/client'diff --git a/web/app/components/explore/create-app-modal/index.tsx b/web/app/components/explore/create-app-modal/index.tsxindex d22ba097ec4..39b1a1c6192 100644--- a/web/app/components/explore/create-app-modal/index.tsx+++ b/web/app/components/explore/create-app-modal/index.tsx@@ -8,7 +8,6 @@ import { Input } from '@langgenius/dify-ui/input'import { Kbd, KbdGroup } from '@langgenius/dify-ui/kbd'import { Switch } from '@langgenius/dify-ui/switch'import { Textarea } from '@langgenius/dify-ui/textarea'-import { toast } from '@langgenius/dify-ui/toast'import { formatForDisplay, useHotkey } from '@tanstack/react-hotkeys'import { useQuery } from '@tanstack/react-query'import { useDebounceFn } from 'ahooks'@@ -18,6 +17,7 @@ import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'import AppIcon from '@/app/components/base/app-icon'import AppsFull from '@/app/components/billing/apps-full-in-dialog'+import { toast } from '@/app/notifications'import { deploymentEditionAtom } from '@/features/system-features/state'import { consoleQuery } from '@/service/console'import { AppModeEnum } from '@/types/app'diff --git a/web/app/components/header/account-dropdown/__tests__/compliance.spec.tsx b/web/app/components/header/account-dropdown/__tests__/compliance.spec.tsxindex d67c1645688..7aeb3adfc36 100644--- a/web/app/components/header/account-dropdown/__tests__/compliance.spec.tsx+++ b/web/app/components/header/account-dropdown/__tests__/compliance.spec.tsx@@ -3,10 +3,10 @@ import {DropdownMenuContent,DropdownMenuTrigger,} from '@langgenius/dify-ui/dropdown-menu'-import { toast } from '@langgenius/dify-ui/toast'import { QueryClient, QueryClientProvider } from '@tanstack/react-query'import { fireEvent, render as renderWithoutPricing, screen, waitFor } from '@testing-library/react'import { NuqsTestingAdapter } from 'nuqs/adapters/testing'+import { toast } from '@/app/notifications'import { getDocDownloadUrl } from '@/service/common'import { seedFeatures } from '@/test/console/query-data'import { downloadUrl } from '@/utils/download'diff --git a/web/app/components/header/account-dropdown/compliance.tsx b/web/app/components/header/account-dropdown/compliance.tsxindex 0d458f733e9..7e8ebdc5ce4 100644--- a/web/app/components/header/account-dropdown/compliance.tsx+++ b/web/app/components/header/account-dropdown/compliance.tsx@@ -8,7 +8,6 @@ import {DropdownMenuSubContent,DropdownMenuSubTrigger,} from '@langgenius/dify-ui/dropdown-menu'-import { toast } from '@langgenius/dify-ui/toast'import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'import { useMutation, useQuery } from '@tanstack/react-query'import { useQueryState } from 'nuqs'@@ -22,6 +21,7 @@ import {settingsQueryParamName,settingsQueryParser,} from '@/app/components/header/account-setting/query-params'+import { toast } from '@/app/notifications'import { getDocDownloadUrl } from '@/service/common'import { consoleQuery } from '@/service/console'import { downloadUrl } from '@/utils/download'diff --git a/web/app/components/header/account-setting/access-rules-page/access-rule-row-menu.tsx b/web/app/components/header/account-setting/access-rules-page/access-rule-row-menu.tsxindex 6e2a4bbae28..c167813814f 100644--- a/web/app/components/header/account-setting/access-rules-page/access-rule-row-menu.tsx+++ b/web/app/components/header/account-setting/access-rules-page/access-rule-row-menu.tsx@@ -18,10 +18,10 @@ import {DropdownMenuTrigger,} from '@langgenius/dify-ui/dropdown-menu'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation } from '@tanstack/react-query'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { consoleQuery } from '@/service/console'type AccessRuleRowMenuProps = {diff --git a/web/app/components/header/account-setting/access-rules-page/resource-access-rule-section.tsx b/web/app/components/header/account-setting/access-rules-page/resource-access-rule-section.tsxindex 834b15c386a..adee5bf1961 100644--- a/web/app/components/header/account-setting/access-rules-page/resource-access-rule-section.tsx+++ b/web/app/components/header/account-setting/access-rules-page/resource-access-rule-section.tsx@@ -3,12 +3,12 @@import type { PermissionSetFormValues, PermissionSetModalMode } from './permission-set-modal'import type { AccessRule } from './types'import type { AccessPolicyResourceType } from '@/models/access-control'-import { toast } from '@langgenius/dify-ui/toast'import { useInfiniteQuery, useMutation } from '@tanstack/react-query'import { useAtomValue } from 'jotai'import { useState } from 'react'import { useTranslation } from 'react-i18next'import { useLocale } from '#i18n'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { getAccessControlTemplateLanguage } from '@/i18n/language'import { consoleQuery } from '@/service/console'diff --git a/web/app/components/header/account-setting/api-based-extension-page/__tests__/modal.spec.tsx b/web/app/components/header/account-setting/api-based-extension-page/__tests__/modal.spec.tsxindex f5dd0d3057a..7226f018bd2 100644--- a/web/app/components/header/account-setting/api-based-extension-page/__tests__/modal.spec.tsx+++ b/web/app/components/header/account-setting/api-based-extension-page/__tests__/modal.spec.tsx@@ -51,7 +51,7 @@ vi.mock('@tanstack/react-query', () => ({})),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: mockToast,}))diff --git a/web/app/components/header/account-setting/api-based-extension-page/modal.tsx b/web/app/components/header/account-setting/api-based-extension-page/modal.tsxindex 2c09de22bf6..2bf3ea1b1d6 100644--- a/web/app/components/header/account-setting/api-based-extension-page/modal.tsx+++ b/web/app/components/header/account-setting/api-based-extension-page/modal.tsx@@ -8,9 +8,9 @@ import { Field, FieldDescription, FieldError, FieldLabel } from '@langgenius/difimport { Form } from '@langgenius/dify-ui/form'import { IconButton } from '@langgenius/dify-ui/icon-button'import { Input } from '@langgenius/dify-ui/input'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation } from '@tanstack/react-query'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { useDocLink } from '@/context/i18n'import { consoleQuery } from '@/service/console'diff --git a/web/app/components/header/account-setting/members-page/__tests__/member-menu.spec.tsx b/web/app/components/header/account-setting/members-page/__tests__/member-menu.spec.tsxindex 98c835987a9..8d4adf6e2eb 100644--- a/web/app/components/header/account-setting/members-page/__tests__/member-menu.spec.tsx+++ b/web/app/components/header/account-setting/members-page/__tests__/member-menu.spec.tsx@@ -1,9 +1,9 @@import type { Role } from '@/models/access-control'import type { Member } from '@/models/common'-import { toast } from '@langgenius/dify-ui/toast'import { QueryClient } from '@tanstack/react-query'import { screen, waitFor, within } from '@testing-library/react'import userEvent from '@testing-library/user-event'+import { toast } from '@/app/notifications'import { useUpdateRolesOfMember } from '@/service/access-control/use-member-roles'import { useWorkspaceRoleList } from '@/service/access-control/use-workspace-roles'import { deleteMemberOrCancelInvitation } from '@/service/common'@@ -16,7 +16,7 @@ vi.mock('@/service/access-control/use-workspace-roles')vi.mock('@/service/common', () => ({deleteMemberOrCancelInvitation: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: vi.fn(),},diff --git a/web/app/components/header/account-setting/members-page/edit-workspace-modal/__tests__/index.spec.tsx b/web/app/components/header/account-setting/members-page/edit-workspace-modal/__tests__/index.spec.tsxindex 41e19f28878..3c2e99d19a7 100644--- a/web/app/components/header/account-setting/members-page/edit-workspace-modal/__tests__/index.spec.tsx+++ b/web/app/components/header/account-setting/members-page/edit-workspace-modal/__tests__/index.spec.tsx@@ -22,7 +22,7 @@ vi.mock('@/context/workspace-state', async () => {})vi.mock('@/service/common')-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({default: {notify: (args: unknown) => toastMocks.mockNotify(args),},diff --git a/web/app/components/header/account-setting/members-page/edit-workspace-modal/index.tsx b/web/app/components/header/account-setting/members-page/edit-workspace-modal/index.tsxindex cd01e2f7d06..c04b05d97ba 100644--- a/web/app/components/header/account-setting/members-page/edit-workspace-modal/index.tsx+++ b/web/app/components/header/account-setting/members-page/edit-workspace-modal/index.tsx@@ -4,10 +4,10 @@ import { cn } from '@langgenius/dify-ui/cn'import { Dialog, DialogClose, DialogContent, DialogTitle } from '@langgenius/dify-ui/dialog'import { IconButton } from '@langgenius/dify-ui/icon-button'import { Input } from '@langgenius/dify-ui/input'-import { toast } from '@langgenius/dify-ui/toast'import { useAtomValue } from 'jotai'import { useId, useMemo, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { currentWorkspaceAtom, isCurrentWorkspaceOwnerAtom } from '@/context/workspace-state'import { updateWorkspaceInfo } from '@/service/common'diff --git a/web/app/components/header/account-setting/members-page/index.tsx b/web/app/components/header/account-setting/members-page/index.tsxindex d808cea5fd6..3141b022438 100644--- a/web/app/components/header/account-setting/members-page/index.tsx+++ b/web/app/components/header/account-setting/members-page/index.tsx@@ -2,7 +2,6 @@import type { MemberInviteResponse } from '@dify/contracts/api/console/workspaces/types.gen'import type { Role } from '@/models/access-control'import type { Member } from '@/models/common'-import { toast } from '@langgenius/dify-ui/toast'import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'import { useQuery, useSuspenseQuery } from '@tanstack/react-query'import { useAtomValue } from 'jotai'@@ -11,6 +10,7 @@ import { useTranslation } from 'react-i18next'import { useLocale } from '#i18n'import { WorkspaceAvatar } from '@/app/components/base/workspace-avatar'import UpgradeBtn from '@/app/components/billing/upgrade-btn'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { currentWorkspaceAtom, isCurrentWorkspaceOwnerAtom } from '@/context/workspace-state'import { userProfileQueryOptions } from '@/features/account-profile/client'diff --git a/web/app/components/header/account-setting/members-page/member-menu.tsx b/web/app/components/header/account-setting/members-page/member-menu.tsxindex 5d69a2b3c7a..13c4d788ecf 100644--- a/web/app/components/header/account-setting/members-page/member-menu.tsx+++ b/web/app/components/header/account-setting/members-page/member-menu.tsx@@ -18,10 +18,10 @@ import {DropdownMenuTrigger,} from '@langgenius/dify-ui/dropdown-menu'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { useQueryClient } from '@tanstack/react-query'import { memo, useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { useUpdateRolesOfMember } from '@/service/access-control/use-member-roles'import { deleteMemberOrCancelInvitation } from '@/service/common'import { commonQueryKeys } from '@/service/use-common'diff --git a/web/app/components/header/account-setting/members-page/transfer-ownership-modal/__tests__/index.spec.tsx b/web/app/components/header/account-setting/members-page/transfer-ownership-modal/__tests__/index.spec.tsxindex 750aa5efdad..703fccb4492 100644--- a/web/app/components/header/account-setting/members-page/transfer-ownership-modal/__tests__/index.spec.tsx+++ b/web/app/components/header/account-setting/members-page/transfer-ownership-modal/__tests__/index.spec.tsx@@ -23,7 +23,7 @@ vi.mock('@/context/workspace-state', async () => {vi.mock('@/service/common')vi.mock('@/service/use-common')-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({default: {notify: (args: unknown) => toastMocks.mockNotify(args),},diff --git a/web/app/components/header/account-setting/members-page/transfer-ownership-modal/index.tsx b/web/app/components/header/account-setting/members-page/transfer-ownership-modal/index.tsxindex fb883a14695..317236f0e0d 100644--- a/web/app/components/header/account-setting/members-page/transfer-ownership-modal/index.tsx+++ b/web/app/components/header/account-setting/members-page/transfer-ownership-modal/index.tsx@@ -1,12 +1,12 @@import { Button } from '@langgenius/dify-ui/button'import { Dialog, DialogContent } from '@langgenius/dify-ui/dialog'import { Input } from '@langgenius/dify-ui/input'-import { toast } from '@langgenius/dify-ui/toast'import { useSuspenseQuery } from '@tanstack/react-query'import { useAtomValue } from 'jotai'import * as React from 'react'import { useCallback, useState } from 'react'import { Trans, useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { currentWorkspaceAtom } from '@/context/workspace-state'import { userProfileQueryOptions } from '@/features/account-profile/client'import { ownershipTransfer, sendOwnerEmail, verifyOwnerEmail } from '@/service/common'diff --git a/web/app/components/header/account-setting/model-provider-page/model-auth/hooks/__tests__/use-auth.spec.tsx b/web/app/components/header/account-setting/model-provider-page/model-auth/hooks/__tests__/use-auth.spec.tsxindex 540879d975e..14484fd2f4c 100644--- a/web/app/components/header/account-setting/model-provider-page/model-auth/hooks/__tests__/use-auth.spec.tsx+++ b/web/app/components/header/account-setting/model-provider-page/model-auth/hooks/__tests__/use-auth.spec.tsx@@ -17,8 +17,8 @@ const mockAddModelCredential = vi.fn()const mockEditProviderCredential = vi.fn()const mockEditModelCredential = vi.fn()-vi.mock('@langgenius/dify-ui/toast', async (importOriginal) => {- const actual = await importOriginal<typeof import('@langgenius/dify-ui/toast')>()+vi.mock('@/app/notifications', async (importOriginal) => {+ const actual = await importOriginal<typeof import('@/app/notifications')>()return {...actual,default: {diff --git a/web/app/components/header/account-setting/model-provider-page/model-auth/hooks/use-auth.ts b/web/app/components/header/account-setting/model-provider-page/model-auth/hooks/use-auth.tsindex 7918092c7c3..25a3a73e91d 100644--- a/web/app/components/header/account-setting/model-provider-page/model-auth/hooks/use-auth.ts+++ b/web/app/components/header/account-setting/model-provider-page/model-auth/hooks/use-auth.ts@@ -6,13 +6,13 @@ import type {ModelModalModeEnum,ModelProvider,} from '../../declarations'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import {useModelModalHandler,useRefreshModel,} from '@/app/components/header/account-setting/model-provider-page/hooks'+import { toast } from '@/app/notifications'import { useDeleteModel } from '@/service/use-models'import { useAuthService } from './use-auth-service'diff --git a/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/credential-panel.spec.tsx b/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/credential-panel.spec.tsxindex d3e9231dbd9..d6e5b29471f 100644--- a/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/credential-panel.spec.tsx+++ b/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/credential-panel.spec.tsx@@ -29,7 +29,7 @@ const {mockChangePriorityFn: vi.fn().mockResolvedValue({ result: 'success' }),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({default: { notify: mockToastNotify },toast: {success: (message: string) => mockToastNotify({ type: 'success', message }),diff --git a/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/model-list.dynamic-import.spec.tsx b/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/model-list.dynamic-import.spec.tsxindex 32ee443c2f2..d6a1a253fe7 100644--- a/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/model-list.dynamic-import.spec.tsx+++ b/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/model-list.dynamic-import.spec.tsx@@ -21,7 +21,7 @@ vi.mock('../../hooks', () => ({}),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: mockToastError,},diff --git a/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/model-list.spec.tsx b/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/model-list.spec.tsxindex cd34dcf3190..d925fe5ec90 100644--- a/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/model-list.spec.tsx+++ b/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/model-list.spec.tsx@@ -32,7 +32,7 @@ vi.mock('../../hooks', () => ({}),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: mockToastError,},diff --git a/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/model-load-balancing-modal.spec.tsx b/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/model-load-balancing-modal.spec.tsxindex dded8cc2881..3880d6d2a40 100644--- a/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/model-load-balancing-modal.spec.tsx+++ b/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/model-load-balancing-modal.spec.tsx@@ -56,8 +56,8 @@ let mockCredentialData: CredentialData | undefined = {current_credential_name: 'Default',}-vi.mock('@langgenius/dify-ui/toast', async (importOriginal) => {- const actual = await importOriginal<typeof import('@langgenius/dify-ui/toast')>()+vi.mock('@/app/notifications', async (importOriginal) => {+ const actual = await importOriginal<typeof import('@/app/notifications')>()return {...actual,default: {diff --git a/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/use-change-provider-priority.spec.ts b/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/use-change-provider-priority.spec.tsindex ce2247fd7ce..1d86dc9807a 100644--- a/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/use-change-provider-priority.spec.ts+++ b/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/use-change-provider-priority.spec.ts@@ -24,7 +24,7 @@ const mockMutationOptions = vi.fn((options: Record<string, unknown>) => ({...options,}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({default: {notify: (...args: unknown[]) => mockNotify(...args),},diff --git a/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-auth-dropdown/__tests__/use-activate-credential.spec.tsx b/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-auth-dropdown/__tests__/use-activate-credential.spec.tsxindex d9331e04e8f..c8acafef9cf 100644--- a/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-auth-dropdown/__tests__/use-activate-credential.spec.tsx+++ b/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-auth-dropdown/__tests__/use-activate-credential.spec.tsx@@ -1,6 +1,6 @@import type { Credential, ModelProvider } from '../../../declarations'-import { toast } from '@langgenius/dify-ui/toast'import { act, renderHook } from '@testing-library/react'+import { toast } from '@/app/notifications'import { useActivateCredential } from '../use-activate-credential'const mockMutate = vi.fn()diff --git a/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-auth-dropdown/use-activate-credential.ts b/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-auth-dropdown/use-activate-credential.tsindex 1c7d2a13770..98f67b6ce56 100644--- a/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-auth-dropdown/use-activate-credential.ts+++ b/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-auth-dropdown/use-activate-credential.ts@@ -1,7 +1,7 @@import type { Credential, ModelProvider } from '../../declarations'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback, useEffect, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { useActiveProviderCredential } from '@/service/use-models'import { useUpdateModelList, useUpdateModelProviders } from '../../hooks'diff --git a/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-list.tsx b/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-list.tsxindex 327c77aebc7..3d8015f1588 100644--- a/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-list.tsx+++ b/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-list.tsx@@ -3,10 +3,10 @@ import type { ComponentType, FC } from 'react'import type { Credential, ModelItem, ModelProvider } from '../declarations'import type { ModelLoadBalancingModalProps } from './model-load-balancing-modal'import { Dialog, DialogContent, DialogTitle } from '@langgenius/dify-ui/dialog'-import { toast } from '@langgenius/dify-ui/toast'import { useAtomValue } from 'jotai'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { hasPermission } from '@/utils/permission'import { ConfigurationMethodEnum } from '../declarations'diff --git a/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-load-balancing-modal.tsx b/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-load-balancing-modal.tsxindex 838b287eac3..1275275327f 100644--- a/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-load-balancing-modal.tsx+++ b/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-load-balancing-modal.tsx@@ -17,11 +17,11 @@ import {import { Button } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'import { Dialog, DialogContent, DialogTitle } from '@langgenius/dify-ui/dialog'-import { toast } from '@langgenius/dify-ui/toast'import { memo, useCallback, useEffect, useMemo, useState } from 'react'import { useTranslation } from 'react-i18next'import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder'import { SwitchCredentialInLoadBalancing } from '@/app/components/header/account-setting/model-provider-page/model-auth'+import { toast } from '@/app/notifications'import { useGetModelCredential, useUpdateModelLoadBalancingConfig } from '@/service/use-models'import { ConfigurationMethodEnum, FormTypeEnum } from '../declarations'import { useRefreshModel } from '../hooks'diff --git a/web/app/components/header/account-setting/model-provider-page/provider-added-card/use-change-provider-priority.ts b/web/app/components/header/account-setting/model-provider-page/provider-added-card/use-change-provider-priority.tsindex 71339c9b5ce..d05cf2e7287 100644--- a/web/app/components/header/account-setting/model-provider-page/provider-added-card/use-change-provider-priority.ts+++ b/web/app/components/header/account-setting/model-provider-page/provider-added-card/use-change-provider-priority.ts@@ -1,8 +1,8 @@import type { ModelProviderSummaryResponse } from '@dify/contracts/api/console/workspaces/types.gen'import type { ModelProvider, PreferredProviderTypeEnum } from '../declarations'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useQueryClient } from '@tanstack/react-query'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { consoleQuery } from '@/service/console'import { ConfigurationMethodEnum } from '../declarations'import { useUpdateModelList, useUpdateModelProviders } from '../hooks'diff --git a/web/app/components/header/account-setting/model-provider-page/system-model-selector/__tests__/index.spec.tsx b/web/app/components/header/account-setting/model-provider-page/system-model-selector/__tests__/index.spec.tsxindex 7e2dbaa169a..fab82b7341e 100644--- a/web/app/components/header/account-setting/model-provider-page/system-model-selector/__tests__/index.spec.tsx+++ b/web/app/components/header/account-setting/model-provider-page/system-model-selector/__tests__/index.spec.tsx@@ -53,8 +53,8 @@ vi.mock('@/context/permission-state', async () => {}))})-vi.mock('@langgenius/dify-ui/toast', async (importOriginal) => {- const actual = await importOriginal<typeof import('@langgenius/dify-ui/toast')>()+vi.mock('@/app/notifications', async (importOriginal) => {+ const actual = await importOriginal<typeof import('@/app/notifications')>()return {...actual,toast: {diff --git a/web/app/components/header/account-setting/model-provider-page/system-model-selector/index.tsx b/web/app/components/header/account-setting/model-provider-page/system-model-selector/index.tsxindex aae33c99393..491b6721e64 100644--- a/web/app/components/header/account-setting/model-provider-page/system-model-selector/index.tsx+++ b/web/app/components/header/account-setting/model-provider-page/system-model-selector/index.tsx@@ -4,13 +4,13 @@ import { Button } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'import { Dialog, DialogClose, DialogContent, DialogTitle } from '@langgenius/dify-ui/dialog'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { useQuery } from '@tanstack/react-query'import { useAtomValue } from 'jotai'import { parseAsStringLiteral, useQueryState } from 'nuqs'import { useState } from 'react'import { useTranslation } from 'react-i18next'import { Infotip } from '@/app/components/base/infotip'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { updateDefaultModel } from '@/service/common'import { consoleQuery } from '@/service/console'diff --git a/web/app/components/header/account-setting/permissions-page/__tests__/index.spec.tsx b/web/app/components/header/account-setting/permissions-page/__tests__/index.spec.tsxindex 7f9ea498088..cd538617f16 100644--- a/web/app/components/header/account-setting/permissions-page/__tests__/index.spec.tsx+++ b/web/app/components/header/account-setting/permissions-page/__tests__/index.spec.tsx@@ -1,7 +1,7 @@import type { Role } from '@/models/access-control'-import { toast } from '@langgenius/dify-ui/toast'import { screen, within } from '@testing-library/react'import userEvent from '@testing-library/user-event'+import { toast } from '@/app/notifications'import {useCreateWorkspaceRole,useUpdateWorkspaceRole,@@ -16,7 +16,7 @@ const mocks = vi.hoisted(() => ({updateWorkspaceRole: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: vi.fn(),},diff --git a/web/app/components/header/account-setting/permissions-page/index.tsx b/web/app/components/header/account-setting/permissions-page/index.tsxindex dd4b1fdc7c4..305ee6341f2 100644--- a/web/app/components/header/account-setting/permissions-page/index.tsx+++ b/web/app/components/header/account-setting/permissions-page/index.tsx@@ -3,11 +3,11 @@import type { RoleModalMode, submitRoleData } from './role-modal'import type { Role } from '@/models/access-control'import { Button } from '@langgenius/dify-ui/button'-import { toast } from '@langgenius/dify-ui/toast'import { useAtomValue } from 'jotai'import { useCallback, useEffect, useMemo, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import { useLocale } from '#i18n'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { getAccessControlTemplateLanguage } from '@/i18n/language'import {diff --git a/web/app/components/header/account-setting/permissions-page/role-list/__tests__/row-menu.spec.tsx b/web/app/components/header/account-setting/permissions-page/role-list/__tests__/row-menu.spec.tsxindex 42d4503b353..0e975884a67 100644--- a/web/app/components/header/account-setting/permissions-page/role-list/__tests__/row-menu.spec.tsx+++ b/web/app/components/header/account-setting/permissions-page/role-list/__tests__/row-menu.spec.tsx@@ -52,7 +52,7 @@ vi.mock('@/service/access-control/use-workspace-roles', () => ({useGetMembersOfRole: membersOfRoleQueryMock.useGetMembersOfRole,}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: vi.fn(),},diff --git a/web/app/components/header/account-setting/permissions-page/role-list/row-menu.tsx b/web/app/components/header/account-setting/permissions-page/role-list/row-menu.tsxindex 49ddf1825d3..167490c671b 100644--- a/web/app/components/header/account-setting/permissions-page/role-list/row-menu.tsx+++ b/web/app/components/header/account-setting/permissions-page/role-list/row-menu.tsx@@ -17,10 +17,10 @@ import {DropdownMenuTrigger,} from '@langgenius/dify-ui/dropdown-menu'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { useAtomValue } from 'jotai'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import {useCopyWorkspaceRole,diff --git a/web/app/components/header/account-setting/preference-page/__tests__/index.spec.tsx b/web/app/components/header/account-setting/preference-page/__tests__/index.spec.tsxindex 494c1479bd0..a1e0af6e721 100644--- a/web/app/components/header/account-setting/preference-page/__tests__/index.spec.tsx+++ b/web/app/components/header/account-setting/preference-page/__tests__/index.spec.tsx@@ -1,8 +1,8 @@import type { GetAccountProfileResponse } from '@dify/contracts/api/console/account/types.gen'-import { ToastHost } from '@langgenius/dify-ui/toast'import { QueryClientProvider } from '@tanstack/react-query'import { screen, waitFor, within } from '@testing-library/react'import userEvent from '@testing-library/user-event'+import { AppToastHost } from '@/app/notifications/host'import { languages } from '@/i18n/language'import { createAccountProfileQueryClient } from '@/test/console/account-profile'import { render } from '@/test/console/render'@@ -53,7 +53,7 @@ const renderPage = () => {return render(<QueryClientProvider client={queryClient}><PreferencePage />- <ToastHost />+ <AppToastHost /></QueryClientProvider>,)}diff --git a/web/app/components/header/account-setting/preference-page/index.tsx b/web/app/components/header/account-setting/preference-page/index.tsxindex 281c09a4f9f..e30061acf0b 100644--- a/web/app/components/header/account-setting/preference-page/index.tsx+++ b/web/app/components/header/account-setting/preference-page/index.tsx@@ -8,12 +8,12 @@ import {SelectItemText,SelectTrigger,} from '@langgenius/dify-ui/select'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useSuspenseQuery } from '@tanstack/react-query'import { useTheme } from 'next-themes'import { useState } from 'react'import { useTranslation } from 'react-i18next'import { useLocale } from '#i18n'+import { toast } from '@/app/notifications'import { userProfileQueryOptions } from '@/features/account-profile/client'import { setLocaleOnClient } from '@/i18n/client'import { languages } from '@/i18n/language'diff --git a/web/app/components/header/account-setting/update-setting-dialog.tsx b/web/app/components/header/account-setting/update-setting-dialog.tsxindex 5ce51580d87..756f40052c3 100644--- a/web/app/components/header/account-setting/update-setting-dialog.tsx+++ b/web/app/components/header/account-setting/update-setting-dialog.tsx@@ -15,7 +15,6 @@ import {DialogTrigger,} from '@langgenius/dify-ui/dialog'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { useSuspenseQuery } from '@tanstack/react-query'import { useCallback, useMemo, useState } from 'react'import { useTranslation } from 'react-i18next'@@ -30,6 +29,7 @@ import {dayjsToTimeOfDay,timeOfDayToDayjs,} from '@/app/components/plugins/reference-setting-modal/auto-update-setting/utils'+import { toast } from '@/app/notifications'import { userProfileQueryOptions } from '@/features/account-profile/client'import {useMutationPluginAutoUpgradeSettings,diff --git a/web/app/components/header/account-setting/workflow-log-archives-page/index.tsx b/web/app/components/header/account-setting/workflow-log-archives-page/index.tsxindex 96950b8fbd2..c1053deaefc 100644--- a/web/app/components/header/account-setting/workflow-log-archives-page/index.tsx+++ b/web/app/components/header/account-setting/workflow-log-archives-page/index.tsx@@ -7,7 +7,6 @@ import type {} from '@dify/contracts/api/console/workflow-run-archives/types.gen'import { Button } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'import { skipToken, useMutation, useQuery, useSuspenseQuery } from '@tanstack/react-query'import { useQueryState } from 'nuqs'@@ -18,6 +17,7 @@ import {pricingQueryParamName,pricingQueryParser,} from '@/app/components/billing/pricing/query-params'+import { toast } from '@/app/notifications'import { API_PREFIX } from '@/config'import { systemFeaturesQueryOptions } from '@/features/system-features/client'import { consoleQuery } from '@/service/console'diff --git a/web/app/components/main-nav/__tests__/index.spec.tsx b/web/app/components/main-nav/__tests__/index.spec.tsxindex f98ae8b8ee0..268e40b442b 100644--- a/web/app/components/main-nav/__tests__/index.spec.tsx+++ b/web/app/components/main-nav/__tests__/index.spec.tsx@@ -364,8 +364,8 @@ vi.mock('@/service/console', async (importOriginal) => {}})-vi.mock('@langgenius/dify-ui/toast', async (importOriginal) => {- const actual = await importOriginal<typeof import('@langgenius/dify-ui/toast')>()+vi.mock('@/app/notifications', async (importOriginal) => {+ const actual = await importOriginal<typeof import('@/app/notifications')>()return {...actual,toast: {diff --git a/web/app/components/main-nav/components/__tests__/support-menu.spec.tsx b/web/app/components/main-nav/components/__tests__/support-menu.spec.tsxindex d91f1d0fc45..7ae225de38d 100644--- a/web/app/components/main-nav/components/__tests__/support-menu.spec.tsx+++ b/web/app/components/main-nav/components/__tests__/support-menu.spec.tsx@@ -40,7 +40,7 @@ vi.mock('@/app/components/base/zendesk/runtime', () => ({},}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: { error: mockToastError },}))diff --git a/web/app/components/main-nav/components/support-menu.tsx b/web/app/components/main-nav/components/support-menu.tsxindex 928e6334bdf..69f988b77dd 100644--- a/web/app/components/main-nav/components/support-menu.tsx+++ b/web/app/components/main-nav/components/support-menu.tsx@@ -1,5 +1,4 @@import { DropdownMenuItem, DropdownMenuLinkItem } from '@langgenius/dify-ui/dropdown-menu'-import { toast } from '@langgenius/dify-ui/toast'import { useQuery, useSuspenseQuery } from '@tanstack/react-query'import { useQueryState } from 'nuqs'import { useTranslation } from 'react-i18next'@@ -13,6 +12,7 @@ import {MenuItemContent,} from '@/app/components/header/account-dropdown/menu-item-content'import { generateMailToLink, mailToSupport } from '@/app/components/header/utils/util'+import { toast } from '@/app/notifications'import { SUPPORT_EMAIL_ADDRESS, ZENDESK_WIDGET_KEY } from '@/config'import { userProfileQueryOptions } from '@/features/account-profile/client'import { systemFeaturesQueryOptions } from '@/features/system-features/client'diff --git a/web/app/components/main-nav/components/web-apps-section.tsx b/web/app/components/main-nav/components/web-apps-section.tsxindex 9ee92db5211..bdeac549470 100644--- a/web/app/components/main-nav/components/web-apps-section.tsx+++ b/web/app/components/main-nav/components/web-apps-section.tsx@@ -24,7 +24,6 @@ import {ScrollAreaThumb,ScrollAreaViewport,} from '@langgenius/dify-ui/scroll-area'-import { toast } from '@langgenius/dify-ui/toast'import { keepPreviousData, useInfiniteQuery, useMutation } from '@tanstack/react-query'import { defaultRangeExtractor, useVirtualizer } from '@tanstack/react-virtual'import { useAtomValue } from 'jotai'@@ -37,6 +36,7 @@ import { SearchInput } from '@/app/components/base/search-input'import AppNavItem from '@/app/components/explore/installed-app-navigation/app-nav-item'import { InstalledAppPaginationSkeleton } from '@/app/components/explore/installed-app-navigation/pagination-skeleton'import { isInstalledAppPath } from '@/app/components/explore/installed-app/routes'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { usePathname } from '@/next/navigation'import { consoleQuery } from '@/service/console'diff --git a/web/app/components/main-nav/components/workspace-card.tsx b/web/app/components/main-nav/components/workspace-card.tsxindex 9edcf19652e..695aec921e6 100644--- a/web/app/components/main-nav/components/workspace-card.tsx+++ b/web/app/components/main-nav/components/workspace-card.tsx@@ -4,7 +4,6 @@ import type { GetWorkspacesCurrentSummaryResponse } from '@dify/contracts/api/coimport type { ReactNode } from 'react'import { cn } from '@langgenius/dify-ui/cn'import { Popover, PopoverContent, PopoverTitle, PopoverTrigger } from '@langgenius/dify-ui/popover'-import { toast } from '@langgenius/dify-ui/toast'import {noop,useMutation,@@ -27,6 +26,7 @@ import {} from '@/app/components/header/account-setting/query-params'import LicenseBadge from '@/app/components/header/license-badge'import { buildIntegrationPath } from '@/app/components/integrations/routes'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { systemFeaturesQueryOptions } from '@/features/system-features/client'import Link from '@/next/link'diff --git a/web/app/components/plugins/install-plugin/__tests__/hooks.spec.ts b/web/app/components/plugins/install-plugin/__tests__/hooks.spec.tsindex f00eced0a2d..e4daa471cac 100644--- a/web/app/components/plugins/install-plugin/__tests__/hooks.spec.ts+++ b/web/app/components/plugins/install-plugin/__tests__/hooks.spec.ts@@ -6,7 +6,7 @@ const { mockToastError, mockUploadGitHub } = vi.hoisted(() => ({mockUploadGitHub: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: mockToastError,},diff --git a/web/app/components/plugins/install-plugin/hooks.ts b/web/app/components/plugins/install-plugin/hooks.tsindex f6b0abf28dd..ffcb2b4441a 100644--- a/web/app/components/plugins/install-plugin/hooks.ts+++ b/web/app/components/plugins/install-plugin/hooks.ts@@ -1,5 +1,5 @@import type { GitHubRepoReleaseResponse } from '../types'-import { toast } from '@langgenius/dify-ui/toast'+import { toast } from '@/app/notifications'import { uploadGitHub } from '@/service/plugins'import { compareVersion, getLatestVersion } from '@/utils/semver'diff --git a/web/app/components/plugins/install-plugin/install-from-github/__tests__/index.spec.tsx b/web/app/components/plugins/install-plugin/install-from-github/__tests__/index.spec.tsxindex 38a39753ea0..79c628a0b60 100644--- a/web/app/components/plugins/install-plugin/install-from-github/__tests__/index.spec.tsx+++ b/web/app/components/plugins/install-plugin/install-from-github/__tests__/index.spec.tsx@@ -84,7 +84,7 @@ const createUpdatePayload = (// Mock external dependenciesconst mockNotify = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: Object.assign((props: { type: string; message: string }) => mockNotify(props), {success: (message: string) => mockNotify({ type: 'success', message }),error: (message: string) => mockNotify({ type: 'error', message }),diff --git a/web/app/components/plugins/install-plugin/install-from-github/index.tsx b/web/app/components/plugins/install-plugin/install-from-github/index.tsxindex c599227ff1b..58745548189 100644--- a/web/app/components/plugins/install-plugin/install-from-github/index.tsx+++ b/web/app/components/plugins/install-plugin/install-from-github/index.tsx@@ -8,11 +8,11 @@ import { Field, FieldLabel } from '@langgenius/dify-ui/field'import { Form } from '@langgenius/dify-ui/form'import { IconButton } from '@langgenius/dify-ui/icon-button'import { Input } from '@langgenius/dify-ui/input'-import { toast } from '@langgenius/dify-ui/toast'import * as React from 'react'import { useCallback, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import useGetIcon from '@/app/components/plugins/install-plugin/base/use-get-icon'+import { toast } from '@/app/notifications'import { InstallStepFromGitHub } from '../../types'import Installed from '../base/installed'import { fetchReleases } from '../hooks'diff --git a/web/app/components/plugins/plugin-auth/authorize/__tests__/api-key-modal.spec.tsx b/web/app/components/plugins/plugin-auth/authorize/__tests__/api-key-modal.spec.tsxindex a3c27c71e38..1ddbb3f9dd4 100644--- a/web/app/components/plugins/plugin-auth/authorize/__tests__/api-key-modal.spec.tsx+++ b/web/app/components/plugins/plugin-auth/authorize/__tests__/api-key-modal.spec.tsx@@ -28,7 +28,7 @@ const { mockToast } = vi.hoisted(() => {}})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: mockToast,}))diff --git a/web/app/components/plugins/plugin-auth/authorize/__tests__/authorize-components.spec.tsx b/web/app/components/plugins/plugin-auth/authorize/__tests__/authorize-components.spec.tsxindex d7cb0c17665..7b42d4409dc 100644--- a/web/app/components/plugins/plugin-auth/authorize/__tests__/authorize-components.spec.tsx+++ b/web/app/components/plugins/plugin-auth/authorize/__tests__/authorize-components.spec.tsx@@ -97,7 +97,7 @@ const { mockToast } = vi.hoisted(() => {}})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: mockToast,}))diff --git a/web/app/components/plugins/plugin-auth/authorize/__tests__/oauth-client-settings.spec.tsx b/web/app/components/plugins/plugin-auth/authorize/__tests__/oauth-client-settings.spec.tsxindex 6df82b7e112..e3ad0b19dca 100644--- a/web/app/components/plugins/plugin-auth/authorize/__tests__/oauth-client-settings.spec.tsx+++ b/web/app/components/plugins/plugin-auth/authorize/__tests__/oauth-client-settings.spec.tsx@@ -22,7 +22,7 @@ const mockToast = {promise: vi.fn(),}-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: mockToast,}))const mockSetPluginOAuthCustomClient = vi.fn().mockResolvedValue({})diff --git a/web/app/components/plugins/plugin-auth/authorize/api-key-modal.tsx b/web/app/components/plugins/plugin-auth/authorize/api-key-modal.tsxindex 8e9d4839bc5..a88e48fdfaf 100644--- a/web/app/components/plugins/plugin-auth/authorize/api-key-modal.tsx+++ b/web/app/components/plugins/plugin-auth/authorize/api-key-modal.tsx@@ -4,13 +4,13 @@ import type { CredentialPermission } from '@/models/permission'import { Button } from '@langgenius/dify-ui/button'import { Dialog, DialogClose, DialogContent, DialogTitle } from '@langgenius/dify-ui/dialog'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { memo, useCallback, useMemo, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import { EncryptedBottom } from '@/app/components/base/encrypted-bottom'import AuthForm from '@/app/components/base/form/form-scenarios/auth'import { FormTypeEnum } from '@/app/components/base/form/types'import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder'+import { toast } from '@/app/notifications'import { PermissionLevel } from '@/models/permission'import { ReadmeEntrance } from '../../readme-panel/entrance'import {diff --git a/web/app/components/plugins/plugin-auth/authorize/oauth-client-settings.tsx b/web/app/components/plugins/plugin-auth/authorize/oauth-client-settings.tsxindex c2c6aa22ffd..6296cec2202 100644--- a/web/app/components/plugins/plugin-auth/authorize/oauth-client-settings.tsx+++ b/web/app/components/plugins/plugin-auth/authorize/oauth-client-settings.tsx@@ -3,11 +3,11 @@ import type { FormRefObject, FormSchema } from '@/app/components/base/form/typesimport { Button } from '@langgenius/dify-ui/button'import { Dialog, DialogClose, DialogContent, DialogTitle } from '@langgenius/dify-ui/dialog'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { useForm, useStore } from '@tanstack/react-form'import { memo, useCallback, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import AuthForm from '@/app/components/base/form/form-scenarios/auth'+import { toast } from '@/app/notifications'import { ReadmeEntrance } from '../../readme-panel/entrance'import {useDeletePluginOAuthCustomClientHook,diff --git a/web/app/components/plugins/plugin-auth/authorized/__tests__/index.spec.tsx b/web/app/components/plugins/plugin-auth/authorized/__tests__/index.spec.tsxindex d67b349ff88..0f8a8d29892 100644--- a/web/app/components/plugins/plugin-auth/authorized/__tests__/index.spec.tsx+++ b/web/app/components/plugins/plugin-auth/authorized/__tests__/index.spec.tsx@@ -59,7 +59,7 @@ const toastMocks = vi.hoisted(() => ({promise: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: Object.assign(toastMocks.call, {success: vi.fn((message: string, options?: Record<string, unknown>) =>toastMocks.call({ type: 'success', message, ...options }),diff --git a/web/app/components/plugins/plugin-auth/authorized/index.tsx b/web/app/components/plugins/plugin-auth/authorized/index.tsxindex 9a72b52e429..9c2325c9328 100644--- a/web/app/components/plugins/plugin-auth/authorized/index.tsx+++ b/web/app/components/plugins/plugin-auth/authorized/index.tsx@@ -13,9 +13,9 @@ import { Button } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'import { Popover, PopoverContent, PopoverTrigger } from '@langgenius/dify-ui/popover'import { StatusDot } from '@langgenius/dify-ui/status-dot'-import { toast } from '@langgenius/dify-ui/toast'import { memo, useCallback, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { useCredentialPermissions } from '@/hooks/use-credential-permissions'import Authorize from '../authorize'import ApiKeyModal from '../authorize/api-key-modal'diff --git a/web/app/components/plugins/plugin-auth/hooks/__tests__/use-plugin-auth-action.spec.ts b/web/app/components/plugins/plugin-auth/hooks/__tests__/use-plugin-auth-action.spec.tsindex 366f69d3af5..f5ac3845f61 100644--- a/web/app/components/plugins/plugin-auth/hooks/__tests__/use-plugin-auth-action.spec.ts+++ b/web/app/components/plugins/plugin-auth/hooks/__tests__/use-plugin-auth-action.spec.ts@@ -16,7 +16,7 @@ const toastMocks = vi.hoisted(() => ({promise: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: Object.assign(toastMocks.call, {success: vi.fn((message: string, options?: Record<string, unknown>) =>toastMocks.call({ type: 'success', message, ...options }),diff --git a/web/app/components/plugins/plugin-auth/hooks/use-plugin-auth-action.ts b/web/app/components/plugins/plugin-auth/hooks/use-plugin-auth-action.tsindex f62ba05eb35..13a12965da5 100644--- a/web/app/components/plugins/plugin-auth/hooks/use-plugin-auth-action.ts+++ b/web/app/components/plugins/plugin-auth/hooks/use-plugin-auth-action.ts@@ -1,7 +1,7 @@import type { PluginPayload } from '../types'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import {useDeletePluginCredentialHook,useSetPluginDefaultCredentialHook,diff --git a/web/app/components/plugins/plugin-detail-panel/__tests__/endpoint-card.spec.tsx b/web/app/components/plugins/plugin-detail-panel/__tests__/endpoint-card.spec.tsxindex 1502069bc6c..17b6b5fe3e9 100644--- a/web/app/components/plugins/plugin-detail-panel/__tests__/endpoint-card.spec.tsx+++ b/web/app/components/plugins/plugin-detail-panel/__tests__/endpoint-card.spec.tsx@@ -15,7 +15,7 @@ const getEditButton = () => screen.getByRole('button', { name: 'common.operationconst getDeleteButton = () => screen.getByRole('button', { name: 'common.operation.delete' })const getCopyButton = () => screen.getByRole('button', { name: 'common.operation.copy' })-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: Object.assign((message: string, options?: { type?: string }) =>mockToastNotify({ type: options?.type, message }),diff --git a/web/app/components/plugins/plugin-detail-panel/__tests__/endpoint-modal.spec.tsx b/web/app/components/plugins/plugin-detail-panel/__tests__/endpoint-modal.spec.tsxindex a42223a8592..008ce84d138 100644--- a/web/app/components/plugins/plugin-detail-panel/__tests__/endpoint-modal.spec.tsx+++ b/web/app/components/plugins/plugin-detail-panel/__tests__/endpoint-modal.spec.tsx@@ -6,7 +6,7 @@ import EndpointModal from '../endpoint-modal'const mockToastNotify = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: Object.assign((message: string, options?: { type?: string }) =>mockToastNotify({ type: options?.type, message }),diff --git a/web/app/components/plugins/plugin-detail-panel/detail-header/hooks/__tests__/use-plugin-operations.spec.ts b/web/app/components/plugins/plugin-detail-panel/detail-header/hooks/__tests__/use-plugin-operations.spec.tsindex db8dc0ac74c..1247538b42d 100644--- a/web/app/components/plugins/plugin-detail-panel/detail-header/hooks/__tests__/use-plugin-operations.spec.ts+++ b/web/app/components/plugins/plugin-detail-panel/detail-header/hooks/__tests__/use-plugin-operations.spec.ts@@ -34,7 +34,7 @@ const {}})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: Object.assign((message: string, options?: { type?: string }) =>mockToastNotify({ type: options?.type, message }),diff --git a/web/app/components/plugins/plugin-detail-panel/detail-header/hooks/use-plugin-operations.ts b/web/app/components/plugins/plugin-detail-panel/detail-header/hooks/use-plugin-operations.tsindex 30005bdb255..e2b4d31d739 100644--- a/web/app/components/plugins/plugin-detail-panel/detail-header/hooks/use-plugin-operations.ts+++ b/web/app/components/plugins/plugin-detail-panel/detail-header/hooks/use-plugin-operations.ts@@ -2,11 +2,11 @@import type { PluginDetail } from '../../../types'import type { ModalStates, VersionTarget } from './use-detail-header-state'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback } from 'react'import { useTranslation } from 'react-i18next'import { trackEvent } from '@/app/components/base/amplitude'import useRefreshPluginList from '@/app/components/plugins/install-plugin/hooks/use-refresh-plugin-list'+import { toast } from '@/app/notifications'import { useModalContext } from '@/context/modal-context'import { uninstallPlugin } from '@/service/plugins'import { useInvalidateCheckInstalled } from '@/service/use-plugins'diff --git a/web/app/components/plugins/plugin-detail-panel/endpoint-card.tsx b/web/app/components/plugins/plugin-detail-panel/endpoint-card.tsxindex ea1d4bdc5b1..20ce15f0ce2 100644--- a/web/app/components/plugins/plugin-detail-panel/endpoint-card.tsx+++ b/web/app/components/plugins/plugin-detail-panel/endpoint-card.tsx@@ -11,7 +11,6 @@ import {import { IconButton } from '@langgenius/dify-ui/icon-button'import { StatusDot } from '@langgenius/dify-ui/status-dot'import { Switch } from '@langgenius/dify-ui/switch'-import { toast } from '@langgenius/dify-ui/toast'import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'import { useBoolean } from 'ahooks'import copy from 'copy-to-clipboard'@@ -22,6 +21,7 @@ import {addDefaultValue,toolCredentialToFormSchemas,} from '@/app/components/tools/utils/to-form-schema'+import { toast } from '@/app/notifications'import {useDeleteEndpoint,useDisableEndpoint,diff --git a/web/app/components/plugins/plugin-detail-panel/endpoint-list.tsx b/web/app/components/plugins/plugin-detail-panel/endpoint-list.tsxindex 4b8ed551d7e..0bc82f5f948 100644--- a/web/app/components/plugins/plugin-detail-panel/endpoint-list.tsx+++ b/web/app/components/plugins/plugin-detail-panel/endpoint-list.tsx@@ -2,12 +2,12 @@ import type { PluginDetail } from '@/app/components/plugins/types'import { cn } from '@langgenius/dify-ui/cn'import { IconButton } from '@langgenius/dify-ui/icon-button'import { Popover, PopoverContent, PopoverTrigger } from '@langgenius/dify-ui/popover'-import { toast } from '@langgenius/dify-ui/toast'import { useBoolean } from 'ahooks'import * as React from 'react'import { useMemo } from 'react'import { useTranslation } from 'react-i18next'import { toolCredentialToFormSchemas } from '@/app/components/tools/utils/to-form-schema'+import { toast } from '@/app/notifications'import { useDocLink } from '@/context/i18n'import {useCreateEndpoint,diff --git a/web/app/components/plugins/plugin-detail-panel/endpoint-modal.tsx b/web/app/components/plugins/plugin-detail-panel/endpoint-modal.tsxindex 551a749e2d8..f9e9e1f0aa5 100644--- a/web/app/components/plugins/plugin-detail-panel/endpoint-modal.tsx+++ b/web/app/components/plugins/plugin-detail-panel/endpoint-modal.tsx@@ -13,11 +13,11 @@ import {DrawerViewport,} from '@langgenius/dify-ui/drawer'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { RiArrowRightUpLine, RiCloseLine } from '@remixicon/react'import * as React from 'react'import { useTranslation } from 'react-i18next'import Form from '@/app/components/header/account-setting/model-provider-page/model-modal/Form'+import { toast } from '@/app/notifications'import { useRenderI18nObject } from '@/hooks/use-i18n'import { ReadmeEntrance } from '../readme-panel/entrance'diff --git a/web/app/components/plugins/plugin-detail-panel/model-selector/__tests__/index.spec.tsx b/web/app/components/plugins/plugin-detail-panel/model-selector/__tests__/index.spec.tsxindex 851ef468771..4d38c62adea 100644--- a/web/app/components/plugins/plugin-detail-panel/model-selector/__tests__/index.spec.tsx+++ b/web/app/components/plugins/plugin-detail-panel/model-selector/__tests__/index.spec.tsx@@ -18,7 +18,7 @@ import ModelParameterModal from '../index'// ==================== Mock Setup ====================const mockToastNotify = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: Object.assign((message: string, options?: { type?: string }) =>mockToastNotify({ type: options?.type, message }),diff --git a/web/app/components/plugins/plugin-detail-panel/model-selector/index.tsx b/web/app/components/plugins/plugin-detail-panel/model-selector/index.tsxindex f19ffcb8ac3..3a49bcbfab2 100644--- a/web/app/components/plugins/plugin-detail-panel/model-selector/index.tsx+++ b/web/app/components/plugins/plugin-detail-panel/model-selector/index.tsx@@ -6,7 +6,6 @@ import type {import type { ModelSelectorValue } from '@/app/components/header/account-setting/model-provider-page/model-selector/types'import { cn } from '@langgenius/dify-ui/cn'import { Popover, PopoverContent } from '@langgenius/dify-ui/popover'-import { toast } from '@langgenius/dify-ui/toast'import { useQuery } from '@tanstack/react-query'import { useMemo, useState } from 'react'import { useTranslation } from 'react-i18next'@@ -16,6 +15,7 @@ import {} from '@/app/components/header/account-setting/model-provider-page/declarations'import { ModelSettingsTrigger } from '@/app/components/header/account-setting/model-provider-page/model-parameter-modal/model-settings-trigger'import { SplitModelSelector } from '@/app/components/header/account-setting/model-provider-page/model-selector'+import { toast } from '@/app/notifications'import { consoleQuery } from '@/service/console'import { fetchAndMergeValidCompletionParams } from '@/utils/completion-params'import LLMParamsPanel from './llm-params-panel'diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/__tests__/delete-confirm.spec.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/__tests__/delete-confirm.spec.tsxindex 8838cffef8f..876f45935b2 100644--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/__tests__/delete-confirm.spec.tsx+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/__tests__/delete-confirm.spec.tsx@@ -20,8 +20,8 @@ vi.mock('@/service/use-triggers', () => ({}),}))-vi.mock('@langgenius/dify-ui/toast', async (importOriginal) => {- const actual = await importOriginal<typeof import('@langgenius/dify-ui/toast')>()+vi.mock('@/app/notifications', async (importOriginal) => {+ const actual = await importOriginal<typeof import('@/app/notifications')>()return {...actual,toast: {diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/__tests__/log-viewer.spec.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/__tests__/log-viewer.spec.tsxindex bb23c8135ea..16dc2639b31 100644--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/__tests__/log-viewer.spec.tsx+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/__tests__/log-viewer.spec.tsx@@ -6,7 +6,7 @@ import LogViewer from '../log-viewer'const mockToastNotify = vi.fn()const mockWriteText = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: Object.assign((message: string, options?: { type?: string }) =>mockToastNotify({ type: options?.type, message }),diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/__tests__/selector-entry.spec.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/__tests__/selector-entry.spec.tsxindex d743394d4fc..91dffd4e5fc 100644--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/__tests__/selector-entry.spec.tsx+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/__tests__/selector-entry.spec.tsx@@ -27,7 +27,7 @@ vi.mock('@/service/use-triggers', () => ({useDeleteTriggerSubscription: () => ({ mutate: vi.fn(), isPending: false }),}))-vi.mock('@langgenius/dify-ui/toast', async (importOriginal) => ({+vi.mock('@/app/notifications', async (importOriginal) => ({...(await importOriginal()),toast: Object.assign(vi.fn(), {success: vi.fn(),diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/__tests__/selector-view.spec.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/__tests__/selector-view.spec.tsxindex dedf9451fa7..0d9580e5bb3 100644--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/__tests__/selector-view.spec.tsx+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/__tests__/selector-view.spec.tsx@@ -25,7 +25,7 @@ vi.mock('@/service/use-triggers', () => ({useDeleteTriggerSubscription: () => ({ mutate: mockDelete, isPending: false }),}))-vi.mock('@langgenius/dify-ui/toast', async (importOriginal) => ({+vi.mock('@/app/notifications', async (importOriginal) => ({...(await importOriginal()),toast: Object.assign(vi.fn(), {success: vi.fn(),diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/__tests__/subscription-card.spec.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/__tests__/subscription-card.spec.tsxindex a70f8448f03..2105a12a36f 100644--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/__tests__/subscription-card.spec.tsx+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/__tests__/subscription-card.spec.tsx@@ -31,7 +31,7 @@ vi.mock('@/service/use-triggers', () => ({useDeleteTriggerSubscription: () => ({ mutate: vi.fn(), isPending: false }),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: Object.assign(vi.fn(), {success: vi.fn(),error: vi.fn(),diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/__tests__/common-modal.spec.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/__tests__/common-modal.spec.tsxindex f9b7719a75f..8a9216301f3 100644--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/__tests__/common-modal.spec.tsx+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/__tests__/common-modal.spec.tsx@@ -138,7 +138,7 @@ vi.mock('@/utils/urlValidation', () => ({}))const mockToastNotify = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: Object.assign((params: unknown) => mockToastNotify(params), {success: (message: unknown) => mockToastNotify({ type: 'success', message }),error: (message: unknown) => mockToastNotify({ type: 'error', message }),diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/__tests__/index.spec.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/__tests__/index.spec.tsxindex 10376299b19..46c7e251aa0 100644--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/__tests__/index.spec.tsx+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/__tests__/index.spec.tsx@@ -14,7 +14,7 @@ const toastMocks = vi.hoisted(() => ({error: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: toastMocks,}))diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/__tests__/oauth-client.spec.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/__tests__/oauth-client.spec.tsxindex e22a125aafc..6b8cb55b9e1 100644--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/__tests__/oauth-client.spec.tsx+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/__tests__/oauth-client.spec.tsx@@ -103,7 +103,7 @@ vi.mock('@/hooks/use-oauth', () => ({}))const mockToastNotify = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: Object.assign((message: string, options?: { type?: string }) =>mockToastNotify({ type: options?.type, message }),diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/__tests__/use-common-modal-state.helpers.spec.ts b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/__tests__/use-common-modal-state.helpers.spec.tsindex af953735a92..05f105d69fd 100644--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/__tests__/use-common-modal-state.helpers.spec.ts+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/__tests__/use-common-modal-state.helpers.spec.ts@@ -25,7 +25,7 @@ const { mockToastError, mockIsPrivateOrLocalAddress } = vi.hoisted(() => ({mockIsPrivateOrLocalAddress: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: mockToastError,},diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/__tests__/use-common-modal-state.spec.ts b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/__tests__/use-common-modal-state.spec.tsindex bb079785a3b..74443ea3312 100644--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/__tests__/use-common-modal-state.spec.ts+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/__tests__/use-common-modal-state.spec.ts@@ -93,7 +93,7 @@ vi.mock('@/service/use-triggers', () => ({}))const mockToastNotify = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: (message: string) => mockToastNotify({ type: 'success', message }),error: (message: string) => mockToastNotify({ type: 'error', message }),diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/__tests__/use-oauth-client-state.spec.ts b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/__tests__/use-oauth-client-state.spec.tsindex 086e22494dc..8b7acba171a 100644--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/__tests__/use-oauth-client-state.spec.ts+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/__tests__/use-oauth-client-state.spec.ts@@ -93,7 +93,7 @@ vi.mock('@/hooks/use-oauth', () => ({}))const mockToastNotify = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: Object.assign((message: string, options?: { type?: string }) =>mockToastNotify({ type: options?.type, message }),diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/use-common-modal-state.helpers.ts b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/use-common-modal-state.helpers.tsindex ba4c9671e86..7ba99ffeab3 100644--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/use-common-modal-state.helpers.ts+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/use-common-modal-state.helpers.ts@@ -4,9 +4,9 @@ import type { Dispatch, SetStateAction } from 'react'import type { FormRefObject } from '@/app/components/base/form/types'import type { TriggerSubscriptionBuilder } from '@/app/components/workflow/block-selector/types'import type { BuildTriggerSubscriptionPayload } from '@/service/use-triggers'-import { toast } from '@langgenius/dify-ui/toast'import { useEffect, useRef } from 'react'import { SupportedCreationMethods } from '@/app/components/plugins/types'+import { toast } from '@/app/notifications'import { isPrivateOrLocalAddress } from '@/utils/urlValidation'type FormValuesResult = {diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/use-common-modal-state.ts b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/use-common-modal-state.tsindex e092e631be8..13be8852817 100644--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/use-common-modal-state.ts+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/use-common-modal-state.ts@@ -7,12 +7,12 @@ import type {TriggerLogEntity,TriggerSubscriptionBuilder,} from '@/app/components/workflow/block-selector/types'-import { toast } from '@langgenius/dify-ui/toast'import { debounce } from 'es-toolkit/compat'import { useCallback, useEffect, useMemo, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import { SupportedCreationMethods } from '@/app/components/plugins/types'import { TriggerCredentialType } from '@/app/components/workflow/block-selector/types'+import { toast } from '@/app/notifications'import {useBuildTriggerSubscription,useCreateTriggerSubscriptionBuilder,diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/use-oauth-client-state.ts b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/use-oauth-client-state.tsindex 598563a63ac..92bc82b503c 100644--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/use-oauth-client-state.ts+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/hooks/use-oauth-client-state.ts@@ -6,9 +6,9 @@ import type {TriggerSubscriptionBuilder,} from '@/app/components/workflow/block-selector/types'import type { ConfigureTriggerOAuthPayload } from '@/service/use-triggers'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback, useEffect, useMemo, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { openOAuthPopup } from '@/hooks/use-oauth'import {useConfigureTriggerOAuth,diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/index.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/index.tsxindex fa3c9b264c6..108c05a8c92 100644--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/index.tsx+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/index.tsx@@ -9,13 +9,13 @@ import {SelectItemIndicator,SelectTrigger,} from '@langgenius/dify-ui/select'-import { toast } from '@langgenius/dify-ui/toast'import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'import { useBoolean } from 'ahooks'import { useCallback, useMemo, useState } from 'react'import { useTranslation } from 'react-i18next'import Badge from '@/app/components/base/badge'import { Infotip } from '@/app/components/base/infotip'+import { toast } from '@/app/notifications'import { openOAuthPopup } from '@/hooks/use-oauth'import {useInitiateTriggerOAuth,diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/oauth-client.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/oauth-client.tsxindex 56ad1567906..22ab5d89cca 100644--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/create/oauth-client.tsx+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/create/oauth-client.tsx@@ -6,11 +6,11 @@ import type {import { Button } from '@langgenius/dify-ui/button'import { Dialog, DialogClose, DialogContent, DialogTitle } from '@langgenius/dify-ui/dialog'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback } from 'react'import { useTranslation } from 'react-i18next'import { BaseForm } from '@/app/components/base/form/components/base'import OptionCard from '@/app/components/workflow/nodes/_base/components/option-card'+import { toast } from '@/app/notifications'import { usePluginStore } from '../../store'import {ClientTypeEnum,diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/delete-confirm.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/delete-confirm.tsxindex 8f1e281ca17..70ff266ec85 100644--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/delete-confirm.tsx+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/delete-confirm.tsx@@ -9,9 +9,9 @@ import {} from '@langgenius/dify-ui/alert-dialog'import { Field, FieldLabel } from '@langgenius/dify-ui/field'import { Input } from '@langgenius/dify-ui/input'-import { toast } from '@langgenius/dify-ui/toast'import { useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { useDeleteTriggerSubscription } from '@/service/use-triggers'import { useSubscriptionList } from './use-subscription-list'diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/edit/__tests__/index.spec.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/edit/__tests__/index.spec.tsxindex bf30df020d7..75033df8f4b 100644--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/edit/__tests__/index.spec.tsx+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/edit/__tests__/index.spec.tsx@@ -14,7 +14,7 @@ import { OAuthEditModal } from '../oauth-edit-modal'// ==================== Mock Setup ====================const mockToastNotify = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: Object.assign((message: string, options?: { type?: string }) =>mockToastNotify({ type: options?.type, message }),diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/edit/apikey-edit-modal.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/edit/apikey-edit-modal.tsxindex f7cf746c5e3..d98feaeab56 100644--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/edit/apikey-edit-modal.tsx+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/edit/apikey-edit-modal.tsx@@ -5,7 +5,6 @@ import type { TriggerSubscription } from '@/app/components/workflow/block-selectimport { Button } from '@langgenius/dify-ui/button'import { Dialog, DialogClose, DialogContent, DialogTitle } from '@langgenius/dify-ui/dialog'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { isEqual } from 'es-toolkit/predicate'import { useMemo, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'@@ -13,6 +12,7 @@ import { EncryptedBottom } from '@/app/components/base/encrypted-bottom'import { BaseForm } from '@/app/components/base/form/components/base'import { FormTypeEnum } from '@/app/components/base/form/types'import { ReadmeEntrance } from '@/app/components/plugins/readme-panel/entrance'+import { toast } from '@/app/notifications'import { useUpdateTriggerSubscription, useVerifyTriggerSubscription } from '@/service/use-triggers'import { parsePluginErrorMessage } from '@/utils/error-parser'import { usePluginStore } from '../../store'diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/edit/manual-edit-modal.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/edit/manual-edit-modal.tsxindex 8a02883c257..726fea0550c 100644--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/edit/manual-edit-modal.tsx+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/edit/manual-edit-modal.tsx@@ -5,13 +5,13 @@ import type { TriggerSubscription } from '@/app/components/workflow/block-selectimport { Button } from '@langgenius/dify-ui/button'import { Dialog, DialogClose, DialogContent, DialogTitle } from '@langgenius/dify-ui/dialog'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { isEqual } from 'es-toolkit/predicate'import { useMemo, useRef } from 'react'import { useTranslation } from 'react-i18next'import { BaseForm } from '@/app/components/base/form/components/base'import { FormTypeEnum } from '@/app/components/base/form/types'import { ReadmeEntrance } from '@/app/components/plugins/readme-panel/entrance'+import { toast } from '@/app/notifications'import { useUpdateTriggerSubscription } from '@/service/use-triggers'import { usePluginStore } from '../../store'import { useSubscriptionList } from '../use-subscription-list'diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/edit/oauth-edit-modal.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/edit/oauth-edit-modal.tsxindex 2d8edb940b2..a1d90c83cdf 100644--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/edit/oauth-edit-modal.tsx+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/edit/oauth-edit-modal.tsx@@ -5,13 +5,13 @@ import type { TriggerSubscription } from '@/app/components/workflow/block-selectimport { Button } from '@langgenius/dify-ui/button'import { Dialog, DialogClose, DialogContent, DialogTitle } from '@langgenius/dify-ui/dialog'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { isEqual } from 'es-toolkit/predicate'import { useMemo, useRef } from 'react'import { useTranslation } from 'react-i18next'import { BaseForm } from '@/app/components/base/form/components/base'import { FormTypeEnum } from '@/app/components/base/form/types'import { ReadmeEntrance } from '@/app/components/plugins/readme-panel/entrance'+import { toast } from '@/app/notifications'import { useUpdateTriggerSubscription } from '@/service/use-triggers'import { usePluginStore } from '../../store'import { useSubscriptionList } from '../use-subscription-list'diff --git a/web/app/components/plugins/plugin-detail-panel/subscription-list/log-viewer.tsx b/web/app/components/plugins/plugin-detail-panel/subscription-list/log-viewer.tsxindex fa07129742a..e80fa31f880 100644--- a/web/app/components/plugins/plugin-detail-panel/subscription-list/log-viewer.tsx+++ b/web/app/components/plugins/plugin-detail-panel/subscription-list/log-viewer.tsx@@ -1,7 +1,6 @@'use client'import type { TriggerLogEntity } from '@/app/components/workflow/block-selector/types'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import {RiArrowDownSLine,RiArrowRightSLine,@@ -15,6 +14,7 @@ import { useState } from 'react'import { useTranslation } from 'react-i18next'import CodeEditor from '@/app/components/workflow/nodes/_base/components/editor/code-editor'import { CodeLanguage } from '@/app/components/workflow/nodes/code/types'+import { toast } from '@/app/notifications'type Props = Readonly<{logs: TriggerLogEntity[]diff --git a/web/app/components/plugins/plugin-item/__tests__/action.spec.tsx b/web/app/components/plugins/plugin-item/__tests__/action.spec.tsxindex 672e569011c..51095bdb14b 100644--- a/web/app/components/plugins/plugin-item/__tests__/action.spec.tsx+++ b/web/app/components/plugins/plugin-item/__tests__/action.spec.tsx@@ -26,7 +26,7 @@ const {mockToastNotify: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: Object.assign((message: string, options?: { type?: string }) =>mockToastNotify({ type: options?.type, message }),diff --git a/web/app/components/plugins/plugin-item/action.tsx b/web/app/components/plugins/plugin-item/action.tsxindex 0ae0f0e7094..b825d1fc2b0 100644--- a/web/app/components/plugins/plugin-item/action.tsx+++ b/web/app/components/plugins/plugin-item/action.tsx@@ -11,12 +11,12 @@ import {AlertDialogTitle,} from '@langgenius/dify-ui/alert-dialog'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'import { useBoolean } from 'ahooks'import * as React from 'react'import { useCallback } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { useModalContext } from '@/context/modal-context'import { uninstallPlugin } from '@/service/plugins'import { useInvalidateInstalledPluginList } from '@/service/use-plugins'diff --git a/web/app/components/plugins/plugin-page/__tests__/use-reference-setting.spec.ts b/web/app/components/plugins/plugin-page/__tests__/use-reference-setting.spec.tsindex c6b4c319cff..34f7b37f95c 100644--- a/web/app/components/plugins/plugin-page/__tests__/use-reference-setting.spec.ts+++ b/web/app/components/plugins/plugin-page/__tests__/use-reference-setting.spec.ts@@ -1,9 +1,9 @@import type { LangGeniusVersionInfo } from '@/context/app-context-types'// Import mocks for assertionsimport type { ConsoleStateFixture as BaseConsoleStateFixture } from '@/test/console/state-fixture'-import { toast } from '@langgenius/dify-ui/toast'import { waitFor } from '@testing-library/react'import { beforeEach, describe, expect, it, vi } from 'vite-plus/test'+import { toast } from '@/app/notifications'import {useInvalidateReferenceSettings,useMutationPluginPermissionSettings,diff --git a/web/app/components/plugins/plugin-page/use-reference-setting.ts b/web/app/components/plugins/plugin-page/use-reference-setting.tsindex 3194d35592b..28780b232e5 100644--- a/web/app/components/plugins/plugin-page/use-reference-setting.ts+++ b/web/app/components/plugins/plugin-page/use-reference-setting.ts@@ -1,9 +1,9 @@import type { PluginCategoryEnum } from '../types'-import { toast } from '@langgenius/dify-ui/toast'import { useSuspenseQuery } from '@tanstack/react-query'import { useAtomValue } from 'jotai'import { useMemo } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import {workspacePermissionKeysAtom,workspacePermissionKeysLoadingAtom,diff --git a/web/app/components/plugins/update-plugin/__tests__/from-market-place.spec.tsx b/web/app/components/plugins/update-plugin/__tests__/from-market-place.spec.tsxindex 35d5cc56bb7..4ebd85f6cba 100644--- a/web/app/components/plugins/update-plugin/__tests__/from-market-place.spec.tsx+++ b/web/app/components/plugins/update-plugin/__tests__/from-market-place.spec.tsx@@ -36,7 +36,7 @@ vi.mock('@/app/components/base/badge/index', () => ({default: ({ children }: { children: React.ReactNode }) => <div>{children}</div>,}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: mockToastError,},diff --git a/web/app/components/plugins/update-plugin/__tests__/index.spec.tsx b/web/app/components/plugins/update-plugin/__tests__/index.spec.tsxindex 2fab812b0de..4f42635a1e9 100644--- a/web/app/components/plugins/update-plugin/__tests__/index.spec.tsx+++ b/web/app/components/plugins/update-plugin/__tests__/index.spec.tsx@@ -4,12 +4,12 @@ import type {UpdateFromMarketPlacePayload,UpdatePluginModalType,} from '../../types'-import { toast } from '@langgenius/dify-ui/toast'import { QueryClient, QueryClientProvider } from '@tanstack/react-query'import { fireEvent, screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'import * as React from 'react'import { beforeEach, describe, expect, it, vi } from 'vite-plus/test'+import { toast } from '@/app/notifications'import { render } from '@/test/console/render'import { PluginCategoryEnum, PluginSource, TaskStatus } from '../../types'import DowngradeWarningModal from '../downgrade-warning'diff --git a/web/app/components/plugins/update-plugin/from-market-place.tsx b/web/app/components/plugins/update-plugin/from-market-place.tsxindex fc93b1cea0a..9683e3e0885 100644--- a/web/app/components/plugins/update-plugin/from-market-place.tsx+++ b/web/app/components/plugins/update-plugin/from-market-place.tsx@@ -4,7 +4,6 @@ import { Button } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'import { Dialog, DialogClose, DialogContent, DialogTitle } from '@langgenius/dify-ui/dialog'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import * as React from 'react'import { useCallback, useEffect, useState } from 'react'import { useTranslation } from 'react-i18next'@@ -12,6 +11,7 @@ import Badge, { BadgeState } from '@/app/components/base/badge/index'import Card from '@/app/components/plugins/card'import checkTaskStatus from '@/app/components/plugins/install-plugin/base/check-task-status'import { pluginManifestToCardPluginProps } from '@/app/components/plugins/install-plugin/utils'+import { toast } from '@/app/notifications'import { updateFromMarketPlace } from '@/service/plugins'import { usePluginTaskList, useRemoveAutoUpgrade } from '@/service/use-plugins'import useGetIcon from '../install-plugin/base/use-get-icon'diff --git a/web/app/components/rag-pipeline/components/__tests__/conversion.spec.tsx b/web/app/components/rag-pipeline/components/__tests__/conversion.spec.tsxindex 3c0c976ad51..2f3bcf7cf8c 100644--- a/web/app/components/rag-pipeline/components/__tests__/conversion.spec.tsx+++ b/web/app/components/rag-pipeline/components/__tests__/conversion.spec.tsx@@ -56,7 +56,7 @@ const { mockToast } = vi.hoisted(() => {return { mockToast }})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: mockToast,}))diff --git a/web/app/components/rag-pipeline/components/__tests__/update-dsl-modal.spec.tsx b/web/app/components/rag-pipeline/components/__tests__/update-dsl-modal.spec.tsxindex 01a752d93fb..34e75e903e9 100644--- a/web/app/components/rag-pipeline/components/__tests__/update-dsl-modal.spec.tsx+++ b/web/app/components/rag-pipeline/components/__tests__/update-dsl-modal.spec.tsx@@ -27,7 +27,7 @@ const toastMocks = vi.hoisted(() => {}})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: Object.assign(toastMocks.api, {success: vi.fn((message: string, options?: Record<string, unknown>) =>toastMocks.call({ type: 'success', message, ...options }),diff --git a/web/app/components/rag-pipeline/components/conversion.tsx b/web/app/components/rag-pipeline/components/conversion.tsxindex a28a3826278..d5c06b682bc 100644--- a/web/app/components/rag-pipeline/components/conversion.tsx+++ b/web/app/components/rag-pipeline/components/conversion.tsx@@ -8,12 +8,12 @@ import {AlertDialogTitle,} from '@langgenius/dify-ui/alert-dialog'import { Button } from '@langgenius/dify-ui/button'-import { toast } from '@langgenius/dify-ui/toast'import { useSuspenseQuery } from '@tanstack/react-query'import { useAtomValue } from 'jotai'import * as React from 'react'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { useDatasetDetailContextWithSelector } from '@/context/dataset-detail'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { userProfileQueryOptions } from '@/features/account-profile/client'diff --git a/web/app/components/rag-pipeline/components/panel/input-field/editor/form/__tests__/index.spec.tsx b/web/app/components/rag-pipeline/components/panel/input-field/editor/form/__tests__/index.spec.tsxindex 867283eefe9..b2e79b66fb5 100644--- a/web/app/components/rag-pipeline/components/panel/input-field/editor/form/__tests__/index.spec.tsx+++ b/web/app/components/rag-pipeline/components/panel/input-field/editor/form/__tests__/index.spec.tsx@@ -1,8 +1,8 @@import type { FormData, InputFieldFormProps } from '../types'-import { toast } from '@langgenius/dify-ui/toast'import { QueryClient, QueryClientProvider } from '@tanstack/react-query'import { fireEvent, render, renderHook, screen, waitFor } from '@testing-library/react'import * as React from 'react'+import { toast } from '@/app/notifications'import { PipelineInputVarType } from '@/models/pipeline'import { useConfigurations, useHiddenConfigurations, useHiddenFieldNames } from '../hooks'import InputFieldForm from '../index'diff --git a/web/app/components/rag-pipeline/components/panel/input-field/editor/form/index.tsx b/web/app/components/rag-pipeline/components/panel/input-field/editor/form/index.tsxindex eaa09f77b18..d132c07826d 100644--- a/web/app/components/rag-pipeline/components/panel/input-field/editor/form/index.tsx+++ b/web/app/components/rag-pipeline/components/panel/input-field/editor/form/index.tsx@@ -1,13 +1,13 @@import type { FormData, InputFieldFormProps } from './types'import type { MoreInfo } from '@/app/components/workflow/types'import { Button } from '@langgenius/dify-ui/button'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'import Divider from '@/app/components/base/divider'import { useFileSizeLimit } from '@/app/components/base/file-uploader/hooks'import { useAppForm } from '@/app/components/base/form'import { ChangeType } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { useFileUploadConfig } from '@/service/use-common'import HiddenFields from './hidden-fields'import InitialFields from './initial-fields'diff --git a/web/app/components/rag-pipeline/components/panel/input-field/field-list/__tests__/hooks.spec.ts b/web/app/components/rag-pipeline/components/panel/input-field/field-list/__tests__/hooks.spec.tsindex 810e6dae986..111a5ef1ec5 100644--- a/web/app/components/rag-pipeline/components/panel/input-field/field-list/__tests__/hooks.spec.ts+++ b/web/app/components/rag-pipeline/components/panel/input-field/field-list/__tests__/hooks.spec.ts@@ -23,7 +23,7 @@ vi.mock('../../../../../hooks/use-pipeline', () => ({}))const mockToastNotify = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({default: {notify: (...args: unknown[]) => mockToastNotify(...args),},diff --git a/web/app/components/rag-pipeline/components/panel/input-field/field-list/hooks.ts b/web/app/components/rag-pipeline/components/panel/input-field/field-list/hooks.tsindex e7a99b0e46c..8ea4d4a0bd1 100644--- a/web/app/components/rag-pipeline/components/panel/input-field/field-list/hooks.ts+++ b/web/app/components/rag-pipeline/components/panel/input-field/field-list/hooks.ts@@ -1,12 +1,12 @@import type { SortableItem } from './types'import type { MoreInfo, ValueSelector } from '@/app/components/workflow/types'import type { InputVar } from '@/models/pipeline'-import { toast } from '@langgenius/dify-ui/toast'import { useBoolean } from 'ahooks'import { produce } from 'immer'import { useCallback, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import { ChangeType } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { useInputFieldPanel } from '../../../../hooks/use-input-field-panel'import { usePipeline } from '../../../../hooks/use-pipeline'diff --git a/web/app/components/rag-pipeline/components/panel/test-run/preparation/document-processing/__tests__/index.spec.tsx b/web/app/components/rag-pipeline/components/panel/test-run/preparation/document-processing/__tests__/index.spec.tsxindex 6ab4683fb43..d30eef3e949 100644--- a/web/app/components/rag-pipeline/components/panel/test-run/preparation/document-processing/__tests__/index.spec.tsx+++ b/web/app/components/rag-pipeline/components/panel/test-run/preparation/document-processing/__tests__/index.spec.tsx@@ -61,7 +61,7 @@ vi.mock('@/app/components/base/form/form-scenarios/base/utils', () => ({const mockToastNotify = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: (message: string) => mockToastNotify({ type: 'error', message }),},diff --git a/web/app/components/rag-pipeline/components/panel/test-run/preparation/document-processing/__tests__/options.spec.tsx b/web/app/components/rag-pipeline/components/panel/test-run/preparation/document-processing/__tests__/options.spec.tsxindex 17a01ba1374..fd80cac89a2 100644--- a/web/app/components/rag-pipeline/components/panel/test-run/preparation/document-processing/__tests__/options.spec.tsx+++ b/web/app/components/rag-pipeline/components/panel/test-run/preparation/document-processing/__tests__/options.spec.tsx@@ -15,7 +15,7 @@ const { mockFormValue, mockHandleSubmit, mockToastError, mockBaseField } = vi.ho}),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: mockToastError,},diff --git a/web/app/components/rag-pipeline/components/panel/test-run/preparation/document-processing/options.tsx b/web/app/components/rag-pipeline/components/panel/test-run/preparation/document-processing/options.tsxindex 16a1fce37db..b54ad05026b 100644--- a/web/app/components/rag-pipeline/components/panel/test-run/preparation/document-processing/options.tsx+++ b/web/app/components/rag-pipeline/components/panel/test-run/preparation/document-processing/options.tsx@@ -1,9 +1,9 @@import type { ZodSchema } from 'zod'import type { CustomActionsProps } from '@/app/components/base/form/components/form/actions'import type { BaseConfiguration } from '@/app/components/base/form/form-scenarios/base/types'-import { toast } from '@langgenius/dify-ui/toast'import { useAppForm } from '@/app/components/base/form'import BaseField from '@/app/components/base/form/form-scenarios/base/field'+import { toast } from '@/app/notifications'type OptionsProps = {initialData: Record<string, any>diff --git a/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/__tests__/index.spec.tsx b/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/__tests__/index.spec.tsxindex 63f735852a4..fbf6b367fbb 100644--- a/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/__tests__/index.spec.tsx+++ b/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/__tests__/index.spec.tsx@@ -131,7 +131,7 @@ const toastMocks = vi.hoisted(() => ({promise: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: Object.assign(toastMocks.call, {success: vi.fn((message: string, options?: Record<string, unknown>) =>toastMocks.call({ type: 'success', message, ...options }),diff --git a/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/__tests__/popup.spec.tsx b/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/__tests__/popup.spec.tsxindex 97daa81e3ff..8afee8cad19 100644--- a/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/__tests__/popup.spec.tsx+++ b/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/__tests__/popup.spec.tsx@@ -26,7 +26,7 @@ const toastMocks = vi.hoisted(() => ({promise: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: Object.assign(toastMocks.call, {success: vi.fn((message: string, options?: Record<string, unknown>) =>toastMocks.call({ type: 'success', message, ...options }),diff --git a/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/index.tsx b/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/index.tsxindex e0ea938e948..96e5ba3e363 100644--- a/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/index.tsx+++ b/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/index.tsx@@ -2,7 +2,6 @@ import type { IconInfo } from '@/models/datasets'import { Button } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'import { Popover, PopoverContent, PopoverTrigger } from '@langgenius/dify-ui/popover'-import { toast } from '@langgenius/dify-ui/toast'import { RiArrowDownSLine } from '@remixicon/react'import { useBoolean } from 'ahooks'import { memo, useCallback, useState } from 'react'@@ -10,6 +9,7 @@ import { useTranslation } from 'react-i18next'import { useHooksStore } from '@/app/components/workflow/hooks-store'import { useNodesSyncDraft } from '@/app/components/workflow/hooks/use-nodes-sync-draft'import { useStore } from '@/app/components/workflow/store'+import { toast } from '@/app/notifications'import { useDocLink } from '@/context/i18n'import Link from '@/next/link'import {diff --git a/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/popup.tsx b/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/popup.tsxindex 478df63029e..9ce94c465df 100644--- a/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/popup.tsx+++ b/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/popup.tsx@@ -11,7 +11,6 @@ import {import { Button, buttonVariants } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'import { Kbd, KbdGroup } from '@langgenius/dify-ui/kbd'-import { toast } from '@langgenius/dify-ui/toast'import { RiArrowRightUpLine, RiPlayCircleLine, RiTerminalBoxLine } from '@remixicon/react'import { formatForDisplay, useHotkey } from '@tanstack/react-hotkeys'import { useQuery, useSuspenseQuery } from '@tanstack/react-query'@@ -30,6 +29,7 @@ import {} from '@/app/components/billing/pricing/query-params'import { useChecklistBeforePublish } from '@/app/components/workflow/hooks/use-checklist'import { useStore, useWorkflowStore } from '@/app/components/workflow/store'+import { toast } from '@/app/notifications'import { useDatasetDetailContextWithSelector } from '@/context/dataset-detail'import {workspacePermissionKeysAtom,diff --git a/web/app/components/rag-pipeline/hooks/__tests__/use-DSL.spec.ts b/web/app/components/rag-pipeline/hooks/__tests__/use-DSL.spec.tsindex c4b84df87ad..417c9e7a7dc 100644--- a/web/app/components/rag-pipeline/hooks/__tests__/use-DSL.spec.ts+++ b/web/app/components/rag-pipeline/hooks/__tests__/use-DSL.spec.ts@@ -9,7 +9,7 @@ const toastMocks = vi.hoisted(() => ({promise: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: Object.assign(toastMocks.call, {success: vi.fn((message: string, options?: Record<string, unknown>) =>toastMocks.call({ type: 'success', message, ...options }),diff --git a/web/app/components/rag-pipeline/hooks/__tests__/use-update-dsl-modal.spec.ts b/web/app/components/rag-pipeline/hooks/__tests__/use-update-dsl-modal.spec.tsindex cae5320829a..fd8c20bfd79 100644--- a/web/app/components/rag-pipeline/hooks/__tests__/use-update-dsl-modal.spec.ts+++ b/web/app/components/rag-pipeline/hooks/__tests__/use-update-dsl-modal.spec.ts@@ -26,7 +26,7 @@ const toastMocks = vi.hoisted(() => {}})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: Object.assign(toastMocks.api, {success: vi.fn((message: string, options?: Record<string, unknown>) =>toastMocks.call({ type: 'success', message, ...options }),diff --git a/web/app/components/rag-pipeline/hooks/use-DSL.ts b/web/app/components/rag-pipeline/hooks/use-DSL.tsindex 9158d14b871..30db16c2beb 100644--- a/web/app/components/rag-pipeline/hooks/use-DSL.ts+++ b/web/app/components/rag-pipeline/hooks/use-DSL.ts@@ -1,9 +1,9 @@import type { useNodesSyncDraft } from './use-nodes-sync-draft'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'import { DSL_EXPORT_CHECK } from '@/app/components/workflow/constants'import { useWorkflowStore } from '@/app/components/workflow/store'+import { toast } from '@/app/notifications'import { useEventEmitterContextContext } from '@/context/event-emitter'import { useExportPipelineDSL } from '@/service/use-pipeline'import { fetchWorkflowDraft } from '@/service/workflow'diff --git a/web/app/components/rag-pipeline/hooks/use-update-dsl-modal.ts b/web/app/components/rag-pipeline/hooks/use-update-dsl-modal.tsindex 5db04050573..c5691fdb755 100644--- a/web/app/components/rag-pipeline/hooks/use-update-dsl-modal.ts+++ b/web/app/components/rag-pipeline/hooks/use-update-dsl-modal.ts@@ -1,11 +1,11 @@import type { MouseEventHandler } from 'react'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import { WORKFLOW_DATA_UPDATE } from '@/app/components/workflow/constants'import { usePluginDependencies } from '@/app/components/workflow/plugin-dependency/hooks'import { useWorkflowStore } from '@/app/components/workflow/store'import { initialEdges, initialNodes } from '@/app/components/workflow/utils'+import { toast } from '@/app/notifications'import { useEventEmitterContextContext } from '@/context/event-emitter'import { DSLImportMode, DSLImportStatus } from '@/models/app'import { useImportPipelineDSL, useImportPipelineDSLConfirm } from '@/service/use-pipeline'diff --git a/web/app/components/share/text-generation/hooks/__tests__/use-text-generation-app-state.spec.ts b/web/app/components/share/text-generation/hooks/__tests__/use-text-generation-app-state.spec.tsindex 0a9dae58cc1..8ea18a226be 100644--- a/web/app/components/share/text-generation/hooks/__tests__/use-text-generation-app-state.spec.ts+++ b/web/app/components/share/text-generation/hooks/__tests__/use-text-generation-app-state.spec.ts@@ -28,7 +28,7 @@ const {useDocumentTitleMock: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({default: {notify: notifyMock,},diff --git a/web/app/components/share/text-generation/hooks/use-text-generation-app-state.ts b/web/app/components/share/text-generation/hooks/use-text-generation-app-state.tsindex 90a989d2273..dcda05c3407 100644--- a/web/app/components/share/text-generation/hooks/use-text-generation-app-state.ts+++ b/web/app/components/share/text-generation/hooks/use-text-generation-app-state.ts@@ -7,11 +7,11 @@ import type {} from '@/models/debug'import type { SiteInfo } from '@/models/share'import type { VisionSettings } from '@/types/app'-import { toast } from '@langgenius/dify-ui/toast'import { useSuspenseQuery } from '@tanstack/react-query'import { useCallback, useEffect, useState } from 'react'import { useTranslation } from 'react-i18next'import { getRawInputsFromUrlParams } from '@/app/components/base/chat/utils'+import { toast } from '@/app/notifications'import { useWebAppStore } from '@/context/web-app-context'import { systemFeaturesQueryOptions } from '@/features/system-features/client'import { useAppFavicon } from '@/hooks/use-app-favicon'diff --git a/web/app/components/share/text-generation/index.tsx b/web/app/components/share/text-generation/index.tsxindex be82e474cd5..49530a88fb9 100644--- a/web/app/components/share/text-generation/index.tsx+++ b/web/app/components/share/text-generation/index.tsx@@ -3,11 +3,11 @@ import type { FC } from 'react'import type { InputValueTypes, TextGenerationRunControl, TextGenerationTranslate } from './types'import type { VisionFile } from '@/types/app'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { useBoolean } from 'ahooks'import { useCallback, useEffect, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder'+import { toast } from '@/app/notifications'import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints'import { useSearchParams } from '@/next/navigation'import { useTextGenerationAppState } from './hooks/use-text-generation-app-state'diff --git a/web/app/components/share/text-generation/result/__tests__/index.spec.tsx b/web/app/components/share/text-generation/result/__tests__/index.spec.tsxindex 285cca94c49..2a47c6c313b 100644--- a/web/app/components/share/text-generation/result/__tests__/index.spec.tsx+++ b/web/app/components/share/text-generation/result/__tests__/index.spec.tsx@@ -45,7 +45,7 @@ vi.mock('react-i18next', async (importOriginal) => {}})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: (...args: unknown[]) => notifyMock(...args),}))diff --git a/web/app/components/share/text-generation/result/index.tsx b/web/app/components/share/text-generation/result/index.tsxindex 1a39d3074d2..c4e10f664e0 100644--- a/web/app/components/share/text-generation/result/index.tsx+++ b/web/app/components/share/text-generation/result/index.tsx@@ -6,13 +6,13 @@ import type { SiteInfo } from '@/models/share'import type { AppSourceType } from '@/service/share'import type { VisionFile, VisionSettings } from '@/types/app'import { Button } from '@langgenius/dify-ui/button'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback } from 'react'import * as React from 'react'import { useTranslation } from 'react-i18next'import TextGenerationRes from '@/app/components/app/text-generate/item'import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder'import NoData from '@/app/components/share/text-generation/no-data'+import { toast } from '@/app/notifications'import { useResultRunState } from './hooks/use-result-run-state'import { useResultSender } from './hooks/use-result-sender'diff --git a/web/app/components/snippet-list/components/__tests__/snippet-card.spec.tsx b/web/app/components/snippet-list/components/__tests__/snippet-card.spec.tsxindex 5b36d04c8e1..39d21fb4107 100644--- a/web/app/components/snippet-list/components/__tests__/snippet-card.spec.tsx+++ b/web/app/components/snippet-list/components/__tests__/snippet-card.spec.tsx@@ -91,7 +91,7 @@ vi.mock('@/utils/download', () => ({downloadBlob: mockDownloadBlob,}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: mockToastSuccess,error: mockToastError,diff --git a/web/app/components/snippet-list/components/__tests__/snippet-create-button.spec.tsx b/web/app/components/snippet-list/components/__tests__/snippet-create-button.spec.tsxindex e9feb419425..f113a765af3 100644--- a/web/app/components/snippet-list/components/__tests__/snippet-create-button.spec.tsx+++ b/web/app/components/snippet-list/components/__tests__/snippet-create-button.spec.tsx@@ -28,7 +28,7 @@ vi.mock('@/next/navigation', () => ({}),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: mockToastSuccess,error: mockToastError,diff --git a/web/app/components/snippet-list/components/snippet-card.tsx b/web/app/components/snippet-list/components/snippet-card.tsxindex 5ad8a0be4f4..c267d65a471 100644--- a/web/app/components/snippet-list/components/snippet-card.tsx+++ b/web/app/components/snippet-list/components/snippet-card.tsx@@ -18,7 +18,6 @@ import {DropdownMenuSeparator,DropdownMenuTrigger,} from '@langgenius/dify-ui/dropdown-menu'-import { toast } from '@langgenius/dify-ui/toast'import { useAtomValue } from 'jotai'import { useMemo, useState } from 'react'import { useTranslation } from 'react-i18next'@@ -27,6 +26,7 @@ import {canCreateAndModifySnippets,canManageSnippets,} from '@/app/components/snippets/utils/permission'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { TagSelector } from '@/features/tag-management/components/tag-selector'import Link from '@/next/link'diff --git a/web/app/components/snippets/__tests__/import-snippet-dsl-dialog.spec.tsx b/web/app/components/snippets/__tests__/import-snippet-dsl-dialog.spec.tsxindex 966f0a47b28..b2f28584e0a 100644--- a/web/app/components/snippets/__tests__/import-snippet-dsl-dialog.spec.tsx+++ b/web/app/components/snippets/__tests__/import-snippet-dsl-dialog.spec.tsx@@ -32,7 +32,7 @@ vi.mock('@/context/permission-state', async () => {}))})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: toastMocks,}))diff --git a/web/app/components/snippets/components/__tests__/snippet-main.spec.tsx b/web/app/components/snippets/components/__tests__/snippet-main.spec.tsxindex d1fe99577cd..adba9b918d2 100644--- a/web/app/components/snippets/components/__tests__/snippet-main.spec.tsx+++ b/web/app/components/snippets/components/__tests__/snippet-main.spec.tsx@@ -1,10 +1,10 @@import type { ReactNode } from 'react'import type { WorkflowProps } from '@/app/components/workflow'import type { SnippetDetail, SnippetDetailPayload, SnippetInputField } from '@/models/snippet'-import { toast } from '@langgenius/dify-ui/toast'import { act, fireEvent, screen, waitFor } from '@testing-library/react'import { renderWorkflowComponent } from '@/app/components/workflow/__tests__/workflow-test-env'import { BlockEnum } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { PipelineInputVarType } from '@/models/pipeline'import { useSnippetDraftStore } from '../../draft-store'import SnippetMain from '../snippet-main'@@ -46,7 +46,7 @@ const mockInspectVarsCrud = {invalidateConversationVarValues: vi.fn(),}-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: vi.fn(),success: vi.fn(),diff --git a/web/app/components/snippets/components/__tests__/snippet-run-panel.spec.tsx b/web/app/components/snippets/components/__tests__/snippet-run-panel.spec.tsxindex b09aec06e8b..0b057cb75c4 100644--- a/web/app/components/snippets/components/__tests__/snippet-run-panel.spec.tsx+++ b/web/app/components/snippets/components/__tests__/snippet-run-panel.spec.tsx@@ -31,7 +31,7 @@ vi.mock('copy-to-clipboard', () => ({default: copyMock,}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: toastMocks,}))diff --git a/web/app/components/snippets/components/__tests__/snippet-sidebar.spec.tsx b/web/app/components/snippets/components/__tests__/snippet-sidebar.spec.tsxindex 7e4e3ec0b46..796f43d9ee5 100644--- a/web/app/components/snippets/components/__tests__/snippet-sidebar.spec.tsx+++ b/web/app/components/snippets/components/__tests__/snippet-sidebar.spec.tsx@@ -1,7 +1,7 @@import type { InputVar } from '@/app/components/workflow/types'import type { SnippetDetail, SnippetInputField } from '@/models/snippet'-import { toast } from '@langgenius/dify-ui/toast'import { fireEvent, render, screen } from '@testing-library/react'+import { toast } from '@/app/notifications'import { PipelineInputVarType } from '@/models/pipeline'import { SnippetSidebarContent } from '../snippet-sidebar'@@ -24,7 +24,7 @@ vi.mock('@/app/components/app-sidebar/snippet-info/dropdown', () => ({default: () => <div data-testid="snippet-info-dropdown" />,}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: vi.fn(),},diff --git a/web/app/components/snippets/components/hooks/__tests__/use-snippet-dsl.spec.ts b/web/app/components/snippets/components/hooks/__tests__/use-snippet-dsl.spec.tsindex 0a02982a096..f282b35a745 100644--- a/web/app/components/snippets/components/hooks/__tests__/use-snippet-dsl.spec.ts+++ b/web/app/components/snippets/components/hooks/__tests__/use-snippet-dsl.spec.ts@@ -1,6 +1,6 @@-import { toast } from '@langgenius/dify-ui/toast'import { renderHook } from '@testing-library/react'import { act } from 'react'+import { toast } from '@/app/notifications'import { useExportSnippetMutation } from '@/service/use-snippets'import { downloadBlob } from '@/utils/download'import { useSnippetDSL } from '../use-snippet-dsl'@@ -17,7 +17,7 @@ vi.mock('@/utils/download', () => ({downloadBlob: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: vi.fn(),},diff --git a/web/app/components/snippets/components/hooks/__tests__/use-snippet-publish.spec.ts b/web/app/components/snippets/components/hooks/__tests__/use-snippet-publish.spec.tsindex 7f2006fa234..34b5399bc1b 100644--- a/web/app/components/snippets/components/hooks/__tests__/use-snippet-publish.spec.ts+++ b/web/app/components/snippets/components/hooks/__tests__/use-snippet-publish.spec.ts@@ -1,5 +1,5 @@-import { toast } from '@langgenius/dify-ui/toast'import { act, renderHook } from '@testing-library/react'+import { toast } from '@/app/notifications'import { useSnippetPublish } from '../use-snippet-publish'const mockMutateAsync = vi.fn()@@ -10,7 +10,7 @@ const mockHandleCheckBeforePublish = vi.fn<() => Promise<boolean>>()let isPending = false-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: vi.fn(),success: vi.fn(),diff --git a/web/app/components/snippets/components/hooks/use-snippet-dsl.ts b/web/app/components/snippets/components/hooks/use-snippet-dsl.tsindex eba5a0879e9..d1fffa7f1e7 100644--- a/web/app/components/snippets/components/hooks/use-snippet-dsl.ts+++ b/web/app/components/snippets/components/hooks/use-snippet-dsl.ts@@ -1,6 +1,6 @@-import { toast } from '@langgenius/dify-ui/toast'import { useCallback } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { useExportSnippetMutation } from '@/service/use-snippets'import { downloadBlob } from '@/utils/download'diff --git a/web/app/components/snippets/components/hooks/use-snippet-publish.ts b/web/app/components/snippets/components/hooks/use-snippet-publish.tsindex caa91089acd..c7f15fdb04c 100644--- a/web/app/components/snippets/components/hooks/use-snippet-publish.ts+++ b/web/app/components/snippets/components/hooks/use-snippet-publish.ts@@ -1,10 +1,10 @@import type { Snippet as SnippetContract } from '@/types/snippet'-import { toast } from '@langgenius/dify-ui/toast'import { useQueryClient } from '@tanstack/react-query'import { useCallback } from 'react'import { useTranslation } from 'react-i18next'import { useChecklistBeforePublish } from '@/app/components/workflow/hooks/use-checklist'import { useWorkflowStore } from '@/app/components/workflow/store'+import { toast } from '@/app/notifications'import { consoleQuery } from '@/service/console'import { usePublishSnippetWorkflowMutation } from '@/service/use-snippet-workflows'import { useResetWorkflowVersionHistory } from '@/service/use-workflow'diff --git a/web/app/components/snippets/components/snippet-main.tsx b/web/app/components/snippets/components/snippet-main.tsxindex ed53c71ba0c..632f5a42a39 100644--- a/web/app/components/snippets/components/snippet-main.tsx+++ b/web/app/components/snippets/components/snippet-main.tsx@@ -4,7 +4,6 @@ import type { WorkflowProps } from '@/app/components/workflow'import type { Shape as HooksStoreShape } from '@/app/components/workflow/hooks-store'import type { SnippetCanvasData, SnippetDetailPayload, SnippetInputField } from '@/models/snippet'import type { SnippetDraftSyncPayload } from '@/types/snippet'-import { toast } from '@langgenius/dify-ui/toast'import { useAtomValue } from 'jotai'import { useCallback, useEffect, useLayoutEffect, useMemo, useState } from 'react'import { useTranslation } from 'react-i18next'@@ -15,6 +14,7 @@ import { useSetWorkflowVarsWithValue } from '@/app/components/workflow/hooks/useimport { useStore, useWorkflowStore } from '@/app/components/workflow/store'import { BlockEnum } from '@/app/components/workflow/types'import { initialEdges, initialNodes } from '@/app/components/workflow/utils'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { useSnippetDraftStore } from '../draft-store'import { useConfigsMap } from '../hooks/use-configs-map'diff --git a/web/app/components/snippets/components/snippet-run-panel.tsx b/web/app/components/snippets/components/snippet-run-panel.tsxindex f6f1631ce09..46d08e7ee14 100644--- a/web/app/components/snippets/components/snippet-run-panel.tsx+++ b/web/app/components/snippets/components/snippet-run-panel.tsx@@ -4,7 +4,6 @@ import type { InputForm } from '@/app/components/base/chat/chat/type'import type { InputVar as WorkflowInputVar } from '@/app/components/workflow/types'import type { SnippetInputField } from '@/models/snippet'import { Button } from '@langgenius/dify-ui/button'-import { toast } from '@langgenius/dify-ui/toast'import copy from 'copy-to-clipboard'import { memo, useCallback, useEffect, useId, useMemo, useState } from 'react'import { useTranslation } from 'react-i18next'@@ -23,6 +22,7 @@ import TracingPanel from '@/app/components/workflow/run/tracing-panel'import { useStore } from '@/app/components/workflow/store'import { InputVarType, WorkflowRunningStatus } from '@/app/components/workflow/types'import { formatWorkflowRunIdentifier } from '@/app/components/workflow/utils'+import { toast } from '@/app/notifications'import { PipelineInputVarType } from '@/models/pipeline'type SnippetRunPanelProps = {diff --git a/web/app/components/snippets/components/snippet-sidebar.tsx b/web/app/components/snippets/components/snippet-sidebar.tsxindex 567dbabe41e..31d20a7c7c4 100644--- a/web/app/components/snippets/components/snippet-sidebar.tsx+++ b/web/app/components/snippets/components/snippet-sidebar.tsx@@ -3,7 +3,6 @@import type { InputVar } from '@/app/components/workflow/types'import type { SnippetDetail, SnippetInputField } from '@/models/snippet'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { isEqual } from 'es-toolkit/predicate'import { useCallback, useMemo, useState } from 'react'import { useTranslation } from 'react-i18next'@@ -12,6 +11,7 @@ import SnippetInfoDropdown from '@/app/components/app-sidebar/snippet-info/dropdimport ConfigVarModal from '@/app/components/app/configuration/config-var/config-modal'import Field from '@/app/components/workflow/nodes/_base/components/field'import VarList from '@/app/components/workflow/nodes/start/components/var-list'+import { toast } from '@/app/notifications'import { hasDuplicateStr } from '@/utils/var'import { SnippetPlaceholderIcon } from './snippet-placeholder-icon'diff --git a/web/app/components/snippets/hooks/__tests__/use-create-snippet-from-selection.spec.tsx b/web/app/components/snippets/hooks/__tests__/use-create-snippet-from-selection.spec.tsxindex 351ba35ff06..77165047b25 100644--- a/web/app/components/snippets/hooks/__tests__/use-create-snippet-from-selection.spec.tsx+++ b/web/app/components/snippets/hooks/__tests__/use-create-snippet-from-selection.spec.tsx@@ -2,9 +2,9 @@ import type { ReactElement } from 'react'import type { LLMNodeType } from '@/app/components/workflow/nodes/llm/types'import type { Edge, EnvironmentVariable, Node } from '@/app/components/workflow/types'import type { SnippetCanvasData, SnippetInputField } from '@/models/snippet'-import { toast } from '@langgenius/dify-ui/toast'import { act, renderHook } from '@testing-library/react'import { BlockEnum } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { PipelineInputVarType } from '@/models/pipeline'import { useCreateSnippetFromSelection } from '../use-create-snippet-from-selection'@@ -26,7 +26,7 @@ vi.mock('../use-create-snippet', () => ({}),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: { error: vi.fn() },}))diff --git a/web/app/components/snippets/hooks/__tests__/use-create-snippet.spec.tsx b/web/app/components/snippets/hooks/__tests__/use-create-snippet.spec.tsxindex 4afcc49a849..3626a2d65c5 100644--- a/web/app/components/snippets/hooks/__tests__/use-create-snippet.spec.tsx+++ b/web/app/components/snippets/hooks/__tests__/use-create-snippet.spec.tsx@@ -51,7 +51,7 @@ vi.mock('@/context/permission-state', async () => {}))})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: (...args: unknown[]) => mockToastSuccess(...args),error: (...args: unknown[]) => mockToastError(...args),diff --git a/web/app/components/snippets/hooks/use-create-snippet-from-selection.tsx b/web/app/components/snippets/hooks/use-create-snippet-from-selection.tsxindex 0d6a7e2274a..cbdcaf2a49d 100644--- a/web/app/components/snippets/hooks/use-create-snippet-from-selection.tsx+++ b/web/app/components/snippets/hooks/use-create-snippet-from-selection.tsx@@ -6,13 +6,13 @@ import type {ValueSelector,} from '@/app/components/workflow/types'import type { SnippetCanvasData, SnippetInputField } from '@/models/snippet'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'import { getNodesBounds } from 'reactflow'import { CreateSnippetDialog } from '@/app/components/snippets/create-snippet-dialog'import { resolveLLMNodeModel } from '@/app/components/workflow/nodes/llm/utils'import { BlockEnum } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { PipelineInputVarType } from '@/models/pipeline'import { useCreateSnippet } from './use-create-snippet'diff --git a/web/app/components/snippets/hooks/use-create-snippet.ts b/web/app/components/snippets/hooks/use-create-snippet.tsindex 4d60e782db5..40e52393d00 100644--- a/web/app/components/snippets/hooks/use-create-snippet.ts+++ b/web/app/components/snippets/hooks/use-create-snippet.ts@@ -1,8 +1,8 @@import type { CreateSnippetDialogPayload } from '@/app/components/snippets/create-snippet-dialog'-import { toast } from '@langgenius/dify-ui/toast'import { useAtomValue } from 'jotai'import { useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { useRouter } from '@/next/navigation'import { consoleClient } from '@/service/console'diff --git a/web/app/components/snippets/import-snippet-dsl-dialog.tsx b/web/app/components/snippets/import-snippet-dsl-dialog.tsxindex f6b2a0bbce2..6b113aed6d9 100644--- a/web/app/components/snippets/import-snippet-dsl-dialog.tsx+++ b/web/app/components/snippets/import-snippet-dsl-dialog.tsx@@ -15,11 +15,11 @@ import { Button } from '@langgenius/dify-ui/button'import { Dialog, DialogContent, DialogTitle } from '@langgenius/dify-ui/dialog'import { Input } from '@langgenius/dify-ui/input'import { Tabs, TabsList, TabsPanel, TabsTab } from '@langgenius/dify-ui/tabs'-import { toast } from '@langgenius/dify-ui/toast'import { useAtomValue } from 'jotai'import { useCallback, useId, useState } from 'react'import { useTranslation } from 'react-i18next'import { Uploader } from '@/app/components/app/create-from-dsl-modal/uploader'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { useRouter } from '@/next/navigation'import {diff --git a/web/app/components/tools/edit-custom-collection-modal/__tests__/get-schema.spec.tsx b/web/app/components/tools/edit-custom-collection-modal/__tests__/get-schema.spec.tsxindex 11a3f9422b1..8bdbe680065 100644--- a/web/app/components/tools/edit-custom-collection-modal/__tests__/get-schema.spec.tsx+++ b/web/app/components/tools/edit-custom-collection-modal/__tests__/get-schema.spec.tsx@@ -7,7 +7,7 @@ vi.mock('@/service/tools', () => ({importSchemaFromURL: vi.fn(),}))const mockToastError = vi.hoisted(() => vi.fn())-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: mockToastError,},diff --git a/web/app/components/tools/edit-custom-collection-modal/__tests__/index.spec.tsx b/web/app/components/tools/edit-custom-collection-modal/__tests__/index.spec.tsxindex c0015ce8647..ec7f5475b20 100644--- a/web/app/components/tools/edit-custom-collection-modal/__tests__/index.spec.tsx+++ b/web/app/components/tools/edit-custom-collection-modal/__tests__/index.spec.tsx@@ -1,5 +1,4 @@import type { ModalContextState } from '@/context/modal-context'-import { toast } from '@langgenius/dify-ui/toast'import {act,fireEvent,@@ -10,6 +9,7 @@ import {import { NuqsTestingAdapter } from 'nuqs/adapters/testing'import { beforeEach, describe, expect, it, vi } from 'vite-plus/test'import { AuthHeaderPrefix, AuthType } from '@/app/components/tools/types'+import { toast } from '@/app/notifications'import { parseParamsSchema } from '@/service/tools'import EditCustomCollectionModal from '../index'diff --git a/web/app/components/tools/edit-custom-collection-modal/get-schema.tsx b/web/app/components/tools/edit-custom-collection-modal/get-schema.tsxindex 979afbb3e8e..f168896963e 100644--- a/web/app/components/tools/edit-custom-collection-modal/get-schema.tsx+++ b/web/app/components/tools/edit-custom-collection-modal/get-schema.tsx@@ -9,10 +9,10 @@ import {} from '@langgenius/dify-ui/dropdown-menu'import { InputGroup, InputGroupAddon, InputGroupInput } from '@langgenius/dify-ui/input-group'import { Popover, PopoverContent, PopoverTrigger } from '@langgenius/dify-ui/popover'-import { toast } from '@langgenius/dify-ui/toast'import * as React from 'react'import { useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { importSchemaFromURL } from '@/service/tools'import examples from './examples'diff --git a/web/app/components/tools/edit-custom-collection-modal/index.tsx b/web/app/components/tools/edit-custom-collection-modal/index.tsxindex 134854d3557..1a6898d9f95 100644--- a/web/app/components/tools/edit-custom-collection-modal/index.tsx+++ b/web/app/components/tools/edit-custom-collection-modal/index.tsx@@ -15,7 +15,6 @@ import {} from '@langgenius/dify-ui/drawer'import { Input } from '@langgenius/dify-ui/input'import { Textarea } from '@langgenius/dify-ui/textarea'-import { toast } from '@langgenius/dify-ui/toast'import { useDebounce, useGetState } from 'ahooks'import { produce } from 'immer'import * as React from 'react'@@ -24,6 +23,7 @@ import { useTranslation } from 'react-i18next'import AppIcon from '@/app/components/base/app-icon'import EmojiPicker from '@/app/components/base/emoji-picker'import LabelSelector from '@/app/components/tools/labels/selector'+import { toast } from '@/app/notifications'import { parseParamsSchema } from '@/service/tools'import { LinkExternal02 } from '../../base/icons/src/vender/line/general'import { AuthHeaderPrefix, AuthType } from '../types'diff --git a/web/app/components/tools/mcp/__tests__/modal.spec.tsx b/web/app/components/tools/mcp/__tests__/modal.spec.tsxindex 7326cb5e713..d4181af317e 100644--- a/web/app/components/tools/mcp/__tests__/modal.spec.tsx+++ b/web/app/components/tools/mcp/__tests__/modal.spec.tsx@@ -13,7 +13,7 @@ vi.mock('@/service/common', () => ({}))const mockToastError = vi.hoisted(() => vi.fn())-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: mockToastError,},diff --git a/web/app/components/tools/mcp/hooks/use-mcp-modal-form.ts b/web/app/components/tools/mcp/hooks/use-mcp-modal-form.tsindex 3a91a5a8157..e49609fcc87 100644--- a/web/app/components/tools/mcp/hooks/use-mcp-modal-form.ts+++ b/web/app/components/tools/mcp/hooks/use-mcp-modal-form.ts@@ -2,11 +2,11 @@import type { HeaderItem } from '../headers-input'import type { AppIconSelection } from '@/app/components/base/app-icon-picker'import type { ToolWithProvider } from '@/app/components/workflow/types'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback, useMemo, useRef, useState } from 'react'import { getDomain } from 'tldts'import { v4 as uuid } from 'uuid'import { MCPAuthMethod } from '@/app/components/tools/types'+import { toast } from '@/app/notifications'import { uploadRemoteFileInfo } from '@/service/common'const DEFAULT_ICON = { type: 'emoji', icon: '🔗', background: '#6366F1' }diff --git a/web/app/components/tools/mcp/modal.tsx b/web/app/components/tools/mcp/modal.tsxindex b25bcc86780..73d2f84a318 100644--- a/web/app/components/tools/mcp/modal.tsx+++ b/web/app/components/tools/mcp/modal.tsx@@ -9,7 +9,6 @@ import { Dialog, DialogContent, DialogTitle } from '@langgenius/dify-ui/dialog'import { Input } from '@langgenius/dify-ui/input'import { SegmentedControl, SegmentedControlItem } from '@langgenius/dify-ui/segmented-control'import { Switch } from '@langgenius/dify-ui/switch'-import { toast } from '@langgenius/dify-ui/toast'import { useSuspenseQuery } from '@tanstack/react-query'import { useHover } from 'ahooks'import { useId } from 'react'@@ -17,6 +16,7 @@ import { useTranslation } from 'react-i18next'import AppIcon from '@/app/components/base/app-icon'import AppIconPicker from '@/app/components/base/app-icon-picker'import { MCPAuthMethod } from '@/app/components/tools/types'+import { toast } from '@/app/notifications'import { systemFeaturesQueryOptions } from '@/features/system-features/client'import { shouldUseMcpIconForAppIcon } from '@/utils/mcp'import { isValidServerID, isValidUrl, useMCPModalForm } from './hooks/use-mcp-modal-form'diff --git a/web/app/components/tools/provider/__tests__/custom-create-card.spec.tsx b/web/app/components/tools/provider/__tests__/custom-create-card.spec.tsxindex e3889cf7d70..b47eaa71d1f 100644--- a/web/app/components/tools/provider/__tests__/custom-create-card.spec.tsx+++ b/web/app/components/tools/provider/__tests__/custom-create-card.spec.tsx@@ -87,7 +87,7 @@ vi.mock('@/app/components/tools/edit-custom-collection-modal', () => ({// Mock toastconst mockToastSuccess = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: (title: string) => mockToastSuccess(title),},diff --git a/web/app/components/tools/provider/__tests__/detail.spec.tsx b/web/app/components/tools/provider/__tests__/detail.spec.tsxindex a5bbc4f1576..d95b94d48f5 100644--- a/web/app/components/tools/provider/__tests__/detail.spec.tsx+++ b/web/app/components/tools/provider/__tests__/detail.spec.tsx@@ -119,7 +119,7 @@ vi.mock('@/utils/var', () => ({const mockToastSuccess = vi.hoisted(() => vi.fn())const mockToastError = vi.hoisted(() => vi.fn())-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: mockToastSuccess,error: mockToastError,diff --git a/web/app/components/tools/provider/custom-create-card.tsx b/web/app/components/tools/provider/custom-create-card.tsxindex cdd0a3f4869..a5df58614c5 100644--- a/web/app/components/tools/provider/custom-create-card.tsx+++ b/web/app/components/tools/provider/custom-create-card.tsx@@ -1,11 +1,11 @@'use client'import type { CustomCollectionBackend } from '../types'import { Button } from '@langgenius/dify-ui/button'-import { toast } from '@langgenius/dify-ui/toast'import { useState } from 'react'import { useTranslation } from 'react-i18next'import EditCustomToolModal from '@/app/components/tools/edit-custom-collection-modal'import { useCanManageTools } from '@/app/components/tools/hooks/use-tool-permissions'+import { toast } from '@/app/notifications'import { useDocLink } from '@/context/i18n'import { createCustomCollection } from '@/service/tools'import CreateEntryCard from './create-entry-card'diff --git a/web/app/components/tools/provider/detail.tsx b/web/app/components/tools/provider/detail.tsxindex 6678b7ac43e..fc3affa0b6b 100644--- a/web/app/components/tools/provider/detail.tsx+++ b/web/app/components/tools/provider/detail.tsx@@ -28,7 +28,6 @@ import {} from '@langgenius/dify-ui/drawer'import { IconButton } from '@langgenius/dify-ui/icon-button'import { StatusDot } from '@langgenius/dify-ui/status-dot'-import { toast } from '@langgenius/dify-ui/toast'import { RiCloseLine } from '@remixicon/react'import { useQuery, useQueryClient } from '@tanstack/react-query'import * as React from 'react'@@ -45,6 +44,7 @@ import EditCustomToolModal from '@/app/components/tools/edit-custom-collection-mimport { useCanManageTools } from '@/app/components/tools/hooks/use-tool-permissions'import ConfigCredential from '@/app/components/tools/setting/build-in/config-credentials'import { WorkflowToolDrawer } from '@/app/components/tools/workflow-tool'+import { toast } from '@/app/notifications'import { useModalContext } from '@/context/modal-context'import { useCredentialPermissions } from '@/hooks/use-credential-permissions'import { getPluginLanguage } from '@/i18n/metadata'diff --git a/web/app/components/tools/setting/build-in/__tests__/config-credentials.spec.tsx b/web/app/components/tools/setting/build-in/__tests__/config-credentials.spec.tsxindex 082e4644423..df7eb3c225d 100644--- a/web/app/components/tools/setting/build-in/__tests__/config-credentials.spec.tsx+++ b/web/app/components/tools/setting/build-in/__tests__/config-credentials.spec.tsx@@ -24,7 +24,7 @@ vi.mock('../../../utils/to-form-schema', () => ({addDefaultValue: (value: Record<string, unknown>, _schemas: unknown[]) => ({ ...value }),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({default: { notify: vi.fn() },}))diff --git a/web/app/components/tools/setting/build-in/config-credentials.tsx b/web/app/components/tools/setting/build-in/config-credentials.tsxindex 632e3f39c55..0b28171b88c 100644--- a/web/app/components/tools/setting/build-in/config-credentials.tsx+++ b/web/app/components/tools/setting/build-in/config-credentials.tsx@@ -14,7 +14,6 @@ import {DrawerTitle,DrawerViewport,} from '@langgenius/dify-ui/drawer'-import { toast } from '@langgenius/dify-ui/toast'import { noop } from 'es-toolkit/function'import * as React from 'react'import { useEffect, useState } from 'react'@@ -23,6 +22,7 @@ import { LinkExternal02 } from '@/app/components/base/icons/src/vender/line/geneimport { LoadingPlaceholder } from '@/app/components/base/loading-placeholder'import { useLanguage } from '@/app/components/header/account-setting/model-provider-page/hooks'import Form from '@/app/components/header/account-setting/model-provider-page/model-modal/Form'+import { toast } from '@/app/notifications'import { fetchBuiltInToolCredential, fetchBuiltInToolCredentialSchema } from '@/service/tools'import { addDefaultValue, toolCredentialToFormSchemas } from '../../utils/to-form-schema'diff --git a/web/app/components/tools/workflow-tool/__tests__/index.spec.tsx b/web/app/components/tools/workflow-tool/__tests__/index.spec.tsxindex 96d372a0b21..17d7848d98b 100644--- a/web/app/components/tools/workflow-tool/__tests__/index.spec.tsx+++ b/web/app/components/tools/workflow-tool/__tests__/index.spec.tsx@@ -46,7 +46,7 @@ vi.mock('../confirm-modal', () => ({}))const mockToastNotify = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: (message: string) => mockToastNotify({ type: 'success', message }),error: (message: string) => mockToastNotify({ type: 'error', message }),diff --git a/web/app/components/tools/workflow-tool/hooks/__tests__/use-configure-button.spec.ts b/web/app/components/tools/workflow-tool/hooks/__tests__/use-configure-button.spec.tsindex d5d70c448f4..5949c47dd1d 100644--- a/web/app/components/tools/workflow-tool/hooks/__tests__/use-configure-button.spec.ts+++ b/web/app/components/tools/workflow-tool/hooks/__tests__/use-configure-button.spec.ts@@ -25,7 +25,7 @@ vi.mock('@/service/use-tools', () => ({}))const mockToastNotify = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: (message: string) => mockToastNotify({ type: 'success', message }),error: (message: string) => mockToastNotify({ type: 'error', message }),diff --git a/web/app/components/tools/workflow-tool/hooks/use-configure-button.ts b/web/app/components/tools/workflow-tool/hooks/use-configure-button.tsindex 3fa0e39e3e4..46d78699ec9 100644--- a/web/app/components/tools/workflow-tool/hooks/use-configure-button.ts+++ b/web/app/components/tools/workflow-tool/hooks/use-configure-button.ts@@ -8,9 +8,9 @@ import type {} from '@/app/components/tools/types'import type { InputVar } from '@/app/components/workflow/types'import type { PublishWorkflowParams } from '@/types/workflow'-import { toast } from '@langgenius/dify-ui/toast'import { useEffect, useMemo, useRef } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { createWorkflowToolProvider, saveWorkflowToolProvider } from '@/service/tools'import {useInvalidateAllWorkflowTools,diff --git a/web/app/components/tools/workflow-tool/index.tsx b/web/app/components/tools/workflow-tool/index.tsxindex b09d1659f95..d1cff525453 100644--- a/web/app/components/tools/workflow-tool/index.tsx+++ b/web/app/components/tools/workflow-tool/index.tsx@@ -23,7 +23,6 @@ import {import { Field, FieldError, FieldLabel } from '@langgenius/dify-ui/field'import { Input } from '@langgenius/dify-ui/input'import { Textarea } from '@langgenius/dify-ui/textarea'-import { toast } from '@langgenius/dify-ui/toast'import { produce } from 'immer'import * as React from 'react'import { useMemo, useState } from 'react'@@ -35,6 +34,7 @@ import LabelSelector from '@/app/components/tools/labels/selector'import ConfirmModal from '@/app/components/tools/workflow-tool/confirm-modal'import MethodSelector from '@/app/components/tools/workflow-tool/method-selector'import { normalizeWorkflowOutputName } from '@/app/components/workflow/utils/variable'+import { toast } from '@/app/notifications'import {buildWorkflowToolRequestPayload,getReservedWorkflowOutputParameters,diff --git a/web/app/components/workflow-app/components/workflow-header/__tests__/features-trigger.spec.tsx b/web/app/components/workflow-app/components/workflow-header/__tests__/features-trigger.spec.tsxindex 461a220099a..0bae47e95a5 100644--- a/web/app/components/workflow-app/components/workflow-header/__tests__/features-trigger.spec.tsx+++ b/web/app/components/workflow-app/components/workflow-header/__tests__/features-trigger.spec.tsx@@ -28,7 +28,7 @@ const toastMocks = vi.hoisted(() => ({promise: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: Object.assign(toastMocks.call, {success: vi.fn((message: string, options?: Record<string, unknown>) =>toastMocks.call({ type: 'success', message, ...options }),diff --git a/web/app/components/workflow-app/components/workflow-header/features-trigger.tsx b/web/app/components/workflow-app/components/workflow-header/features-trigger.tsxindex 5dab50d4e32..4215944d38d 100644--- a/web/app/components/workflow-app/components/workflow-header/features-trigger.tsx+++ b/web/app/components/workflow-app/components/workflow-header/features-trigger.tsx@@ -8,7 +8,6 @@ import type { StartNodeType } from '@/app/components/workflow/nodes/start/types'import type { CommonEdgeType, Node } from '@/app/components/workflow/types'import { Button } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { useQuery, useQueryClient, useSuspenseQuery } from '@tanstack/react-query'import { memo, useCallback, useMemo } from 'react'import { useTranslation } from 'react-i18next'@@ -28,6 +27,7 @@ import { isAgentV2NodeData } from '@/app/components/workflow/nodes/agent-v2/typeimport { useStore, useWorkflowStore } from '@/app/components/workflow/store'import useNodes from '@/app/components/workflow/store/workflow/use-nodes'import { BlockEnum, InputVarType, isTriggerNode } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { systemFeaturesQueryOptions } from '@/features/system-features/client'import useTheme from '@/hooks/use-theme'import { fetchAppDetail } from '@/service/apps'diff --git a/web/app/components/workflow-app/hooks/__tests__/use-DSL.spec.ts b/web/app/components/workflow-app/hooks/__tests__/use-DSL.spec.tsindex 88a0b0e1b35..0b522aa9292 100644--- a/web/app/components/workflow-app/hooks/__tests__/use-DSL.spec.ts+++ b/web/app/components/workflow-app/hooks/__tests__/use-DSL.spec.ts@@ -9,7 +9,7 @@ const toastMocks = vi.hoisted(() => ({promise: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: Object.assign(toastMocks.call, {success: vi.fn((message: string, options?: Record<string, unknown>) =>toastMocks.call({ type: 'success', message, ...options }),diff --git a/web/app/components/workflow-app/hooks/__tests__/use-workflow-run-utils.spec.ts b/web/app/components/workflow-app/hooks/__tests__/use-workflow-run-utils.spec.tsindex cb1519ec694..6aa174ba034 100644--- a/web/app/components/workflow-app/hooks/__tests__/use-workflow-run-utils.spec.ts+++ b/web/app/components/workflow-app/hooks/__tests__/use-workflow-run-utils.spec.ts@@ -31,7 +31,7 @@ vi.mock('@/service/base', () => ({handleStream: mockHandleStream,}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: mockToastError,},diff --git a/web/app/components/workflow-app/hooks/use-DSL.ts b/web/app/components/workflow-app/hooks/use-DSL.tsindex 1cd434cabdb..e7e8f2bc56c 100644--- a/web/app/components/workflow-app/hooks/use-DSL.ts+++ b/web/app/components/workflow-app/hooks/use-DSL.ts@@ -1,9 +1,9 @@import type { useNodesSyncDraft } from './use-nodes-sync-draft'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'import { useStore as useAppStore } from '@/app/components/app/store'import { DSL_EXPORT_CHECK } from '@/app/components/workflow/constants'+import { toast } from '@/app/notifications'import { useEventEmitterContextContext } from '@/context/event-emitter'import { exportAppConfig } from '@/service/apps'import { fetchWorkflowDraft } from '@/service/workflow'diff --git a/web/app/components/workflow-app/hooks/use-workflow-run-utils.ts b/web/app/components/workflow-app/hooks/use-workflow-run-utils.tsindex 07cceee9525..dd85dacec26 100644--- a/web/app/components/workflow-app/hooks/use-workflow-run-utils.ts+++ b/web/app/components/workflow-app/hooks/use-workflow-run-utils.ts@@ -2,11 +2,11 @@ import type { Features as FeaturesData } from '@/app/components/base/features/tyimport type { TriggerNodeType } from '@/app/components/workflow/types'import type { IOtherOptions } from '@/service/base'import type { VersionHistory } from '@/types/workflow'-import { toast } from '@langgenius/dify-ui/toast'import { noop } from 'es-toolkit/function'import { isInstalledAppPath } from '@/app/components/explore/installed-app/routes'import { TriggerType } from '@/app/components/workflow/header/test-run-menu'import { WorkflowRunningStatus } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { handleStream, post } from '@/service/base'import { ContentType } from '@/service/fetch'import { AppModeEnum } from '@/types/app'diff --git a/web/app/components/workflow/__tests__/update-dsl-modal.spec.tsx b/web/app/components/workflow/__tests__/update-dsl-modal.spec.tsxindex 6ae715e20e1..afc95679c55 100644--- a/web/app/components/workflow/__tests__/update-dsl-modal.spec.tsx+++ b/web/app/components/workflow/__tests__/update-dsl-modal.spec.tsx@@ -1,7 +1,7 @@import type { EventEmitter } from 'ahooks/lib/useEventEmitter'import type { EventEmitterValue } from '@/context/event-emitter'-import { toast } from '@langgenius/dify-ui/toast'import { fireEvent, render, screen, waitFor } from '@testing-library/react'+import { toast } from '@/app/notifications'import { EventEmitterContext } from '@/context/event-emitter'import { DSLImportStatus } from '@/models/app'import UpdateDSLModal from '../update-dsl-modal'@@ -21,7 +21,7 @@ vi.stubGlobal('FileReader', MockFileReader as unknown as typeof FileReader)const mockEmit = vi.fn()const mockEmitWorkflowUpdate = vi.hoisted(() => vi.fn())-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: vi.fn(),info: vi.fn(),diff --git a/web/app/components/workflow/__tests__/workflow-edge-events.spec.tsx b/web/app/components/workflow/__tests__/workflow-edge-events.spec.tsxindex 43b122c1cf4..08cd0507ad5 100644--- a/web/app/components/workflow/__tests__/workflow-edge-events.spec.tsx+++ b/web/app/components/workflow/__tests__/workflow-edge-events.spec.tsx@@ -192,7 +192,7 @@ vi.mock('@/service/workflow', () => ({fetchAllInspectVars: vi.fn().mockResolvedValue([]),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: toastErrorMock,info: toastInfoMock,diff --git a/web/app/components/workflow/block-selector/__tests__/blocks.spec.tsx b/web/app/components/workflow/block-selector/__tests__/blocks.spec.tsxindex 4141d717904..3d783632d49 100644--- a/web/app/components/workflow/block-selector/__tests__/blocks.spec.tsx+++ b/web/app/components/workflow/block-selector/__tests__/blocks.spec.tsx@@ -44,7 +44,7 @@ vi.mock('@/service/base', () => ({request: (...args: unknown[]) => queryMocks.request(...args),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: (message: string) => queryMocks.toastError(message),},diff --git a/web/app/components/workflow/block-selector/__tests__/tool-picker.spec.tsx b/web/app/components/workflow/block-selector/__tests__/tool-picker.spec.tsxindex 3faf345a598..4adb1c449f4 100644--- a/web/app/components/workflow/block-selector/__tests__/tool-picker.spec.tsx+++ b/web/app/components/workflow/block-selector/__tests__/tool-picker.spec.tsx@@ -132,7 +132,7 @@ vi.mock('@/service/use-tools', () => ({useInvalidateAllMCPTools: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: (message: string) => mockNotify({ type: 'success', message }),error: (message: string) => mockNotify({ type: 'error', message }),diff --git a/web/app/components/workflow/block-selector/agent-selector.tsx b/web/app/components/workflow/block-selector/agent-selector.tsxindex fa1b05ee184..34ef1b2a066 100644--- a/web/app/components/workflow/block-selector/agent-selector.tsx+++ b/web/app/components/workflow/block-selector/agent-selector.tsx@@ -14,7 +14,6 @@ import {ComboboxStatus,} from '@langgenius/dify-ui/combobox'import { Popover, PopoverContent, PopoverTitle, PopoverTrigger } from '@langgenius/dify-ui/popover'-import { toast } from '@langgenius/dify-ui/toast'import { useQuery } from '@tanstack/react-query'import { useDebounce } from 'ahooks'import { useState } from 'react'@@ -22,6 +21,7 @@ import { useTranslation } from 'react-i18next'import AppIcon from '@/app/components/base/app-icon'import Badge from '@/app/components/base/badge'import { useHooksStore } from '@/app/components/workflow/hooks-store'+import { toast } from '@/app/notifications'import Link from '@/next/link'import { consoleQuery } from '@/service/console'import BlockIcon from '../block-icon'diff --git a/web/app/components/workflow/block-selector/snippets/__tests__/use-insert-snippet.spec.tsx b/web/app/components/workflow/block-selector/snippets/__tests__/use-insert-snippet.spec.tsxindex 47b9ce6a5bb..b4529fbb7b8 100644--- a/web/app/components/workflow/block-selector/snippets/__tests__/use-insert-snippet.spec.tsx+++ b/web/app/components/workflow/block-selector/snippets/__tests__/use-insert-snippet.spec.tsx@@ -92,7 +92,7 @@ vi.mock('../../../hooks/use-workflow-history', () => ({},}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: (...args: unknown[]) => mockToastError(...args),},diff --git a/web/app/components/workflow/block-selector/snippets/use-insert-snippet.ts b/web/app/components/workflow/block-selector/snippets/use-insert-snippet.tsindex 647596be8c7..da6239155ae 100644--- a/web/app/components/workflow/block-selector/snippets/use-insert-snippet.ts+++ b/web/app/components/workflow/block-selector/snippets/use-insert-snippet.ts@@ -2,11 +2,11 @@ import type { AssignerNodeType } from '../../nodes/assigner/types'import type { IterationNodeType } from '../../nodes/iteration/types'import type { LoopNodeType } from '../../nodes/loop/types'import type { Edge, Node, OnNodeAdd, ValueSelector } from '../../types'-import { toast } from '@langgenius/dify-ui/toast'import { useQueryClient } from '@tanstack/react-query'import { useCallback } from 'react'import { useTranslation } from 'react-i18next'import { useStoreApi } from 'reactflow'+import { toast } from '@/app/notifications'import { consoleQuery } from '@/service/console'import { useIncrementSnippetUseCountMutation } from '@/service/use-snippets'import { CUSTOM_EDGE, NESTED_ELEMENT_Z_INDEX, NODE_WIDTH_X_OFFSET, X_OFFSET } from '../../constants'diff --git a/web/app/components/workflow/block-selector/tool-picker.tsx b/web/app/components/workflow/block-selector/tool-picker.tsxindex f5df700f804..fad33acdb8a 100644--- a/web/app/components/workflow/block-selector/tool-picker.tsx+++ b/web/app/components/workflow/block-selector/tool-picker.tsx@@ -6,7 +6,6 @@ import type { CustomCollectionBackend } from '@/app/components/tools/types'import type { BlockEnum, OnSelectBlock } from '@/app/components/workflow/types'import { cn } from '@langgenius/dify-ui/cn'import { Popover, PopoverContent, PopoverTitle, PopoverTrigger } from '@langgenius/dify-ui/popover'-import { toast } from '@langgenius/dify-ui/toast'import { useSuspenseQuery } from '@tanstack/react-query'import { useBoolean } from 'ahooks'import { useMemo, useState } from 'react'@@ -15,6 +14,7 @@ import SearchBox from '@/app/components/plugins/marketplace/search-box'import EditCustomToolModal from '@/app/components/tools/edit-custom-collection-modal'import { useCanManageTools } from '@/app/components/tools/hooks/use-tool-permissions'import ToolBrowser from '@/app/components/workflow/block-selector/tool-browser'+import { toast } from '@/app/notifications'import { systemFeaturesQueryOptions } from '@/features/system-features/client'import { createCustomCollection } from '@/service/tools'import { useFeaturedToolsRecommendations } from '@/service/use-plugins'diff --git a/web/app/components/workflow/header/__tests__/header-layouts.spec.tsx b/web/app/components/workflow/header/__tests__/header-layouts.spec.tsxindex ff976be6a23..bd05f21d97e 100644--- a/web/app/components/workflow/header/__tests__/header-layouts.spec.tsx+++ b/web/app/components/workflow/header/__tests__/header-layouts.spec.tsx@@ -86,7 +86,7 @@ vi.mock('../../collaboration/core/collaboration-manager', () => ({},}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: (message: string) => mockNotify({ type: 'success', message }),error: (message: string) => mockNotify({ type: 'error', message }),diff --git a/web/app/components/workflow/header/__tests__/run-mode.spec.tsx b/web/app/components/workflow/header/__tests__/run-mode.spec.tsxindex 2e3c6720656..617181b4935 100644--- a/web/app/components/workflow/header/__tests__/run-mode.spec.tsx+++ b/web/app/components/workflow/header/__tests__/run-mode.spec.tsx@@ -99,7 +99,7 @@ vi.mock('../../hooks/use-dynamic-test-run-options', () => ({useDynamicTestRunOptions: () => mockDynamicOptions,}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: (message: string) => mockNotify({ type: 'success', message }),error: (message: string) => mockNotify({ type: 'error', message }),diff --git a/web/app/components/workflow/header/__tests__/view-history.spec.tsx b/web/app/components/workflow/header/__tests__/view-history.spec.tsxindex b4663317088..4674bef1111 100644--- a/web/app/components/workflow/header/__tests__/view-history.spec.tsx+++ b/web/app/components/workflow/header/__tests__/view-history.spec.tsx@@ -60,7 +60,7 @@ vi.mock('@/app/components/base/loading-placeholder', () => ({LoadingPlaceholder: () => <div data-testid="loading" />,}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: vi.fn(),error: vi.fn(),diff --git a/web/app/components/workflow/header/header-in-restoring.tsx b/web/app/components/workflow/header/header-in-restoring.tsxindex d7b50c68324..22f52134284 100644--- a/web/app/components/workflow/header/header-in-restoring.tsx+++ b/web/app/components/workflow/header/header-in-restoring.tsx@@ -1,6 +1,5 @@import { Button } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { RiHistoryLine } from '@remixicon/react'import { useQuery, useSuspenseQuery } from '@tanstack/react-query'import { useAtomValue } from 'jotai'@@ -8,6 +7,7 @@ import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'import { PlanUpgradeModal } from '@/app/components/billing/plan-upgrade-modal'import { getWorkflowVersionName } from '@/app/components/workflow/utils/version'+import { toast } from '@/app/notifications'import { userProfileQueryOptions } from '@/features/account-profile/client'import { deploymentEditionAtom } from '@/features/system-features/state'import useTheme from '@/hooks/use-theme'diff --git a/web/app/components/workflow/header/run-mode.tsx b/web/app/components/workflow/header/run-mode.tsxindex a3b0d964b89..aacd0011d65 100644--- a/web/app/components/workflow/header/run-mode.tsx+++ b/web/app/components/workflow/header/run-mode.tsx@@ -1,7 +1,6 @@import type { TestRunMenuRef, TriggerOption } from './test-run-menu'import type { EventEmitterValue } from '@/context/event-emitter'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { useHotkey } from '@tanstack/react-hotkeys'import * as React from 'react'import { useCallback, useRef } from 'react'@@ -12,6 +11,7 @@ import { ShortcutKbd } from '@/app/components/workflow/shortcuts/shortcut-kbd'import { useStore } from '@/app/components/workflow/store/workflow'import { WorkflowRunningStatus } from '@/app/components/workflow/types'import { EVENT_WORKFLOW_STOP } from '@/app/components/workflow/variable-inspect/types'+import { toast } from '@/app/notifications'import { useEventEmitterContextContext } from '@/context/event-emitter'import { useWorkflowRunValidation } from '../hooks/use-checklist'import { useDynamicTestRunOptions } from '../hooks/use-dynamic-test-run-options'diff --git a/web/app/components/workflow/hooks/__tests__/use-checklist.spec.ts b/web/app/components/workflow/hooks/__tests__/use-checklist.spec.tsindex b4d5c20bec7..90234cf1bec 100644--- a/web/app/components/workflow/hooks/__tests__/use-checklist.spec.ts+++ b/web/app/components/workflow/hooks/__tests__/use-checklist.spec.ts@@ -141,7 +141,7 @@ vi.mock('../index', () => ({useNodesMetaData: () => ({ nodes: [], nodesMap: mockNodesMap }),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: vi.fn(),error: vi.fn(),diff --git a/web/app/components/workflow/hooks/__tests__/use-locate-node.spec.tsx b/web/app/components/workflow/hooks/__tests__/use-locate-node.spec.tsxindex be59307b7a1..2e1104f639b 100644--- a/web/app/components/workflow/hooks/__tests__/use-locate-node.spec.tsx+++ b/web/app/components/workflow/hooks/__tests__/use-locate-node.spec.tsx@@ -12,7 +12,7 @@ vi.mock('@/next/navigation', () => ({useSearchParams: () => mockSearchParams,}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: Object.assign(vi.fn(), {success: mockToastSuccess,error: mockToastError,diff --git a/web/app/components/workflow/hooks/use-checklist.ts b/web/app/components/workflow/hooks/use-checklist.tsindex 51ce2238b96..d1c7a83f489 100644--- a/web/app/components/workflow/hooks/use-checklist.ts+++ b/web/app/components/workflow/hooks/use-checklist.ts@@ -19,7 +19,6 @@ import type { Emoji } from '@/app/components/tools/types'import type { AgentToolPublishIssue } from '@/features/agent-v2/agent-detail/configure/tool-provider-catalog'import type { DataSet } from '@/models/datasets'import type { I18nKeysWithPrefix } from '@/types/i18n'-import { toast } from '@langgenius/dify-ui/toast'import { useQueries, useQuery, useQueryClient } from '@tanstack/react-query'import isDeepEqual from 'fast-deep-equal'import { useCallback, useEffect, useMemo, useRef } from 'react'@@ -29,6 +28,7 @@ import { useStore as useAppStore } from '@/app/components/app/store'import { ModelTypeEnum } from '@/app/components/header/account-setting/model-provider-page/declarations'import { normalizeModelProviderModelsResponse } from '@/app/components/header/account-setting/model-provider-page/utils'import useNodes from '@/app/components/workflow/store/workflow/use-nodes'+import { toast } from '@/app/notifications'import { MAX_TREE_DEPTH } from '@/config'import { useGetLanguage } from '@/context/i18n'import { agentSoulConfigToFormState } from '@/features/agent-v2/agent-composer/conversions'diff --git a/web/app/components/workflow/hooks/use-locate-node.ts b/web/app/components/workflow/hooks/use-locate-node.tsindex 28e97bbd2e5..4c501af7525 100644--- a/web/app/components/workflow/hooks/use-locate-node.ts+++ b/web/app/components/workflow/hooks/use-locate-node.ts@@ -1,9 +1,9 @@'use client'import type { Node } from '../types'-import { toast } from '@langgenius/dify-ui/toast'import { useEffect, useRef } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { useSearchParams } from '@/next/navigation'import { scrollToWorkflowNode } from '../utils/node-navigation'import { useNodesInteractions } from './use-nodes-interactions'diff --git a/web/app/components/workflow/hooks/use-nodes-interactions.ts b/web/app/components/workflow/hooks/use-nodes-interactions.tsindex 94df08aeca4..1a52451f33f 100644--- a/web/app/components/workflow/hooks/use-nodes-interactions.ts+++ b/web/app/components/workflow/hooks/use-nodes-interactions.ts@@ -13,12 +13,12 @@ import type { LoopNodeType } from '../nodes/loop/types'import type { VariableAssignerNodeType } from '../nodes/variable-assigner/types'import type { Edge, Node, OnNodeAdd } from '../types'import type { RAGPipelineVariables } from '@/models/pipeline'-import { toast } from '@langgenius/dify-ui/toast'import { useQuery } from '@tanstack/react-query'import { produce } from 'immer'import { useCallback, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import { getConnectedEdges, getOutgoers, useReactFlow } from 'reactflow'+import { toast } from '@/app/notifications'import { consoleQuery } from '@/service/console'import { collaborationManager } from '../collaboration/core/collaboration-manager'import {diff --git a/web/app/components/workflow/index.tsx b/web/app/components/workflow/index.tsxindex dfe147756b0..7371fd07bd1 100644--- a/web/app/components/workflow/index.tsx+++ b/web/app/components/workflow/index.tsx@@ -19,7 +19,6 @@ import {AlertDialogTitle,} from '@langgenius/dify-ui/alert-dialog'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { useEventListener } from 'ahooks'import { isEqual } from 'es-toolkit/predicate'import { setAutoFreeze } from 'immer'@@ -47,6 +46,7 @@ import ReactFlow, {useReactFlow,useStoreApi,} from 'reactflow'+import { toast } from '@/app/notifications'import { IS_DEV } from '@/config'import { useEventEmitterContextContext } from '@/context/event-emitter'import {diff --git a/web/app/components/workflow/llm-environment-variable-value-field.tsx b/web/app/components/workflow/llm-environment-variable-value-field.tsxindex a3fcecdefd3..26f4b52338d 100644--- a/web/app/components/workflow/llm-environment-variable-value-field.tsx+++ b/web/app/components/workflow/llm-environment-variable-value-field.tsx@@ -5,10 +5,10 @@ import type {LLMCompletionParams,LLMEnvironmentVariableValue,} from '@/app/components/workflow/types'-import { toast } from '@langgenius/dify-ui/toast'import { useTranslation } from 'react-i18next'import { useTextGenerationCurrentProviderAndModelAndModelList } from '@/app/components/header/account-setting/model-provider-page/hooks'import ModelParameterModal from '@/app/components/header/account-setting/model-provider-page/model-parameter-modal'+import { toast } from '@/app/notifications'export function LLMEnvironmentVariableValueField({disabled = false,diff --git a/web/app/components/workflow/nodes/_base/components/__tests__/file-support.spec.tsx b/web/app/components/workflow/nodes/_base/components/__tests__/file-support.spec.tsxindex 697416791ae..d4b823c1c52 100644--- a/web/app/components/workflow/nodes/_base/components/__tests__/file-support.spec.tsx+++ b/web/app/components/workflow/nodes/_base/components/__tests__/file-support.spec.tsx@@ -20,7 +20,7 @@ vi.mock('@/app/components/base/file-uploader/hooks', () => ({useFileSizeLimit: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: vi.fn(),error: vi.fn(),diff --git a/web/app/components/workflow/nodes/_base/components/before-run-form/__tests__/index.spec.tsx b/web/app/components/workflow/nodes/_base/components/before-run-form/__tests__/index.spec.tsxindex e3896e8db71..40568313442 100644--- a/web/app/components/workflow/nodes/_base/components/before-run-form/__tests__/index.spec.tsx+++ b/web/app/components/workflow/nodes/_base/components/before-run-form/__tests__/index.spec.tsx@@ -1,11 +1,11 @@import type { Props as FormProps } from '../form'import type { BeforeRunFormProps } from '../index'-import { toast } from '@langgenius/dify-ui/toast'import { fireEvent, render, screen } from '@testing-library/react'import { BlockEnum, InputVarType } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import BeforeRunForm from '../index'-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: vi.fn(),},diff --git a/web/app/components/workflow/nodes/_base/components/before-run-form/index.tsx b/web/app/components/workflow/nodes/_base/components/before-run-form/index.tsxindex d10a2f18eb0..fe961a5c8fd 100644--- a/web/app/components/workflow/nodes/_base/components/before-run-form/index.tsx+++ b/web/app/components/workflow/nodes/_base/components/before-run-form/index.tsx@@ -8,13 +8,13 @@ import type { NodeRunningStatus } from '@/app/components/workflow/types'import type { HumanInputFormData } from '@/types/workflow'import { Button } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import * as React from 'react'import { useEffect, useRef } from 'react'import { useTranslation } from 'react-i18next'import Split from '@/app/components/workflow/nodes/_base/components/split'import SingleRunForm from '@/app/components/workflow/nodes/human-input/components/single-run-form'import { BlockEnum } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import Form from './form'import {buildSubmitData,diff --git a/web/app/components/workflow/nodes/_base/components/variable/__tests__/output-var-list.spec.tsx b/web/app/components/workflow/nodes/_base/components/variable/__tests__/output-var-list.spec.tsxindex d22420edf58..89b185ec1f2 100644--- a/web/app/components/workflow/nodes/_base/components/variable/__tests__/output-var-list.spec.tsx+++ b/web/app/components/workflow/nodes/_base/components/variable/__tests__/output-var-list.spec.tsx@@ -16,7 +16,7 @@ vi.mock('../var-type-picker', () => ({),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: { error: vi.fn() },}))diff --git a/web/app/components/workflow/nodes/_base/components/variable/output-var-list.tsx b/web/app/components/workflow/nodes/_base/components/variable/output-var-list.tsxindex 884511d6c22..d018e9a967f 100644--- a/web/app/components/workflow/nodes/_base/components/variable/output-var-list.tsx+++ b/web/app/components/workflow/nodes/_base/components/variable/output-var-list.tsx@@ -3,12 +3,12 @@ import type { FC } from 'react'import type { OutputVar } from '../../../code/types'import type { VarType } from '@/app/components/workflow/types'import { Input } from '@langgenius/dify-ui/input'-import { toast } from '@langgenius/dify-ui/toast'import { useDebounceFn } from 'ahooks'import { produce } from 'immer'import * as React from 'react'import { useCallback } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { checkKeys, replaceSpaceWithUnderscoreInVarNameInput } from '@/utils/var'import RemoveButton from '../remove-button'import VarTypePicker from './var-type-picker'diff --git a/web/app/components/workflow/nodes/_base/components/variable/var-list.tsx b/web/app/components/workflow/nodes/_base/components/variable/var-list.tsxindex a3556c18d7d..eaae1ba5fbf 100644--- a/web/app/components/workflow/nodes/_base/components/variable/var-list.tsx+++ b/web/app/components/workflow/nodes/_base/components/variable/var-list.tsx@@ -4,7 +4,6 @@ import type { ValueSelector, Var, Variable } from '@/app/components/workflow/typimport { cn } from '@langgenius/dify-ui/cn'import { IconButton } from '@langgenius/dify-ui/icon-button'import { Input } from '@langgenius/dify-ui/input'-import { toast } from '@langgenius/dify-ui/toast'import { useDebounceFn } from 'ahooks'import { produce } from 'immer'import * as React from 'react'@@ -13,6 +12,7 @@ import { useTranslation } from 'react-i18next'import { ReactSortable } from 'react-sortablejs'import { useKeyboardSortable } from '@/app/components/base/keyboard-sortable/use-keyboard-sortable'import { VarType as VarKindType } from '@/app/components/workflow/nodes/tool/types'+import { toast } from '@/app/notifications'import { checkKeys, replaceSpaceWithUnderscoreInVarNameInput } from '@/utils/var'import RemoveButton from '../remove-button'import VarReferencePicker from './var-reference-picker'diff --git a/web/app/components/workflow/nodes/_base/components/workflow-panel/last-run/use-last-run.ts b/web/app/components/workflow/nodes/_base/components/workflow-panel/last-run/use-last-run.tsindex df98ce1cee7..68cdff9c16e 100644--- a/web/app/components/workflow/nodes/_base/components/workflow-panel/last-run/use-last-run.ts+++ b/web/app/components/workflow/nodes/_base/components/workflow-panel/last-run/use-last-run.ts@@ -2,7 +2,6 @@ import type { Props as FormProps } from '@/app/components/workflow/nodes/_base/cimport type { Params as OneStepRunParams } from '@/app/components/workflow/nodes/_base/hooks/use-one-step-run'// importimport type { CommonNodeType, ValueSelector } from '@/app/components/workflow/types'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback, useEffect, useState } from 'react'import useOneStepRun from '@/app/components/workflow/nodes/_base/hooks/use-one-step-run'import useVariableAssignerSingleRunFormParams from '@/app/components/workflow/nodes/assigner/use-single-run-form-params'@@ -27,6 +26,7 @@ import useVariableAggregatorSingleRunFormParams from '@/app/components/workflow/import { useStore, useWorkflowStore } from '@/app/components/workflow/store'import { BlockEnum } from '@/app/components/workflow/types'import { isSupportCustomRunForm } from '@/app/components/workflow/utils'+import { toast } from '@/app/notifications'import { VALUE_SELECTOR_DELIMITER as DELIMITER } from '@/config'import { useInvalidLastRun } from '@/service/use-workflow'import { useWorkflowRunValidation } from '../../../../../hooks/use-checklist'diff --git a/web/app/components/workflow/nodes/_base/hooks/__tests__/use-one-step-run.spec.ts b/web/app/components/workflow/nodes/_base/hooks/__tests__/use-one-step-run.spec.tsindex 43d36571549..2eb7039455b 100644--- a/web/app/components/workflow/nodes/_base/hooks/__tests__/use-one-step-run.spec.ts+++ b/web/app/components/workflow/nodes/_base/hooks/__tests__/use-one-step-run.spec.ts@@ -16,7 +16,7 @@ const mockWorkflowState = {setListeningTriggerIsAll: vi.fn(),setShowVariableInspectPanel: vi.fn(),}-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: vi.fn(),},diff --git a/web/app/components/workflow/nodes/_base/hooks/use-one-step-run.ts b/web/app/components/workflow/nodes/_base/hooks/use-one-step-run.tsindex feab26bb1df..508b9af846d 100644--- a/web/app/components/workflow/nodes/_base/hooks/use-one-step-run.ts+++ b/web/app/components/workflow/nodes/_base/hooks/use-one-step-run.ts@@ -8,7 +8,6 @@ import type {} from '@/app/components/workflow/types'import type { FlowType } from '@/types/common'import type { NodeRunResult, NodeTracing } from '@/types/workflow'-import { toast } from '@langgenius/dify-ui/toast'import { unionBy } from 'es-toolkit/compat'import { noop } from 'es-toolkit/function'import { produce } from 'immer'@@ -48,6 +47,7 @@ import {WorkflowRunningStatus,} from '@/app/components/workflow/types'import { EVENT_WORKFLOW_STOP } from '@/app/components/workflow/variable-inspect/types'+import { toast } from '@/app/notifications'import { useEventEmitterContextContext } from '@/context/event-emitter'import { post, ssePost } from '@/service/base'import {diff --git a/web/app/components/workflow/nodes/agent-v2/__tests__/hooks.spec.tsx b/web/app/components/workflow/nodes/agent-v2/__tests__/hooks.spec.tsxindex a7d9b39c37c..3c5ce2de291 100644--- a/web/app/components/workflow/nodes/agent-v2/__tests__/hooks.spec.tsx+++ b/web/app/components/workflow/nodes/agent-v2/__tests__/hooks.spec.tsx@@ -130,7 +130,7 @@ const mockSnippetComposerQueryOptions = vi.hoisted(() =>)const trackCreateAppMock = vi.hoisted(() => vi.fn())-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: vi.fn(),},diff --git a/web/app/components/workflow/nodes/agent-v2/components/__tests__/save-inline-agent-to-roster-dialog.spec.tsx b/web/app/components/workflow/nodes/agent-v2/components/__tests__/save-inline-agent-to-roster-dialog.spec.tsxindex ff949ad2267..2e8f247f8c2 100644--- a/web/app/components/workflow/nodes/agent-v2/components/__tests__/save-inline-agent-to-roster-dialog.spec.tsx+++ b/web/app/components/workflow/nodes/agent-v2/components/__tests__/save-inline-agent-to-roster-dialog.spec.tsx@@ -20,7 +20,7 @@ vi.mock('@tanstack/react-query', () => ({}),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: toastMock,}))diff --git a/web/app/components/workflow/nodes/agent-v2/components/agent-orchestrate-panel-content.tsx b/web/app/components/workflow/nodes/agent-v2/components/agent-orchestrate-panel-content.tsxindex 42a260ca554..4b25a75e47c 100644--- a/web/app/components/workflow/nodes/agent-v2/components/agent-orchestrate-panel-content.tsx+++ b/web/app/components/workflow/nodes/agent-v2/components/agent-orchestrate-panel-content.tsx@@ -16,7 +16,6 @@ import {DropdownMenuItem,DropdownMenuTrigger,} from '@langgenius/dify-ui/dropdown-menu'-import { toast } from '@langgenius/dify-ui/toast'import { skipToken, useMutation, useQuery, useQueryClient } from '@tanstack/react-query'import { useAtom, useAtomValue, useStore as useJotaiStore, useSetAtom } from 'jotai'import { ScopeProvider } from 'jotai-scope'@@ -28,6 +27,7 @@ import {useDefaultModel,useTextGenerationCurrentProviderAndModelAndModelList,} from '@/app/components/header/account-setting/model-provider-page/hooks'+import { toast } from '@/app/notifications'import {agentSoulConfigToFormState,formStateToAgentSoulConfig,diff --git a/web/app/components/workflow/nodes/agent-v2/hooks.ts b/web/app/components/workflow/nodes/agent-v2/hooks.tsindex dde2e2cece6..9af87c29ae8 100644--- a/web/app/components/workflow/nodes/agent-v2/hooks.ts+++ b/web/app/components/workflow/nodes/agent-v2/hooks.ts@@ -1,11 +1,11 @@import type { AgentInlineBinding } from '../../block-selector/types'-import { toast } from '@langgenius/dify-ui/toast'import { skipToken, useMutation, useQuery, useQueryClient } from '@tanstack/react-query'import { useCallback } from 'react'import { useTranslation } from 'react-i18next'import { ModelTypeEnum } from '@/app/components/header/account-setting/model-provider-page/declarations'import { useDefaultModel } from '@/app/components/header/account-setting/model-provider-page/hooks'import { useHooksStore } from '@/app/components/workflow/hooks-store'+import { toast } from '@/app/notifications'import { useInlineAgentScope } from '@/features/agent-v2/analytics'import { consoleQuery } from '@/service/console'import { FlowType } from '@/types/common'diff --git a/web/app/components/workflow/nodes/http/components/__tests__/curl-panel.spec.tsx b/web/app/components/workflow/nodes/http/components/__tests__/curl-panel.spec.tsxindex f71af79238a..fecea7190e9 100644--- a/web/app/components/workflow/nodes/http/components/__tests__/curl-panel.spec.tsx+++ b/web/app/components/workflow/nodes/http/components/__tests__/curl-panel.spec.tsx@@ -1,6 +1,6 @@-import { toast } from '@langgenius/dify-ui/toast'import { render, screen } from '@testing-library/react'import userEvent from '@testing-library/user-event'+import { toast } from '@/app/notifications'import { BodyPayloadValueType, BodyType } from '../../types'import CurlPanel from '../curl-panel'import * as curlParser from '../curl-parser'@@ -21,7 +21,7 @@ vi.mock('../../../../hooks/use-nodes-interactions', async (importOriginal) => {}})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: mockToastError,},diff --git a/web/app/components/workflow/nodes/http/components/curl-panel.tsx b/web/app/components/workflow/nodes/http/components/curl-panel.tsxindex 58dfe54d9d8..e00b9ceeb5c 100644--- a/web/app/components/workflow/nodes/http/components/curl-panel.tsx+++ b/web/app/components/workflow/nodes/http/components/curl-panel.tsx@@ -4,10 +4,10 @@ import type { HttpNodeType } from '../types'import { Button } from '@langgenius/dify-ui/button'import { Dialog, DialogContent, DialogTitle } from '@langgenius/dify-ui/dialog'import { Textarea } from '@langgenius/dify-ui/textarea'-import { toast } from '@langgenius/dify-ui/toast'import * as React from 'react'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { useNodesInteractions } from '../../../hooks/use-nodes-interactions'import { parseCurl } from './curl-parser'diff --git a/web/app/components/workflow/nodes/human-input/__tests__/panel.spec.tsx b/web/app/components/workflow/nodes/human-input/__tests__/panel.spec.tsxindex 57c02dc38b5..ba3b2e83d7b 100644--- a/web/app/components/workflow/nodes/human-input/__tests__/panel.spec.tsx+++ b/web/app/components/workflow/nodes/human-input/__tests__/panel.spec.tsx@@ -2,11 +2,11 @@ import type { ReactNode } from 'react'import type useConfig from '../hooks/use-config'import type { HumanInputNodeType } from '../types'import type { NodePanelProps } from '@/app/components/workflow/types'-import { toast } from '@langgenius/dify-ui/toast'import { render, screen } from '@testing-library/react'import userEvent from '@testing-library/user-event'import copy from 'copy-to-clipboard'import { BlockEnum, InputVarType, VarType } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import Panel from '../panel'import { DeliveryMethodType, UserActionButtonType } from '../types'@@ -24,7 +24,7 @@ vi.mock('copy-to-clipboard', () => ({default: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: vi.fn(),},diff --git a/web/app/components/workflow/nodes/human-input/components/__tests__/user-action.spec.tsx b/web/app/components/workflow/nodes/human-input/components/__tests__/user-action.spec.tsxindex d453e1bb90f..5b7a5b38d39 100644--- a/web/app/components/workflow/nodes/human-input/components/__tests__/user-action.spec.tsx+++ b/web/app/components/workflow/nodes/human-input/components/__tests__/user-action.spec.tsx@@ -26,7 +26,7 @@ vi.mock('@langgenius/dify-ui/input', () => ({),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({__esModule: true,toast: {success: (message: string) => mockNotify({ type: 'success', message }),diff --git a/web/app/components/workflow/nodes/human-input/components/delivery-method/__tests__/email-configure-modal.spec.tsx b/web/app/components/workflow/nodes/human-input/components/delivery-method/__tests__/email-configure-modal.spec.tsxindex e413ce6b83c..efa36e3d1ba 100644--- a/web/app/components/workflow/nodes/human-input/components/delivery-method/__tests__/email-configure-modal.spec.tsx+++ b/web/app/components/workflow/nodes/human-input/components/delivery-method/__tests__/email-configure-modal.spec.tsx@@ -17,7 +17,7 @@ const render = (ui: ReactElement) =>wrapper: createAccountProfileQueryWrapper(mockConsoleState.userProfile),})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: (message: string) => mockToastError(message),},diff --git a/web/app/components/workflow/nodes/human-input/components/delivery-method/__tests__/test-email-sender.spec.tsx b/web/app/components/workflow/nodes/human-input/components/delivery-method/__tests__/test-email-sender.spec.tsxindex 459f1d591f2..065fb5e9005 100644--- a/web/app/components/workflow/nodes/human-input/components/delivery-method/__tests__/test-email-sender.spec.tsx+++ b/web/app/components/workflow/nodes/human-input/components/delivery-method/__tests__/test-email-sender.spec.tsx@@ -7,7 +7,6 @@ import type {} from '../../../types'import type { CodeNodeType } from '@/app/components/workflow/nodes/code/types'import type { App, AppSSO } from '@/types/app'-import { toast } from '@langgenius/dify-ui/toast'import { QueryClient, QueryClientProvider } from '@tanstack/react-query'import { fireEvent, screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'@@ -17,11 +16,12 @@ import { HooksStoreContext } from '@/app/components/workflow/hooks-store/provideimport { createHooksStore } from '@/app/components/workflow/hooks-store/store'import { CodeLanguage } from '@/app/components/workflow/nodes/code/types'import { BlockEnum, InputVarType, VarType } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { seedAccountProfileQuery } from '@/test/console/account-profile'import { render } from '@/test/console/render'import EmailSenderModal from '../test-email-sender'-vi.mock('@langgenius/dify-ui/toast', async (importOriginal) => ({+vi.mock('@/app/notifications', async (importOriginal) => ({...(await importOriginal()),toast: {error: vi.fn(),diff --git a/web/app/components/workflow/nodes/human-input/components/delivery-method/email-configure-modal.tsx b/web/app/components/workflow/nodes/human-input/components/delivery-method/email-configure-modal.tsxindex 254e726cb3f..b7621769443 100644--- a/web/app/components/workflow/nodes/human-input/components/delivery-method/email-configure-modal.tsx+++ b/web/app/components/workflow/nodes/human-input/components/delivery-method/email-configure-modal.tsx@@ -5,11 +5,11 @@ import { Dialog, DialogClose, DialogContent, DialogTitle } from '@langgenius/difimport { IconButton } from '@langgenius/dify-ui/icon-button'import { Input } from '@langgenius/dify-ui/input'import { Switch } from '@langgenius/dify-ui/switch'-import { toast } from '@langgenius/dify-ui/toast'import { RiBugLine } from '@remixicon/react'import { useSuspenseQuery } from '@tanstack/react-query'import { memo, useCallback, useId, useState } from 'react'import { Trans, useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { userProfileQueryOptions } from '@/features/account-profile/client'import MailBodyInput from './mail-body-input'import Recipient from './recipient'diff --git a/web/app/components/workflow/nodes/human-input/components/delivery-method/test-email-sender.tsx b/web/app/components/workflow/nodes/human-input/components/delivery-method/test-email-sender.tsxindex d0bf3b339ab..81d9c56d4a2 100644--- a/web/app/components/workflow/nodes/human-input/components/delivery-method/test-email-sender.tsx+++ b/web/app/components/workflow/nodes/human-input/components/delivery-method/test-email-sender.tsx@@ -4,7 +4,6 @@ import { Button } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'import { Dialog, DialogClose, DialogContent, DialogTitle } from '@langgenius/dify-ui/dialog'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { RiArrowRightSFill } from '@remixicon/react'import { useSuspenseQuery } from '@tanstack/react-query'import { noop, unionBy } from 'es-toolkit/compat'@@ -23,6 +22,7 @@ import {isSystemVar,} from '@/app/components/workflow/nodes/_base/components/variable/utils'import { InputVarType, VarType } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { currentWorkspaceAtom } from '@/context/workspace-state'import { userProfileQueryOptions } from '@/features/account-profile/client'import { useMembers } from '@/service/use-common'diff --git a/web/app/components/workflow/nodes/human-input/components/user-action.tsx b/web/app/components/workflow/nodes/human-input/components/user-action.tsxindex 042d93f8881..42f5ca8f87f 100644--- a/web/app/components/workflow/nodes/human-input/components/user-action.tsx+++ b/web/app/components/workflow/nodes/human-input/components/user-action.tsx@@ -2,9 +2,9 @@ import type { FC } from 'react'import type { UserAction } from '../types'import { IconButton } from '@langgenius/dify-ui/icon-button'import { Input } from '@langgenius/dify-ui/input'-import { toast } from '@langgenius/dify-ui/toast'import * as React from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import ButtonStyleDropdown from './button-style-dropdown'const i18nPrefix = 'nodes.humanInput'diff --git a/web/app/components/workflow/nodes/human-input/panel.tsx b/web/app/components/workflow/nodes/human-input/panel.tsxindex a78f84327ea..3388fad52d5 100644--- a/web/app/components/workflow/nodes/human-input/panel.tsx+++ b/web/app/components/workflow/nodes/human-input/panel.tsx@@ -4,7 +4,6 @@ import type { NodePanelProps, Var } from '@/app/components/workflow/types'import { Button } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import {RiAddLine,RiClipboardLine,@@ -23,6 +22,7 @@ import Split from '@/app/components/workflow/nodes/_base/components/split'import useAvailableVarList from '@/app/components/workflow/nodes/_base/hooks/use-available-var-list'import { useStore } from '@/app/components/workflow/store'import { VarType } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import DeliveryMethod from './components/delivery-method'import FormContent from './components/form-content'import FormContentPreview from './components/form-content-preview'diff --git a/web/app/components/workflow/nodes/iteration/__tests__/integration.spec.tsx b/web/app/components/workflow/nodes/iteration/__tests__/integration.spec.tsxindex c1040ccb82b..2801c5da385 100644--- a/web/app/components/workflow/nodes/iteration/__tests__/integration.spec.tsx+++ b/web/app/components/workflow/nodes/iteration/__tests__/integration.spec.tsx@@ -1,9 +1,9 @@import type { IterationNodeType } from '../types'import type { PanelProps } from '@/types/workflow'-import { toast } from '@langgenius/dify-ui/toast'import { render, screen } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { ErrorHandleMode } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { BlockEnum, VarType } from '../../../types'import Node from '../node'import Panel from '../panel'@@ -13,7 +13,7 @@ const mockHandleNodeAdd = vi.fn()const mockHandleNodeIterationRerender = vi.fn()let mockNodesReadOnly = false-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: vi.fn(),error: vi.fn(),diff --git a/web/app/components/workflow/nodes/iteration/node.tsx b/web/app/components/workflow/nodes/iteration/node.tsxindex 2d0b1de10d4..a33763e65e3 100644--- a/web/app/components/workflow/nodes/iteration/node.tsx+++ b/web/app/components/workflow/nodes/iteration/node.tsx@@ -2,10 +2,10 @@ import type { FC } from 'react'import type { IterationNodeType } from './types'import type { NodeProps } from '@/app/components/workflow/types'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { memo, useEffect, useState } from 'react'import { useTranslation } from 'react-i18next'import { Background, useNodesInitialized, useViewport } from 'reactflow'+import { toast } from '@/app/notifications'import { IterationStartNodeDumb } from '../iteration-start'import AddBlock from './add-block'import { useNodeIterationInteractions } from './use-interactions'diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-config.tsx b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-config.tsxindex 3b6800bcfa6..b326f7a8978 100644--- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-config.tsx+++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-config.tsx@@ -2,10 +2,10 @@ import type { SchemaRoot } from '../../types'import { Button } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'import { Tabs, TabsList, TabsPanel, TabsTab } from '@langgenius/dify-ui/tabs'-import { toast } from '@langgenius/dify-ui/toast'import { useState } from 'react'import { useTranslation } from 'react-i18next'import Divider from '@/app/components/base/divider'+import { toast } from '@/app/notifications'import { JSON_SCHEMA_MAX_DEPTH } from '@/config'import { Type } from '../../types'import {diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-generator/index.tsx b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-generator/index.tsxindex 2b2875f1123..e27b5e475c3 100644--- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-generator/index.tsx+++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-schema-generator/index.tsx@@ -3,12 +3,12 @@ import type { SchemaRoot } from '../../../types'import type { FormValue } from '@/app/components/header/account-setting/model-provider-page/declarations'import type { CompletionParams, Model } from '@/types/app'import { Popover, PopoverContent, PopoverTrigger } from '@langgenius/dify-ui/popover'-import { toast } from '@langgenius/dify-ui/toast'import * as React from 'react'import { useCallback, useState } from 'react'import { useAutoGenModel } from '@/app/components/app/configuration/config/auto-gen-model-storage'import { ModelTypeEnum } from '@/app/components/header/account-setting/model-provider-page/declarations'import { useModelListAndDefaultModelAndCurrentProviderAndModel } from '@/app/components/header/account-setting/model-provider-page/hooks'+import { toast } from '@/app/notifications'import useTheme from '@/hooks/use-theme'import { useGenerateStructuredOutputRules } from '@/service/use-common'import { ModelModeType, Theme } from '@/types/app'diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/hooks.ts b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/hooks.tsindex 119a174f273..c34e7ac490d 100644--- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/hooks.ts+++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/hooks.ts@@ -1,10 +1,10 @@import type { VisualEditorProps } from '.'import type { Field } from '../../../types'import type { EditData } from './edit-card'-import { toast } from '@langgenius/dify-ui/toast'import { noop } from 'es-toolkit/function'import { produce } from 'immer'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { ArrayType, Type } from '../../../types'import { findPropertyWithPath } from '../../../utils'import { useMittContext } from './context'diff --git a/web/app/components/workflow/nodes/llm/panel.tsx b/web/app/components/workflow/nodes/llm/panel.tsxindex 17752a76797..97c66c5be0b 100644--- a/web/app/components/workflow/nodes/llm/panel.tsx+++ b/web/app/components/workflow/nodes/llm/panel.tsx@@ -9,7 +9,6 @@ import {SelectItemText,SelectTrigger,} from '@langgenius/dify-ui/select'-import { toast } from '@langgenius/dify-ui/toast'import { useQuery } from '@tanstack/react-query'import * as React from 'react'import { useCallback, useLayoutEffect, useRef } from 'react'@@ -20,6 +19,7 @@ import Field from '@/app/components/workflow/nodes/_base/components/field'import FormInputTypeSwitch from '@/app/components/workflow/nodes/_base/components/form-input-type-switch'import Split from '@/app/components/workflow/nodes/_base/components/split'import VarList from '@/app/components/workflow/nodes/_base/components/variable/var-list'+import { toast } from '@/app/notifications'import { consoleQuery } from '@/service/console'import { FlowType } from '@/types/common'import { fetchAndMergeValidCompletionParams } from '@/utils/completion-params'diff --git a/web/app/components/workflow/nodes/loop/components/loop-variables/item.tsx b/web/app/components/workflow/nodes/loop/components/loop-variables/item.tsxindex a1f3a151ed3..0f0e8319f74 100644--- a/web/app/components/workflow/nodes/loop/components/loop-variables/item.tsx+++ b/web/app/components/workflow/nodes/loop/components/loop-variables/item.tsx@@ -4,11 +4,11 @@ import type {} from '@/app/components/workflow/nodes/loop/types'import { IconButton } from '@langgenius/dify-ui/icon-button'import { Input } from '@langgenius/dify-ui/input'-import { toast } from '@langgenius/dify-ui/toast'import { RiDeleteBinLine } from '@remixicon/react'import { useCallback } from 'react'import { useTranslation } from 'react-i18next'import { ValueType, VarType } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { checkKeys, replaceSpaceWithUnderscoreInVarNameInput } from '@/utils/var'import FormItem from './form-item'import InputModeSelect from './input-mode-selec'diff --git a/web/app/components/workflow/nodes/parameter-extractor/__tests__/integration.spec.tsx b/web/app/components/workflow/nodes/parameter-extractor/__tests__/integration.spec.tsxindex 562cf04b74c..b68861cbe8a 100644--- a/web/app/components/workflow/nodes/parameter-extractor/__tests__/integration.spec.tsx+++ b/web/app/components/workflow/nodes/parameter-extractor/__tests__/integration.spec.tsx@@ -2,10 +2,10 @@ import type { ReactNode } from 'react'import type { Var } from '../../../types'import type { Param, ParameterExtractorNodeType } from '../types'import type { PanelProps } from '@/types/workflow'-import { toast } from '@langgenius/dify-ui/toast'import { fireEvent, render, screen } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { useTextGenerationCurrentProviderAndModelAndModelList } from '@/app/components/header/account-setting/model-provider-page/hooks'+import { toast } from '@/app/notifications'import { AppModeEnum } from '@/types/app'import { BlockEnum } from '../../../types'import ExtractParameter from '../components/extract-parameter/list'@@ -20,7 +20,7 @@ const reasoningModeFunctionToolCallingLabel ='workflow.nodes.parameterExtractor.reasoningModeFunctionToolCalling'const reasoningModePromptLabel = 'workflow.nodes.parameterExtractor.reasoningModePrompt'-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: vi.fn(),error: vi.fn(),diff --git a/web/app/components/workflow/nodes/parameter-extractor/components/extract-parameter/__tests__/update.spec.tsx b/web/app/components/workflow/nodes/parameter-extractor/components/extract-parameter/__tests__/update.spec.tsxindex 50b81a969fe..ca5a09b6177 100644--- a/web/app/components/workflow/nodes/parameter-extractor/components/extract-parameter/__tests__/update.spec.tsx+++ b/web/app/components/workflow/nodes/parameter-extractor/components/extract-parameter/__tests__/update.spec.tsx@@ -1,11 +1,11 @@import type { Param } from '../../../types'-import { toast } from '@langgenius/dify-ui/toast'import { fireEvent, render, screen, waitFor, within } from '@testing-library/react'import userEvent from '@testing-library/user-event'+import { toast } from '@/app/notifications'import { ParamType } from '../../../types'import Update from '../update'-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: vi.fn(),error: vi.fn(),diff --git a/web/app/components/workflow/nodes/parameter-extractor/components/extract-parameter/update.tsx b/web/app/components/workflow/nodes/parameter-extractor/components/extract-parameter/update.tsxindex ef467577f18..406d500232d 100644--- a/web/app/components/workflow/nodes/parameter-extractor/components/extract-parameter/update.tsx+++ b/web/app/components/workflow/nodes/parameter-extractor/components/extract-parameter/update.tsx@@ -16,13 +16,13 @@ import {} from '@langgenius/dify-ui/select'import { Switch } from '@langgenius/dify-ui/switch'import { Textarea } from '@langgenius/dify-ui/textarea'-import { toast } from '@langgenius/dify-ui/toast'import * as React from 'react'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'import Field from '@/app/components/app/configuration/config-var/config-modal/field'import ConfigSelect from '@/app/components/app/configuration/config-var/config-select'import { ChangeType } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { checkKeys } from '@/utils/var'import { ParamType } from '../../types'diff --git a/web/app/components/workflow/nodes/start/__tests__/use-config.spec.ts b/web/app/components/workflow/nodes/start/__tests__/use-config.spec.tsindex 27b0e224e80..4854693d88a 100644--- a/web/app/components/workflow/nodes/start/__tests__/use-config.spec.ts+++ b/web/app/components/workflow/nodes/start/__tests__/use-config.spec.ts@@ -38,7 +38,7 @@ vi.mock('../../../hooks/use-inspect-vars-crud', () => ({default: (...args: unknown[]) => mockUseInspectVarsCrud(...args),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({__esModule: true,toast: {error: (message: string) => mockNotify({ type: 'error', message }),diff --git a/web/app/components/workflow/nodes/start/components/var-list.tsx b/web/app/components/workflow/nodes/start/components/var-list.tsxindex 12f2084c55b..de855b93a5f 100644--- a/web/app/components/workflow/nodes/start/components/var-list.tsx+++ b/web/app/components/workflow/nodes/start/components/var-list.tsx@@ -3,7 +3,6 @@ import type { FC } from 'react'import type { InputVar, MoreInfo } from '@/app/components/workflow/types'import { cn } from '@langgenius/dify-ui/cn'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { produce } from 'immer'import * as React from 'react'import { useCallback, useMemo } from 'react'@@ -11,6 +10,7 @@ import { useTranslation } from 'react-i18next'import { ReactSortable } from 'react-sortablejs'import { useKeyboardSortable } from '@/app/components/base/keyboard-sortable/use-keyboard-sortable'import { ChangeType } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { hasDuplicateStr } from '@/utils/var'import VarItem from './var-item'diff --git a/web/app/components/workflow/nodes/start/use-config.ts b/web/app/components/workflow/nodes/start/use-config.tsindex 6e1a9d127b2..35f2613f6cb 100644--- a/web/app/components/workflow/nodes/start/use-config.ts+++ b/web/app/components/workflow/nodes/start/use-config.ts@@ -1,11 +1,11 @@import type { StartNodeType } from './types'import type { InputVar, MoreInfo, ValueSelector } from '@/app/components/workflow/types'-import { toast } from '@langgenius/dify-ui/toast'import { produce } from 'immer'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'import useNodeCrud from '@/app/components/workflow/nodes/_base/hooks/use-node-crud'import { ChangeType } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { hasDuplicateStr } from '@/utils/var'import useInspectVarsCrud from '../../hooks/use-inspect-vars-crud'import { useIsChatMode, useNodesReadOnly, useWorkflow } from '../../hooks/use-workflow'diff --git a/web/app/components/workflow/nodes/tool/hooks/use-config.ts b/web/app/components/workflow/nodes/tool/hooks/use-config.tsindex b3a0ee380b9..e12b95f93a0 100644--- a/web/app/components/workflow/nodes/tool/hooks/use-config.ts+++ b/web/app/components/workflow/nodes/tool/hooks/use-config.ts@@ -1,6 +1,5 @@import type { ToolNodeType, ToolVarInputs } from '../types'import type { InputVar } from '@/app/components/workflow/types'-import { toast } from '@langgenius/dify-ui/toast'import { capitalize } from 'es-toolkit/string'import { produce } from 'immer'import { useCallback, useEffect, useMemo, useState } from 'react'@@ -13,6 +12,7 @@ import {} from '@/app/components/tools/utils/to-form-schema'import useNodeCrud from '@/app/components/workflow/nodes/_base/hooks/use-node-crud'import { useWorkflowStore } from '@/app/components/workflow/store'+import { toast } from '@/app/notifications'import { updateBuiltInToolCredential } from '@/service/tools'import { useInvalidToolsByType } from '@/service/use-tools'import { useNodesReadOnly } from '../../../hooks/use-workflow'diff --git a/web/app/components/workflow/nodes/trigger-webhook/__tests__/use-config.spec.tsx b/web/app/components/workflow/nodes/trigger-webhook/__tests__/use-config.spec.tsxindex 3cf1530b045..afd7c069518 100644--- a/web/app/components/workflow/nodes/trigger-webhook/__tests__/use-config.spec.tsx+++ b/web/app/components/workflow/nodes/trigger-webhook/__tests__/use-config.spec.tsx@@ -1,8 +1,8 @@import type { WebhookTriggerNodeType } from '../types'-import { toast } from '@langgenius/dify-ui/toast'import { renderHook } from '@testing-library/react'import { useStore as useAppStore } from '@/app/components/app/store'import { BlockEnum, VarType } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { fetchWebhookUrl } from '@/service/apps'import { createNodeCrudModuleMock } from '../../__tests__/use-config-test-utils'import { useConfig } from '../use-config'@@ -21,7 +21,7 @@ vi.mock('react-i18next', async () => {}})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({__esModule: true,toast: {error: vi.fn(),diff --git a/web/app/components/workflow/nodes/trigger-webhook/use-config.ts b/web/app/components/workflow/nodes/trigger-webhook/use-config.tsindex a87e165a5d6..be9cacbcb47 100644--- a/web/app/components/workflow/nodes/trigger-webhook/use-config.ts+++ b/web/app/components/workflow/nodes/trigger-webhook/use-config.ts@@ -1,10 +1,10 @@import type { SelectorParam } from 'i18next'import type { HttpMethod, WebhookHeader, WebhookParameter, WebhookTriggerNodeType } from './types'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback } from 'react'import { useTranslation } from 'react-i18next'import { useStore as useAppStore } from '@/app/components/app/store'import useNodeCrud from '@/app/components/workflow/nodes/_base/hooks/use-node-crud'+import { toast } from '@/app/notifications'import { fetchWebhookUrl } from '@/service/apps'import { useNodesReadOnly, useWorkflow } from '../../hooks/use-workflow'import {diff --git a/web/app/components/workflow/nodes/variable-assigner/components/__tests__/var-group-item.spec.tsx b/web/app/components/workflow/nodes/variable-assigner/components/__tests__/var-group-item.spec.tsxindex 63a20e43148..44a6dbf5e05 100644--- a/web/app/components/workflow/nodes/variable-assigner/components/__tests__/var-group-item.spec.tsx+++ b/web/app/components/workflow/nodes/variable-assigner/components/__tests__/var-group-item.spec.tsx@@ -1,12 +1,12 @@import type { ComponentProps } from 'react'-import { toast } from '@langgenius/dify-ui/toast'import { fireEvent, screen } from '@testing-library/react'import { createNode, resetFixtureCounters } from '@/app/components/workflow/__tests__/fixtures'import { renderWorkflowFlowComponent } from '@/app/components/workflow/__tests__/workflow-test-env'import { BlockEnum, VarType } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import VarGroupItem from '../var-group-item'-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: vi.fn(),error: vi.fn(),diff --git a/web/app/components/workflow/nodes/variable-assigner/components/var-group-item.tsx b/web/app/components/workflow/nodes/variable-assigner/components/var-group-item.tsxindex becc5948849..b275159186e 100644--- a/web/app/components/workflow/nodes/variable-assigner/components/var-group-item.tsx+++ b/web/app/components/workflow/nodes/variable-assigner/components/var-group-item.tsx@@ -2,7 +2,6 @@import type { ChangeEvent, FC } from 'react'import type { VarGroupItem as VarGroupItemType } from '../types'import type { NodeOutPutVar, ValueSelector, Var } from '@/app/components/workflow/types'-import { toast } from '@langgenius/dify-ui/toast'import { RiDeleteBinLine } from '@remixicon/react'import { produce } from 'immer'import * as React from 'react'@@ -12,6 +11,7 @@ import { Folder } from '@/app/components/base/icons/src/vender/line/files'import Field from '@/app/components/workflow/nodes/_base/components/field'import { VarType as VarKindType } from '@/app/components/workflow/nodes/tool/types'import { VarType } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { checkKeys, replaceSpaceWithUnderscoreInVarNameInput } from '@/utils/var'import VarReferencePicker from '../../_base/components/variable/var-reference-picker'import VarList from '../components/var-list'diff --git a/web/app/components/workflow/note-node/note-editor/plugins/link-editor-plugin/__tests__/hooks.spec.tsx b/web/app/components/workflow/note-node/note-editor/plugins/link-editor-plugin/__tests__/hooks.spec.tsxindex 93913ecdacf..354af797063 100644--- a/web/app/components/workflow/note-node/note-editor/plugins/link-editor-plugin/__tests__/hooks.spec.tsx+++ b/web/app/components/workflow/note-node/note-editor/plugins/link-editor-plugin/__tests__/hooks.spec.tsx@@ -67,7 +67,7 @@ vi.mock('lexical', () => ({COMMAND_PRIORITY_LOW: 1,}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: mockToastError,},diff --git a/web/app/components/workflow/note-node/note-editor/plugins/link-editor-plugin/hooks.ts b/web/app/components/workflow/note-node/note-editor/plugins/link-editor-plugin/hooks.tsindex b4338e9c2bd..01efe72ac52 100644--- a/web/app/components/workflow/note-node/note-editor/plugins/link-editor-plugin/hooks.ts+++ b/web/app/components/workflow/note-node/note-editor/plugins/link-editor-plugin/hooks.ts@@ -1,4 +1,3 @@-import { toast } from '@langgenius/dify-ui/toast'import { TOGGLE_LINK_COMMAND } from '@lexical/link'import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'import { mergeRegister } from '@lexical/utils'@@ -6,6 +5,7 @@ import { escape } from 'es-toolkit/string'import { CLICK_COMMAND, COMMAND_PRIORITY_LOW } from 'lexical'import { useCallback, useEffect } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { useNoteEditorStore } from '../../store'import { urlRegExp } from '../../utils'diff --git a/web/app/components/workflow/panel/__tests__/inputs-panel.spec.tsx b/web/app/components/workflow/panel/__tests__/inputs-panel.spec.tsxindex e2e43322165..d9f340afe1d 100644--- a/web/app/components/workflow/panel/__tests__/inputs-panel.spec.tsx+++ b/web/app/components/workflow/panel/__tests__/inputs-panel.spec.tsx@@ -17,7 +17,7 @@ vi.mock('next/navigation', () => ({useParams: () => ({}),}))-vi.mock('@langgenius/dify-ui/toast', async (importOriginal) => ({+vi.mock('@/app/notifications', async (importOriginal) => ({...(await importOriginal()),toast: {success: (message: string) => mockNotify({ type: 'success', message }),diff --git a/web/app/components/workflow/panel/__tests__/workflow-preview.spec.tsx b/web/app/components/workflow/panel/__tests__/workflow-preview.spec.tsxindex d140c428f4b..a9da75f2bcb 100644--- a/web/app/components/workflow/panel/__tests__/workflow-preview.spec.tsx+++ b/web/app/components/workflow/panel/__tests__/workflow-preview.spec.tsx@@ -1,7 +1,6 @@import type { Shape } from '../../store/workflow'import type { HumanInputFieldValue } from '@/app/components/base/chat/chat/answer/human-input-content/field-renderer'import type { HumanInputFilledFormData, HumanInputFormData } from '@/types/workflow'-import { toast } from '@langgenius/dify-ui/toast'import { fireEvent, screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'import copy from 'copy-to-clipboard'@@ -12,6 +11,7 @@ import {} from '@/app/components/workflow/__tests__/fixtures'import { renderWorkflowComponent as renderWithWorkflowStore } from '@/app/components/workflow/__tests__/workflow-test-env'import { WorkflowRunningStatus } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { submitHumanInputForm } from '@/service/workflow'import WorkflowPreview from '../workflow-preview'@@ -26,7 +26,7 @@ vi.mock('copy-to-clipboard', () => ({default: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: vi.fn(),},diff --git a/web/app/components/workflow/panel/chat-variable-panel/components/__tests__/object-value-item.spec.tsx b/web/app/components/workflow/panel/chat-variable-panel/components/__tests__/object-value-item.spec.tsxindex b9970fb8b3e..8ddac1da9fb 100644--- a/web/app/components/workflow/panel/chat-variable-panel/components/__tests__/object-value-item.spec.tsx+++ b/web/app/components/workflow/panel/chat-variable-panel/components/__tests__/object-value-item.spec.tsx@@ -4,7 +4,7 @@ import ObjectValueItem, { DEFAULT_OBJECT_VALUE } from '../object-value-item'const toastError = vi.fn()-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: (...args: unknown[]) => toastError(...args),},diff --git a/web/app/components/workflow/panel/chat-variable-panel/components/__tests__/variable-modal.spec.tsx b/web/app/components/workflow/panel/chat-variable-panel/components/__tests__/variable-modal.spec.tsxindex 6c4c86c0300..7e9d78d2595 100644--- a/web/app/components/workflow/panel/chat-variable-panel/components/__tests__/variable-modal.spec.tsx+++ b/web/app/components/workflow/panel/chat-variable-panel/components/__tests__/variable-modal.spec.tsx@@ -1,8 +1,8 @@-import { toast } from '@langgenius/dify-ui/toast'import { fireEvent, screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'import * as React from 'react'import { renderWorkflowComponent } from '@/app/components/workflow/__tests__/workflow-test-env'+import { toast } from '@/app/notifications'import { ChatVarType } from '../../type'import VariableModal from '../variable-modal'@@ -10,7 +10,7 @@ vi.mock('uuid', () => ({v4: () => 'generated-id',}))-vi.mock('@langgenius/dify-ui/toast', async (importOriginal) => ({+vi.mock('@/app/notifications', async (importOriginal) => ({...(await importOriginal()),toast: {error: vi.fn(),diff --git a/web/app/components/workflow/panel/chat-variable-panel/components/object-value-item.tsx b/web/app/components/workflow/panel/chat-variable-panel/components/object-value-item.tsxindex 852aafe1c7e..ea6478c3b1a 100644--- a/web/app/components/workflow/panel/chat-variable-panel/components/object-value-item.tsx+++ b/web/app/components/workflow/panel/chat-variable-panel/components/object-value-item.tsx@@ -1,13 +1,13 @@'use client'import type { FC } from 'react'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { produce } from 'immer'import * as React from 'react'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'import VariableTypeSelector from '@/app/components/workflow/panel/chat-variable-panel/components/variable-type-select'import { ChatVarType } from '@/app/components/workflow/panel/chat-variable-panel/type'+import { toast } from '@/app/notifications'type Props = Readonly<{index: numberdiff --git a/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.tsx b/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.tsxindex 1f2c52fe097..f858105a892 100644--- a/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.tsx+++ b/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.tsx@@ -2,12 +2,12 @@ import type { ChatVariableTranslator, ToastPayload } from './variable-modal.helpimport type { ConversationVariable } from '@/app/components/workflow/types'import { Button } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { RiCloseLine } from '@remixicon/react'import * as React from 'react'import { useTranslation } from 'react-i18next'import { ChatVarType } from '@/app/components/workflow/panel/chat-variable-panel/type'import { useWorkflowStore } from '@/app/components/workflow/store'+import { toast } from '@/app/notifications'import { replaceSpaceWithUnderscoreInVarNameInput } from '@/utils/var'import { useVariableModalState } from './use-variable-modal-state'import {diff --git a/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks.spec.ts b/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks.spec.tsindex 870188d243d..dad3dd59f05 100644--- a/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks.spec.ts+++ b/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks.spec.ts@@ -28,7 +28,7 @@ vi.mock('@/service/workflow', () => ({submitHumanInputForm: (...args: unknown[]) => mockSubmitHumanInputForm(...args),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: vi.fn(),error: vi.fn(),diff --git a/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/handle-resume.spec.ts b/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/handle-resume.spec.tsindex 9d66f659e99..c6bb9811ad3 100644--- a/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/handle-resume.spec.ts+++ b/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/handle-resume.spec.ts@@ -26,7 +26,7 @@ vi.mock('@/service/workflow', () => ({submitHumanInputForm: (...args: any[]) => mockSubmitHumanInputForm(...args),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: vi.fn(),error: vi.fn(),diff --git a/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/handle-send.spec.ts b/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/handle-send.spec.tsindex 9ad1186ac48..1fed2813aa6 100644--- a/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/handle-send.spec.ts+++ b/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/handle-send.spec.ts@@ -28,7 +28,7 @@ vi.mock('@/service/workflow', () => ({submitHumanInputForm: (...args: any[]) => mockSubmitHumanInputForm(...args),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: vi.fn(),error: vi.fn(),diff --git a/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/handle-stop-restart.spec.ts b/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/handle-stop-restart.spec.tsindex 963032b24b8..8984593e15a 100644--- a/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/handle-stop-restart.spec.ts+++ b/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/handle-stop-restart.spec.ts@@ -26,7 +26,7 @@ vi.mock('@/service/workflow', () => ({submitHumanInputForm: (...args: any[]) => mockSubmitHumanInputForm(...args),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: vi.fn(),error: vi.fn(),diff --git a/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/misc.spec.ts b/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/misc.spec.tsindex 16a6e1a6516..b35764f3b43 100644--- a/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/misc.spec.ts+++ b/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/misc.spec.ts@@ -26,7 +26,7 @@ vi.mock('@/service/workflow', () => ({submitHumanInputForm: (...args: any[]) => mockSubmitHumanInputForm(...args),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: vi.fn(),error: vi.fn(),diff --git a/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/opening-statement.spec.ts b/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/opening-statement.spec.tsindex 42081331e7b..84289e0b540 100644--- a/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/opening-statement.spec.ts+++ b/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/opening-statement.spec.ts@@ -26,7 +26,7 @@ vi.mock('@/service/workflow', () => ({submitHumanInputForm: (...args: any[]) => mockSubmitHumanInputForm(...args),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: vi.fn(),error: vi.fn(),diff --git a/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/sse-callbacks.spec.ts b/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/sse-callbacks.spec.tsindex 34321513036..470915484cc 100644--- a/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/sse-callbacks.spec.ts+++ b/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/sse-callbacks.spec.ts@@ -25,7 +25,7 @@ vi.mock('@/service/workflow', () => ({submitHumanInputForm: (...args: any[]) => mockSubmitHumanInputForm(...args),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: vi.fn(),error: vi.fn(),diff --git a/web/app/components/workflow/panel/debug-and-preview/hooks.ts b/web/app/components/workflow/panel/debug-and-preview/hooks.tsindex da38afa91d0..ee6b1ccdc84 100644--- a/web/app/components/workflow/panel/debug-and-preview/hooks.ts+++ b/web/app/components/workflow/panel/debug-and-preview/hooks.ts@@ -4,7 +4,6 @@ import type { ChatItem, ChatItemInTree, Inputs } from '@/app/components/base/chaimport type { FileEntity } from '@/app/components/base/file-uploader/types'import type { IOtherOptions } from '@/service/base'import type { ReasoningChunkResponse } from '@/types/workflow'-import { toast } from '@langgenius/dify-ui/toast'import { uniqBy } from 'es-toolkit/compat'import { produce, setAutoFreeze } from 'immer'import { useCallback, useEffect, useMemo, useRef, useState } from 'react'@@ -18,6 +17,7 @@ import {getProcessedFilesFromResponse,} from '@/app/components/base/file-uploader/utils'import { CUSTOM_NODE } from '@/app/components/workflow/constants'+import { toast } from '@/app/notifications'import { sseGet } from '@/service/base'import { useInvalidAllLastRun } from '@/service/use-workflow'import { submitHumanInputForm } from '@/service/workflow'diff --git a/web/app/components/workflow/panel/env-panel/__tests__/variable-modal.spec.tsx b/web/app/components/workflow/panel/env-panel/__tests__/variable-modal.spec.tsxindex 7761de6c0e2..fbe216175da 100644--- a/web/app/components/workflow/panel/env-panel/__tests__/variable-modal.spec.tsx+++ b/web/app/components/workflow/panel/env-panel/__tests__/variable-modal.spec.tsx@@ -5,7 +5,6 @@ import type {import type { ReactElement } from 'react'import type { Shape } from '@/app/components/workflow/store/workflow'import type { EnvironmentVariable } from '@/app/components/workflow/types'-import { toast } from '@langgenius/dify-ui/toast'import { act, fireEvent, render, screen } from '@testing-library/react'import userEvent from '@testing-library/user-event'import {@@ -15,6 +14,7 @@ import {} from '@/app/components/header/account-setting/model-provider-page/declarations'import { WorkflowContext } from '@/app/components/workflow/context'import { createWorkflowStore } from '@/app/components/workflow/store/workflow'+import { toast } from '@/app/notifications'import VariableModal from '../variable-modal'type MockModelParameterModalProps = {@@ -78,7 +78,7 @@ vi.mock(}),)-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: vi.fn(),error: vi.fn(),diff --git a/web/app/components/workflow/panel/env-panel/index.tsx b/web/app/components/workflow/panel/env-panel/index.tsxindex 11ea558c0a0..f5dc59e6d3e 100644--- a/web/app/components/workflow/panel/env-panel/index.tsx+++ b/web/app/components/workflow/panel/env-panel/index.tsx@@ -5,7 +5,6 @@ import type {LLMEnvironmentVariableValue,} from '@/app/components/workflow/types'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { RiCloseLine } from '@remixicon/react'import { cloneDeep } from 'es-toolkit/object'import { isEqual } from 'es-toolkit/predicate'@@ -24,6 +23,7 @@ import EnvItem from '@/app/components/workflow/panel/env-panel/env-item'import VariableTrigger from '@/app/components/workflow/panel/env-panel/variable-trigger'import { useStore, useWorkflowStore } from '@/app/components/workflow/store'import { BlockEnum } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { Resolution } from '@/types/app'import {fetchModelParameterRulesForModel,diff --git a/web/app/components/workflow/panel/env-panel/variable-modal.tsx b/web/app/components/workflow/panel/env-panel/variable-modal.tsxindex ca843b1868e..c2619894737 100644--- a/web/app/components/workflow/panel/env-panel/variable-modal.tsx+++ b/web/app/components/workflow/panel/env-panel/variable-modal.tsx@@ -6,7 +6,6 @@ import { IconButton } from '@langgenius/dify-ui/icon-button'import { Input } from '@langgenius/dify-ui/input'import { NumberField, NumberFieldGroup, NumberFieldInput } from '@langgenius/dify-ui/number-field'import { Textarea } from '@langgenius/dify-ui/textarea'-import { toast } from '@langgenius/dify-ui/toast'import * as React from 'react'import { useEffect } from 'react'import { useTranslation } from 'react-i18next'@@ -15,6 +14,7 @@ import { Infotip } from '@/app/components/base/infotip'import { isLLMEnvironmentVariableValue } from '@/app/components/workflow/llm-environment-variable'import { LLMEnvironmentVariableValueField } from '@/app/components/workflow/llm-environment-variable-value-field'import { useWorkflowStore } from '@/app/components/workflow/store'+import { toast } from '@/app/notifications'import { checkKeys, replaceSpaceWithUnderscoreInVarNameInput } from '@/utils/var'type ModalPropsType = {diff --git a/web/app/components/workflow/panel/version-history-panel/__tests__/index.spec.tsx b/web/app/components/workflow/panel/version-history-panel/__tests__/index.spec.tsxindex 15c525e4b39..73d1f9d611d 100644--- a/web/app/components/workflow/panel/version-history-panel/__tests__/index.spec.tsx+++ b/web/app/components/workflow/panel/version-history-panel/__tests__/index.spec.tsx@@ -81,7 +81,7 @@ type MockVersionHistoryItemProps = {handleClickActionMenuItem: (operation: VersionHistoryContextMenuOptions) => void}-vi.mock('@langgenius/dify-ui/toast', () => ({ toast: mockToast }))+vi.mock('@/app/notifications', () => ({ toast: mockToast }))vi.mock('@/service/use-workflow', () => ({useDeleteWorkflow: () => ({ mutateAsync: vi.fn() }),diff --git a/web/app/components/workflow/panel/version-history-panel/index.tsx b/web/app/components/workflow/panel/version-history-panel/index.tsxindex 2f484776560..a18a2c74035 100644--- a/web/app/components/workflow/panel/version-history-panel/index.tsx+++ b/web/app/components/workflow/panel/version-history-panel/index.tsx@@ -2,7 +2,6 @@import type { AppModeEnum } from '@/types/app'import type { VersionHistory } from '@/types/workflow'-import { toast } from '@langgenius/dify-ui/toast'import { useQuery, useSuspenseQuery } from '@tanstack/react-query'import copy from 'copy-to-clipboard'import { useAtomValue } from 'jotai'@@ -13,6 +12,7 @@ import VersionInfoModal from '@/app/components/app/app-publisher/version-info-moimport Divider from '@/app/components/base/divider'import { PlanUpgradeModal } from '@/app/components/billing/plan-upgrade-modal'import { getWorkflowVersionName } from '@/app/components/workflow/utils/version'+import { toast } from '@/app/notifications'import { userProfileQueryOptions } from '@/features/account-profile/client'import { deploymentEditionAtom } from '@/features/system-features/state'import { consoleQuery } from '@/service/console'diff --git a/web/app/components/workflow/panel/workflow-preview.tsx b/web/app/components/workflow/panel/workflow-preview.tsxindex 6de42cc9282..538a9ec51f5 100644--- a/web/app/components/workflow/panel/workflow-preview.tsx+++ b/web/app/components/workflow/panel/workflow-preview.tsx@@ -1,7 +1,6 @@import type { HumanInputFormSubmitData } from '@/app/components/base/chat/chat/answer/human-input-content/type'import { Button } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import copy from 'copy-to-clipboard'import { memo, useCallback, useEffect, useId, useState } from 'react'import { useTranslation } from 'react-i18next'@@ -9,6 +8,7 @@ import { useStore as useReactFlowStore } from 'reactflow'import ReasoningPanel from '@/app/components/base/chat/chat/answer/reasoning-panel'import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder'import ResizeHandle from '@/app/components/base/resize-handle'+import { toast } from '@/app/notifications'import { submitHumanInputForm } from '@/service/workflow'import { useWorkflowInteractions } from '../hooks/use-workflow-panel-interactions'import ResultPanel from '../run/result-panel'diff --git a/web/app/components/workflow/run/__tests__/index.spec.tsx b/web/app/components/workflow/run/__tests__/index.spec.tsxindex 4b606a97d03..a54fb4d4b85 100644--- a/web/app/components/workflow/run/__tests__/index.spec.tsx+++ b/web/app/components/workflow/run/__tests__/index.spec.tsx@@ -22,7 +22,7 @@ vi.mock('@/service/log', () => ({fetchTracingList: (...args: unknown[]) => mockFetchTracingList(...args),}))-vi.mock('@langgenius/dify-ui/toast', async (importOriginal) => ({+vi.mock('@/app/notifications', async (importOriginal) => ({...(await importOriginal()),toast: {error: (...args: unknown[]) => mockToastError(...args),diff --git a/web/app/components/workflow/run/index.tsx b/web/app/components/workflow/run/index.tsxindex 9e77b1d6b3b..c2593ee6af7 100644--- a/web/app/components/workflow/run/index.tsx+++ b/web/app/components/workflow/run/index.tsx@@ -3,11 +3,11 @@ import type { FC } from 'react'import type { WorkflowRunDetailResponse } from '@/models/log'import type { NodeTracing } from '@/types/workflow'import { Tabs, TabsList, TabsPanel, TabsTab } from '@langgenius/dify-ui/tabs'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback, useEffect, useMemo, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder'import { WorkflowRunningStatus } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { fetchRunDetail, fetchTracingList } from '@/service/log'import { useStore } from '../store'import OutputPanel from './output-panel'diff --git a/web/app/components/workflow/update-dsl-modal.tsx b/web/app/components/workflow/update-dsl-modal.tsxindex fa5f9992520..31901e4d222 100644--- a/web/app/components/workflow/update-dsl-modal.tsx+++ b/web/app/components/workflow/update-dsl-modal.tsx@@ -4,7 +4,6 @@ import type { MouseEventHandler } from 'react'import type { DSLImportWarning } from '@/models/app'import { Button } from '@langgenius/dify-ui/button'import { Dialog, DialogContent } from '@langgenius/dify-ui/dialog'-import { toast } from '@langgenius/dify-ui/toast'import { RiAlertFill, RiCloseLine, RiFileDownloadLine } from '@remixicon/react'import { memo, useCallback, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'@@ -12,6 +11,7 @@ import DSLImportWarningDescription from '@/app/components/app/create-from-dsl-moimport { Uploader } from '@/app/components/app/create-from-dsl-modal/uploader'import { useStore as useAppStore } from '@/app/components/app/store'import { usePluginDependencies } from '@/app/components/workflow/plugin-dependency/hooks'+import { toast } from '@/app/notifications'import { useEventEmitterContextContext } from '@/context/event-emitter'import { DSLImportMode, DSLImportStatus } from '@/models/app'import { importDSL, importDSLConfirm } from '@/service/apps'diff --git a/web/app/components/workflow/variable-inspect/__tests__/value-content-sections.spec.tsx b/web/app/components/workflow/variable-inspect/__tests__/value-content-sections.spec.tsxindex 88f9db80ae8..6f4011ca420 100644--- a/web/app/components/workflow/variable-inspect/__tests__/value-content-sections.spec.tsx+++ b/web/app/components/workflow/variable-inspect/__tests__/value-content-sections.spec.tsx@@ -18,7 +18,7 @@ const toastMocks = vi.hoisted(() => ({promise: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: Object.assign(toastMocks.call, {success: vi.fn(),error: vi.fn(),diff --git a/web/app/components/workflow/workflow-generator/index.tsx b/web/app/components/workflow/workflow-generator/index.tsxindex 2055a0bd9d5..70a7ed20df0 100644--- a/web/app/components/workflow/workflow-generator/index.tsx+++ b/web/app/components/workflow/workflow-generator/index.tsx@@ -23,7 +23,6 @@ import { Button, buttonVariants } from '@langgenius/dify-ui/button'import { Dialog, DialogContent, DialogDescription, DialogTitle } from '@langgenius/dify-ui/dialog'import { Field, FieldLabel } from '@langgenius/dify-ui/field'import { Textarea } from '@langgenius/dify-ui/textarea'-import { toast } from '@langgenius/dify-ui/toast'import { matchesKeyboardEvent } from '@tanstack/react-hotkeys'import { useSuspenseQuery } from '@tanstack/react-query'import { useBoolean } from 'ahooks'@@ -34,6 +33,7 @@ import { ModelTypeEnum } from '@/app/components/header/account-setting/model-proimport { useModelListAndDefaultModelAndCurrentProviderAndModel } from '@/app/components/header/account-setting/model-provider-page/hooks'import ModelParameterModal from '@/app/components/header/account-setting/model-provider-page/model-parameter-modal'import WorkflowPreview from '@/app/components/workflow/workflow-preview'+import { toast } from '@/app/notifications'import { WORKFLOW_GENERATION_TIMEOUT_MS } from '@/config'import { systemFeaturesQueryOptions } from '@/features/system-features/client'import Link from '@/next/link'diff --git a/web/app/education/apply/__tests__/page.spec.tsx b/web/app/education/apply/__tests__/page.spec.tsxindex 123afe6c3d2..54d109126b7 100644--- a/web/app/education/apply/__tests__/page.spec.tsx+++ b/web/app/education/apply/__tests__/page.spec.tsx@@ -1,8 +1,8 @@import type { GetAccountProfileResponse } from '@dify/contracts/api/console/account/types.gen'-import { toast } from '@langgenius/dify-ui/toast'import { cleanup, screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'import EducationApplyPage from '@/app/education/apply/application-form'+import { toast } from '@/app/notifications'import { createConsoleQueryWrapper } from '@/test/console/query-data'import { render } from '@/test/console/render'diff --git a/web/app/education/apply/application-form.tsx b/web/app/education/apply/application-form.tsxindex f6ff4e07daa..365daaf7afd 100644--- a/web/app/education/apply/application-form.tsx+++ b/web/app/education/apply/application-form.tsx@@ -10,12 +10,12 @@ import { CheckboxGroup } from '@langgenius/dify-ui/checkbox-group'import { Field, FieldDescription, FieldItem, FieldLabel } from '@langgenius/dify-ui/field'import { Fieldset, FieldsetLegend } from '@langgenius/dify-ui/fieldset'import { Form } from '@langgenius/dify-ui/form'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'import { useAtomValue } from 'jotai'import { useState } from 'react'import { Trans, useTranslation } from 'react-i18next'import { useEducationDiscount } from '@/app/components/billing/hooks/use-education-discount'+import { toast } from '@/app/notifications'import { useDocLink } from '@/context/i18n'import { currentWorkspaceAtom, isCurrentWorkspaceManagerAtom } from '@/context/workspace-state'import { useAsyncWindowOpen } from '@/hooks/use-async-window-open'diff --git a/web/app/init/InitPasswordPopup.tsx b/web/app/init/InitPasswordPopup.tsxindex a7a24a6af7d..53659e9f882 100644--- a/web/app/init/InitPasswordPopup.tsx+++ b/web/app/init/InitPasswordPopup.tsx@@ -1,10 +1,10 @@'use client'import type { InitValidateStatusResponse } from '@/models/common'import { Button } from '@langgenius/dify-ui/button'-import { toast } from '@langgenius/dify-ui/toast'import { useEffect, useState } from 'react'import { useTranslation } from 'react-i18next'import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder'+import { toast } from '@/app/notifications'import useDocumentTitle from '@/hooks/use-document-title'import { useRouter } from '@/next/navigation'import { fetchInitValidateStatus, initValidate } from '@/service/common'diff --git a/web/app/layout.tsx b/web/app/layout.tsxindex 935875cc1e2..dcb55ff789b 100644--- a/web/app/layout.tsx+++ b/web/app/layout.tsx@@ -1,11 +1,11 @@import type { ThemeProviderProps } from 'next-themes'import type { Metadata, Viewport } from '@/next'-import { ToastHost } from '@langgenius/dify-ui/toast'import { TooltipProvider } from '@langgenius/dify-ui/tooltip'import { HydrationBoundary } from '@tanstack/react-query'import { Provider as JotaiProvider } from 'jotai/react'import { ThemeProvider } from 'next-themes'import { NuqsAdapter } from 'nuqs/adapters/next/app'+import { AppToastHost } from '@/app/notifications/host'import { IS_PROD } from '@/config'import { getDatasetMap } from '@/env'import { SystemFeaturesBootstrapBoundary } from '@/features/system-features/bootstrap-boundary'@@ -81,7 +81,7 @@ export default async function RootLayout({ children }: { children: React.ReactNo<TanStackQueryProvider><HydrationBoundary state={dehydratedState}><I18nServerProvider>- <ToastHost timeout={5000} limit={3} />+ <AppToastHost timeout={5000} limit={3} /><SystemFeaturesBootstrapBoundary><PartnerStackCookieRecorder /><TooltipProvider delay={300} closeDelay={200}>diff --git a/web/app/notifications/__tests__/copy.browser.spec.tsx b/web/app/notifications/__tests__/copy.browser.spec.tsxnew file mode 100644index 00000000000..8a23bfc892d--- /dev/null+++ b/web/app/notifications/__tests__/copy.browser.spec.tsx@@ -0,0 +1,204 @@+import { createToast, createToastManager } from '@langgenius/dify-ui/toast'+import { page, userEvent } from 'vite-plus/test/browser'+import { render } from 'vitest-browser-react'+import { AppToastHost } from '../host'++// Use the real clipboard adapter and browser focus order: the copy action must remain+// keyboard-operable, including when the adapter falls back to selection-based copying.+it('copies through the keyboard action and retains focus after feedback', async () => {+ const description = Array.from(+ { length: 20 },+ (_, index) => `Storage request ${index}: connection refused at storage.internal:19000`,+ ).join('\n')+ const writeText = vi.spyOn(navigator.clipboard, 'writeText').mockResolvedValue(undefined)+ const manager = createToastManager()+ const toast = createToast(manager)+ try {+ const screen = await render(<AppToastHost manager={manager} timeout={0} />)+ toast.error('Upload failed', { description })+ await expect.element(screen.getByText('Upload failed')).toBeInTheDocument()+ await userEvent.keyboard('{F6}{Tab}{Tab}')+ const action = screen.getByRole('button', { name: 'common.operation.copyErrorDetails' })+ await expect.element(action).toHaveFocus()+ await userEvent.keyboard('{Enter}')+ await expect+ .element(screen.getByRole('button', { name: 'common.operation.copied' }))+ .toHaveFocus()+ expect(writeText).toHaveBeenCalledExactlyOnceWith(`Upload failed\n${description}`)+ } finally {+ toast.dismiss()+ writeText.mockRestore()+ }+})++it('retains action focus when clipboard copying falls back to execCommand', async () => {+ const writeText = vi+ .spyOn(navigator.clipboard, 'writeText')+ .mockRejectedValue(new Error('Denied'))+ const execCommand = vi.spyOn(document, 'execCommand').mockReturnValue(true)+ const manager = createToastManager()+ const toast = createToast(manager)+ try {+ const screen = await render(<AppToastHost manager={manager} timeout={0} />)+ toast.error('Connection failed')+ await expect.element(screen.getByText('Connection failed')).toBeInTheDocument()+ await userEvent.keyboard('{F6}{Tab}{Tab}{Enter}')+ await expect+ .element(screen.getByRole('button', { name: 'common.operation.copied' }))+ .toHaveFocus()+ expect(execCommand).toHaveBeenCalledExactlyOnceWith('copy')+ } finally {+ toast.dismiss()+ writeText.mockRestore()+ execCommand.mockRestore()+ }+})++it('keeps an accessible focused action when copying fails and is retried with Space', async () => {+ const writeText = vi+ .spyOn(navigator.clipboard, 'writeText')+ .mockRejectedValueOnce(new Error('Denied'))+ .mockResolvedValue(undefined)+ const execCommand = vi.spyOn(document, 'execCommand').mockReturnValue(false)+ const manager = createToastManager()+ const toast = createToast(manager)+ try {+ const screen = await render(<AppToastHost manager={manager} timeout={0} />)+ toast.error('Connection failed')+ await expect.element(screen.getByText('Connection failed')).toBeInTheDocument()+ await userEvent.keyboard('{F6}{Tab}{Tab}{Enter}')+ await expect+ .element(screen.getByRole('button', { name: 'common.operation.copyErrorFailed' }))+ .toHaveFocus()+ await userEvent.keyboard(' ')+ await expect+ .element(screen.getByRole('button', { name: 'common.operation.copied' }))+ .toHaveFocus()+ expect(writeText).toHaveBeenCalledTimes(2)+ expect(writeText).toHaveBeenLastCalledWith('Connection failed')+ } finally {+ toast.dismiss()+ writeText.mockRestore()+ execCommand.mockRestore()+ }+})++// Updating the card must not remount the focused copy button.+it('retains focus and copies current content after an error update', async () => {+ const writeText = vi.spyOn(navigator.clipboard, 'writeText').mockResolvedValue(undefined)+ const manager = createToastManager()+ const toast = createToast(manager)+ try {+ const screen = await render(<AppToastHost manager={manager} timeout={0} />)+ const id = toast.error('First error')+ await expect.element(screen.getByText('First error')).toBeInTheDocument()+ await userEvent.keyboard('{F6}{Tab}{Tab}{Enter}')+ await expect+ .element(screen.getByRole('button', { name: 'common.operation.copied' }))+ .toHaveFocus()+ toast.update(id, { title: 'Updated error' })+ await expect.element(screen.getByText('Updated error')).toBeInTheDocument()+ await expect+ .element(screen.getByRole('button', { name: 'common.operation.copyErrorDetails' }))+ .toHaveFocus()+ await userEvent.keyboard('{Enter}')+ await expect+ .element(screen.getByRole('button', { name: 'common.operation.copied' }))+ .toHaveFocus()+ expect(writeText).toHaveBeenLastCalledWith('Updated error')+ } finally {+ toast.dismiss()+ writeText.mockRestore()+ }+})++// Real CSS and pointer hit testing prove the hidden floating action can be discovered+// and clicked without overflowing the card or starting swipe-to-dismiss.+it.each([1280, 360])(+ 'reveals a contained copy action on hover at %ipx and keeps the card open after copying',+ async (width) => {+ await page.viewport(width, 800)+ const writeText = vi.spyOn(navigator.clipboard, 'writeText').mockResolvedValue(undefined)+ const manager = createToastManager()+ const toast = createToast(manager)+ try {+ const screen = await render(+ <>+ <button type="button" style={{ position: 'fixed', bottom: 16, left: 16 }}>+ Outside notifications+ </button>+ <AppToastHost manager={manager} timeout={0} />+ </>,+ )+ const outside = screen.getByRole('button', { name: 'Outside notifications' })+ await userEvent.hover(outside)+ toast.error('Upload failed', {+ description: 'Storage connection refused. Please retry the request.',+ })+ const card = screen.getByRole('dialog', { name: 'Upload failed' })+ const copy = screen.getByRole('button', { name: 'common.operation.copyErrorDetails' })+ await expect.element(copy).toHaveStyle({ opacity: '0' })+ await userEvent.hover(card)+ await expect.element(copy).toHaveStyle({ opacity: '1' })+ const cardBounds = card.element().getBoundingClientRect()+ const buttonBounds = copy.element().getBoundingClientRect()+ expect(buttonBounds.left).toBeGreaterThanOrEqual(cardBounds.left)+ expect(buttonBounds.right).toBeLessThanOrEqual(cardBounds.right)+ expect(buttonBounds.top).toBeGreaterThanOrEqual(cardBounds.top)+ expect(buttonBounds.bottom).toBeLessThanOrEqual(cardBounds.bottom)+ await userEvent.click(copy)+ await expect+ .element(screen.getByRole('button', { name: 'common.operation.copied' }))+ .toHaveStyle({ opacity: '1' })+ expect(writeText).toHaveBeenCalledExactlyOnceWith(+ 'Upload failed\nStorage connection refused. Please retry the request.',+ )+ await expect.element(card).toBeInTheDocument()+ await userEvent.hover(outside)+ await expect+ .element(screen.getByRole('button', { name: 'common.operation.copied' }))+ .toHaveStyle({ opacity: '0' })+ await userEvent.hover(card)+ await userEvent.click(screen.getByRole('button', { name: 'Close notification' }))+ await expect.element(card).not.toBeInTheDocument()+ } finally {+ toast.dismiss()+ writeText.mockRestore()+ await page.viewport(1280, 720)+ }+ },+)++it('reveals the action for keyboard focus, supports reverse tabbing, and restores focus on Escape', async () => {+ const manager = createToastManager()+ const toast = createToast(manager)+ try {+ const screen = await render(+ <>+ <button type="button">Return target</button>+ <AppToastHost manager={manager} timeout={0} />+ </>,+ )+ const target = screen.getByRole('button', { name: 'Return target' })+ await userEvent.click(target)+ toast.error('Keyboard error')+ const card = screen.getByRole('dialog', { name: 'Keyboard error' })+ const copy = screen.getByRole('button', { name: 'common.operation.copyErrorDetails' })+ await expect.element(copy).toHaveStyle({ opacity: '0' })+ await userEvent.keyboard('{F6}{Tab}')+ await expect.element(card).toHaveFocus()+ await expect.element(copy).toHaveStyle({ opacity: '1' })+ await userEvent.keyboard('{Tab}')+ await expect.element(copy).toHaveFocus()+ await expect.element(copy).toHaveStyle({ opacity: '1' })+ await userEvent.keyboard('{Tab}')+ await expect.element(screen.getByRole('button', { name: 'Close notification' })).toHaveFocus()+ await userEvent.keyboard('{Shift>}{Tab}{/Shift}')+ await expect.element(copy).toHaveFocus()+ await userEvent.keyboard('{Escape}')+ await expect.element(card).not.toBeInTheDocument()+ await expect.element(target).toHaveFocus()+ } finally {+ toast.dismiss()+ }+})diff --git a/web/app/notifications/__tests__/toast.spec.tsx b/web/app/notifications/__tests__/toast.spec.tsxnew file mode 100644index 00000000000..97bfe785c92--- /dev/null+++ b/web/app/notifications/__tests__/toast.spec.tsx@@ -0,0 +1,204 @@+import { createToast, createToastManager } from '@langgenius/dify-ui/toast'+import { act, render, screen, waitFor, within } from '@testing-library/react'+import userEvent from '@testing-library/user-event'+import { AppToastHost } from '../host'++const copy = vi.fn()++function setup() {+ const manager = createToastManager()+ const toast = createToast(manager)+ render(<AppToastHost manager={manager} timeout={0} />)+ const user = userEvent.setup()+ Object.defineProperty(navigator, 'clipboard', { configurable: true, value: { writeText: copy } })+ return { toast, user }+}++beforeEach(() => {+ vi.clearAllMocks()+ Object.defineProperty(document, 'execCommand', { configurable: true, value: vi.fn(() => false) })+ vi.mocked(copy).mockResolvedValue(undefined)+})++it('copies the complete error text and shows feedback in the existing action', async () => {+ const { toast, user } = setup()+ act(() => {+ toast.error('Upload failed', { description: 'Storage unavailable' })+ })+ await user.click(await screen.findByRole('button', { name: 'common.operation.copyErrorDetails' }))+ expect(copy).toHaveBeenCalledExactlyOnceWith('Upload failed\nStorage unavailable')+ expect(await screen.findByRole('button', { name: 'common.operation.copied' })).toBeInTheDocument()+ expect(screen.getAllByRole('dialog')).toHaveLength(1)+})++it('preserves caller actions and does not extract rich content', async () => {+ const { toast, user } = setup()+ const retry = vi.fn()+ act(() => {+ toast.error('Retryable', { actionProps: { children: 'Retry', onClick: retry } })+ toast.error(<strong>Rich error</strong>)+ })+ await user.click(screen.getByRole('button', { name: 'Retry' }))+ expect(retry).toHaveBeenCalledOnce()+ await user.click(screen.getByRole('button', { name: 'common.operation.copyErrorDetails' }))+ expect(copy).toHaveBeenCalledWith('Retryable')+ expect(+ within(screen.getByRole('dialog', { name: 'Rich error' })).queryByRole('button', {+ name: 'common.operation.copyErrorDetails',+ }),+ ).not.toBeInTheDocument()+})++it('updates copy content and removes generated actions when the tone changes', async () => {+ const { toast, user } = setup()+ let id = ''+ act(() => {+ id = toast('First error', { type: 'error' })+ })+ act(() => {+ toast.update(id, { title: 'Updated error' })+ })+ await user.click(screen.getByRole('button', { name: 'common.operation.copyErrorDetails' }))+ expect(copy).toHaveBeenCalledWith('Updated error')+ act(() => {+ toast.update(id, { type: 'success', title: 'Recovered' })+ })+ expect(screen.queryByRole('button', { name: 'common.operation.copied' })).not.toBeInTheDocument()+})++it('does not let an old clipboard result change an upserted error', async () => {+ let finish!: () => void+ vi.mocked(copy).mockReturnValueOnce(+ new Promise<void>((resolve) => {+ finish = resolve+ }),+ )+ const { toast, user } = setup()+ act(() => {+ toast.error('Old error', { id: 'request' })+ })+ await user.click(screen.getByRole('button', { name: 'common.operation.copyErrorDetails' }))+ act(() => {+ toast.error('New error', { id: 'request' })+ })+ await act(async () => {+ finish()+ })+ expect(screen.queryByRole('button', { name: 'common.operation.copied' })).not.toBeInTheDocument()+ await user.click(screen.getByRole('button', { name: 'common.operation.copyErrorDetails' }))+ expect(copy).toHaveBeenLastCalledWith('New error')+})++it('allows retrying a rejected clipboard operation without another toast', async () => {+ vi.mocked(copy).mockRejectedValueOnce(new Error('Denied'))+ const { toast, user } = setup()+ act(() => {+ toast.error('Network error')+ })+ await user.click(screen.getByRole('button', { name: 'common.operation.copyErrorDetails' }))+ await user.click(await screen.findByRole('button', { name: 'common.operation.copyErrorFailed' }))+ expect(await screen.findByRole('button', { name: 'common.operation.copied' })).toBeInTheDocument()+ expect(screen.getAllByRole('dialog')).toHaveLength(1)+})++it('decorates a rejected promise and preserves the original rejection', async () => {+ const { toast, user } = setup()+ const error = new Error('Export failed')+ await act(async () => {+ await expect(+ toast.promise(Promise.reject(error), {+ loading: 'Exporting',+ success: 'Exported',+ error: (reason) => ({ title: (reason as Error).message, description: 'Try again later' }),+ }),+ ).rejects.toBe(error)+ })+ await user.click(screen.getByRole('button', { name: 'common.operation.copyErrorDetails' }))+ expect(copy).toHaveBeenCalledWith('Export failed\nTry again later')+})++it('keeps scoped managers isolated from each other', async () => {+ const first = createToastManager()+ const second = createToastManager()+ const firstToast = createToast(first)+ const secondToast = createToast(second)+ render(+ <>+ <AppToastHost manager={first} timeout={0} />+ <AppToastHost manager={second} timeout={0} />+ </>,+ )+ act(() => {+ firstToast.error('First')+ secondToast.error('Second')+ })+ const regions = screen.getAllByRole('region', { name: 'Notifications' })+ expect(within(regions[0]!).getByRole('dialog', { name: 'First' })).toBeInTheDocument()+ expect(within(regions[0]!).queryByText('Second')).not.toBeInTheDocument()+ act(() => {+ firstToast.dismiss()+ })+ await waitFor(() =>+ expect(screen.queryByRole('dialog', { name: 'First' })).not.toBeInTheDocument(),+ )+ expect(screen.getByRole('dialog', { name: 'Second' })).toBeInTheDocument()+})++it('copies the retained description after a same-id title-only upsert', async () => {+ const { toast, user } = setup()+ act(() => {+ toast.error('First', { id: 'request', description: 'Diagnostic details' })+ })+ act(() => {+ toast.error('Second', { id: 'request' })+ })+ await user.click(screen.getByRole('button', { name: 'common.operation.copyErrorDetails' }))+ expect(copy).toHaveBeenCalledWith('Second\nDiagnostic details')+})++it('retains a caller action across upserts and promise failure', async () => {+ const { toast, user } = setup()+ const retry = vi.fn()+ const actionProps = { children: 'Retry', onClick: retry }+ act(() => {+ toast.error('First', { id: 'request', actionProps })+ })+ act(() => {+ toast.error('Second', { id: 'request' })+ })+ await user.click(screen.getByRole('button', { name: 'Retry' }))+ expect(retry).toHaveBeenCalledOnce()+ await act(async () => {+ await toast+ .promise(Promise.reject(new Error('Failed')), {+ loading: { title: 'Loading', actionProps: { children: 'Details', onClick: retry } },+ success: 'Done',+ error: 'Failed',+ })+ .catch(() => {})+ })+ const failedToast = screen.getByRole('dialog', { name: 'Loading' })+ await user.click(+ within(failedToast).getByRole('button', { name: 'common.operation.copyErrorDetails' }),+ )+ expect(copy).toHaveBeenCalledWith('Loading\nFailed')+ await user.click(screen.getByRole('button', { name: 'Details' }))+ expect(retry).toHaveBeenCalledTimes(2)+})++it('copies the resolved string description without retaining loading text', async () => {+ const { toast, user } = setup()+ await act(async () => {+ await toast+ .promise(Promise.reject(new Error('Failed')), {+ loading: 'Loading',+ success: 'Done',+ error: () => 'Failed',+ })+ .catch(() => {})+ })+ expect(screen.queryByText('Loading')).not.toBeInTheDocument()+ expect(screen.queryByRole('heading')).not.toBeInTheDocument()+ await user.click(screen.getByRole('button', { name: 'common.operation.copyErrorDetails' }))+ expect(copy).toHaveBeenCalledWith('Failed')+})diff --git a/web/app/notifications/copy-error-action.tsx b/web/app/notifications/copy-error-action.tsxnew file mode 100644index 00000000000..8d649217755--- /dev/null+++ b/web/app/notifications/copy-error-action.tsx@@ -0,0 +1,50 @@+'use client'++import { IconButton } from '@langgenius/dify-ui/icon-button'+import { useClipboard } from 'foxact/use-clipboard'+import { useEffect, useState } from 'react'+import { useTranslation } from 'react-i18next'++export function CopyErrorAction({ text }: { text: string }) {+ const { t } = useTranslation()+ const { copy, copied, error, reset } = useClipboard({ timeout: 2000 })+ useEffect(() => reset, [reset])+ const [feedbackText, setFeedbackText] = useState<string | null>(null)+ const showCopied = feedbackText === text && copied+ const showError = feedbackText === text && error+ const label = showCopied+ ? t(($) => $['operation.copied'], { ns: 'common' })+ : showError+ ? t(($) => $['operation.copyErrorFailed'], { ns: 'common' })+ : t(($) => $['operation.copyErrorDetails'], { ns: 'common' })++ return (+ <>+ <IconButton+ aria-label={label}+ title={label}+ variant="secondary"+ className="absolute top-1 left-1/2 z-10 -translate-x-1/2 group-focus-visible/toast:opacity-100 group-has-focus-visible/toast:opacity-100 focus-visible:opacity-100 [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-hover/toast:opacity-100"+ onClick={() => {+ reset()+ setFeedbackText(null)+ void copy(text).then(() => setFeedbackText(text))+ }}+ >+ <span+ aria-hidden="true"+ className={+ showCopied+ ? 'i-ri-check-line size-4'+ : showError+ ? 'i-ri-error-warning-line size-4'+ : 'i-ri-file-copy-line size-4'+ }+ />+ </IconButton>+ <span className="sr-only" aria-live="polite">+ {showCopied || showError ? label : ''}+ </span>+ </>+ )+}diff --git a/web/app/notifications/host.tsx b/web/app/notifications/host.tsxnew file mode 100644index 00000000000..2b337465aef--- /dev/null+++ b/web/app/notifications/host.tsx@@ -0,0 +1,51 @@+'use client'++import type { ToastManager, ToastViewportProps } from '@langgenius/dify-ui/toast'+import {+ ToastCard,+ ToastPortal,+ ToastProvider,+ ToastViewport,+ useToastManager,+} from '@langgenius/dify-ui/toast'+import { manager } from '.'+import { CopyErrorAction } from './copy-error-action'++export type AppToastHostProps = {+ manager?: ToastManager+ timeout?: number+ limit?: number+ offset?: ToastViewportProps['offset']+}++function Notifications() {+ const { toasts } = useToastManager<Record<string, never>>()+ return toasts.map((item) => {+ const parts = [item.title, item.description]+ const text = parts.every((part) => part == null || typeof part === 'string')+ ? parts.filter(Boolean).join('\n')+ : ''+ return (+ <ToastCard key={item.id} toast={item}>+ {item.type === 'error' && text && <CopyErrorAction text={text} />}+ </ToastCard>+ )+ })+}++export function AppToastHost({+ manager: toastManager = manager,+ timeout = 5000,+ limit = 3,+ offset,+}: AppToastHostProps) {+ return (+ <ToastProvider toastManager={toastManager} timeout={timeout} limit={limit}>+ <ToastPortal>+ <ToastViewport offset={offset}>+ <Notifications />+ </ToastViewport>+ </ToastPortal>+ </ToastProvider>+ )+}diff --git a/web/app/notifications/index.tsx b/web/app/notifications/index.tsxnew file mode 100644index 00000000000..330728f392a--- /dev/null+++ b/web/app/notifications/index.tsx@@ -0,0 +1,6 @@+'use client'++import { createToast, createToastManager } from '@langgenius/dify-ui/toast'++export const manager = createToastManager()+export const toast = createToast(manager)diff --git a/web/app/notifications/notifications.stories.tsx b/web/app/notifications/notifications.stories.tsxnew file mode 100644index 00000000000..41f76b18d1d--- /dev/null+++ b/web/app/notifications/notifications.stories.tsx@@ -0,0 +1,599 @@+import type { ToastApi, ToastManager, ToastViewportProps } from '@langgenius/dify-ui/toast'+import type { Meta, StoryObj } from '@storybook/nextjs-vite'+import {+ createToast,+ createToastManager,+ ToastCard,+ ToastPortal,+ ToastProvider,+ ToastViewport,+ useToastManager,+} from '@langgenius/dify-ui/toast'+import { useState } from 'react'+import { expect, spyOn, userEvent, within } from 'storybook/test'+import { toast as globalToast } from '.'+import { AppToastHost } from './host'++function ToastCards() {+ const { toasts } = useToastManager<Record<string, never>>()+ return toasts.map((item) => <ToastCard key={item.id} toast={item} />)+}++function ExampleToastHost({+ manager,+ timeout,+ limit,+ offset,+}: {+ manager: ToastManager+ timeout?: number+ limit?: number+ offset?: ToastViewportProps['offset']+}) {+ return (+ <ToastProvider toastManager={manager} timeout={timeout} limit={limit}>+ <ToastPortal>+ <ToastViewport offset={offset}>+ <ToastCards />+ </ToastViewport>+ </ToastPortal>+ </ToastProvider>+ )+}++type Scenario = { label: string; run: (toast: ToastApi) => void }+type PlaygroundProps = {+ description: string+ scenarios: Scenario[]+ primitive?: boolean+ timeout?: number+ limit?: number+}++const diagnostic =+ 'Failed to install plugin langgenius/openai:0.2.7: failed to remap assets and persist provider icon because the object storage service rejected the upload after all retry attempts.'+const details = [+ 'operation error S3: PutObject, exceeded maximum number of attempts, 3, StatusCode: 0, RequestID: req-78bb251e-ec45-4974-b8a8-2c70bd8b9e12, HostID: storage-internal-03.',+ 'PUT "https://storage.example.com/plugin-assets/1bd032bb73218a5d141b80cab7111/providers/openai/icon-large-en_US.svg?x-id=PutObject": dial tcp 192.168.0.200:19000: connect: connection refused.',+ 'Unable to store asset icon_large_en_US. The plugin package was downloaded and validated, but installation could not complete because the configured S3 endpoint is unreachable from the plugin daemon.',+ 'Check the storage endpoint, bucket permissions, service credentials, and network routing before retrying. This diagnostic intentionally includes enough detail to reproduce the original installation failure.',+].join('\n')+const buttonClassName =+ 'rounded-lg border border-divider-regular bg-components-button-secondary-bg px-3 py-2 text-sm text-text-primary hover:bg-state-base-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-state-accent-solid'++function Playground({+ description,+ scenarios,+ primitive = false,+ timeout = 0,+ limit = 3,+}: PlaygroundProps) {+ const [{ manager, toast }] = useState(() => {+ const manager = createToastManager()+ return { manager, toast: createToast(manager) }+ })+ return (+ <main className="min-h-screen space-y-5 bg-background-body p-6">+ <p className="max-w-2xl text-sm text-text-secondary">{description}</p>+ <p className="max-w-2xl text-xs text-text-tertiary">+ F6 enters notifications. Tab reaches the card, action, and close button. Use Enter or Space+ to activate. Clear notifications between cases. Switch the theme or resize the preview to+ inspect layout.+ </p>+ <div className="flex max-w-2xl flex-wrap gap-3">+ {scenarios.map(({ label, run }) => (+ <button key={label} type="button" className={buttonClassName} onClick={() => run(toast)}>+ {label}+ </button>+ ))}+ <button type="button" className={buttonClassName} onClick={() => toast.dismiss()}>+ Clear notifications+ </button>+ </div>+ <label className="flex max-w-2xl flex-col gap-2 text-sm text-text-primary">+ Focus return target+ <input+ className="rounded-lg border border-divider-regular bg-components-panel-bg p-2"+ placeholder="Keep typing after dismissal"+ />+ </label>+ {primitive ? (+ <ExampleToastHost manager={manager} timeout={timeout} limit={limit} />+ ) : (+ <AppToastHost manager={manager} timeout={timeout} limit={limit} />+ )}+ </main>+ )+}++const meta = {+ title: 'Application/Notifications',+ component: Playground,+ parameters: { layout: 'fullscreen' },+ argTypes: { scenarios: { control: false, table: { disable: true } } },+ args: { description: '', scenarios: [] },+ tags: ['!autodocs'],+} satisfies Meta<typeof Playground>+export default meta+type Story = StoryObj<typeof meta>++export const Tones: Story = {+ args: {+ description:+ 'Only error notifications gain an automatic copy action. Plain, success, warning, and info retain the primitive appearance.',+ scenarios: [+ { label: 'Plain', run: (toast) => toast('New activity') },+ {+ label: 'Success',+ run: (toast) => toast.success('Saved', { description: 'Your changes are available.' }),+ },+ { label: 'Warning', run: (toast) => toast.warning('Storage almost full') },+ { label: 'Info', run: (toast) => toast.info('Invitation sent') },+ { label: 'Error', run: (toast) => toast.error('Upload failed', { description: details }) },+ {+ label: 'Error via callable API',+ run: (toast) => toast('Connection failed', { type: 'error' }),+ },+ ],+ },+}++export const PrimitiveParity: Story = {+ args: {+ primitive: true,+ description:+ 'Direct Dify UI factory: an error still has only its close control. Actions remain caller-owned and do not dismiss automatically.',+ scenarios: [+ {+ label: 'Primitive error',+ run: (toast) => toast.error(diagnostic, { description: details }),+ },+ {+ label: 'Primitive action',+ run: (toast) =>+ toast.info('Review available', {+ actionProps: { children: 'Review', onClick: () => toast.success('Review opened') },+ }),+ },+ ],+ },+ play: async ({ canvasElement }) => {+ const canvas = within(canvasElement)+ await userEvent.click(canvas.getByRole('button', { name: /^Primitive error$/ }))+ const body = within(canvasElement.ownerDocument.body)+ await expect(await body.findByRole('dialog', { name: diagnostic })).toBeVisible()+ await expect(body.queryByRole('button', { name: 'Copy error details' })).not.toBeInTheDocument()+ },+}++export const ErrorContent: Story = {+ args: {+ description:+ 'Copy preserves the full plain-text title and description, separated by a newline. Empty content and React nodes do not generate a misleading copy action.',+ scenarios: [+ { label: 'Title only', run: (toast) => toast.error('Connection failed') },+ { label: 'Description only', run: (toast) => toast.error(null, { description: details }) },+ {+ label: 'Empty title',+ run: (toast) => toast.error('', { description: 'Useful error detail' }),+ },+ { label: 'Empty content', run: (toast) => toast.error('') },+ {+ label: 'Unicode and multiline',+ run: (toast) =>+ toast.error('上传失败 / فشل التحميل / 🚫', {+ description: '第一行\nSecond line\n<not html> & "quoted"',+ }),+ },+ {+ label: 'Rich title',+ run: (toast) =>+ toast.error(<strong>Permission denied</strong>, {+ description: 'Ask your workspace administrator.',+ }),+ },+ {+ label: 'Rich description',+ run: (toast) =>+ toast.error('Access denied', {+ description: <a href="#permission-help">View permission help</a>,+ }),+ },+ { label: 'Numeric content', run: (toast) => toast.error(503) },+ ],+ },+}++export const LongContent: Story = {+ args: {+ description:+ 'Inspect long diagnostics, unbroken tokens, and many lines at narrow widths and both themes. There is intentionally no new maximum-height policy; very long cards expose the existing primitive layout limit.',+ scenarios: [+ {+ label: 'Realistic diagnostic',+ run: (toast) => toast.error(diagnostic, { description: details }),+ },+ {+ label: 'Unbroken token',+ run: (toast) =>+ toast.error('Invalid response', { description: '0123456789abcdef'.repeat(30) }),+ },+ { label: 'Very long title', run: (toast) => toast.error(diagnostic.repeat(8)) },+ {+ label: 'Many lines',+ run: (toast) =>+ toast.error('Validation errors', {+ description: Array.from(+ { length: 30 },+ (_, i) => `Field ${i + 1}: required value is missing`,+ ).join('\n'),+ }),+ },+ ],+ },+}++export const CallerActions: Story = {+ args: {+ description:+ 'Caller actions remain available alongside copying for text errors, including repeated IDs and updates. Rich content retains its caller action without extracting text.',+ scenarios: [+ {+ label: 'Custom retry',+ run: (toast) =>+ toast.error('Retryable failure', {+ id: 'custom',+ actionProps: {+ children: 'Retry request',+ onClick: () =>+ toast.update('custom', {+ title: 'Recovered',+ type: 'success',+ actionProps: undefined,+ }),+ },+ }),+ },+ {+ label: 'Update custom title',+ run: (toast) => toast.error('Still unavailable', { id: 'custom' }),+ },+ {+ label: 'Remove custom action',+ run: (toast) => toast.update('custom', { actionProps: undefined }),+ },+ {+ label: 'Rich error with explicit action',+ run: (toast) =>+ toast.error(<strong>Session expired</strong>, {+ actionProps: {+ children: 'Sign in again',+ onClick: () => toast.success('Sign-in action invoked'),+ },+ }),+ },+ ],+ },+}++export const UpdatesAndRepeatedIds: Story = {+ args: {+ description:+ 'Run these controls in sequence. A repeated ID remains one card and retains omitted description fields. Copy must follow the effective content; success removes the generated action.',+ scenarios: [+ {+ label: '1. Create error',+ run: (toast) =>+ toast.error('Original title', { id: 'upsert', description: 'Retained description' }),+ },+ {+ label: '2. Replace title via same ID',+ run: (toast) => toast.error('Updated title', { id: 'upsert' }),+ },+ {+ label: '3. Replace description',+ run: (toast) => toast.update('upsert', { description: 'New description' }),+ },+ {+ label: '4. Clear description',+ run: (toast) => toast.update('upsert', { description: null }),+ },+ {+ label: '5. Recover',+ run: (toast) => toast.update('upsert', { title: 'Recovered', type: 'success' }),+ },+ {+ label: '6. Fail again',+ run: (toast) => toast.update('upsert', { title: 'Failed again', type: 'error' }),+ },+ { label: 'Dismiss one', run: (toast) => toast.dismiss('upsert') },+ {+ label: 'Update absent ID',+ run: (toast) =>+ toast.update('does-not-exist', { title: 'Should not appear', type: 'error' }),+ },+ ],+ },+}++export const PromiseResults: Story = {+ args: {+ description:+ 'A loading toast transitions in place. Error callbacks and string errors get copy actions; caller actions and inherited loading descriptions remain intact. Rejections are handled by these demo triggers.',+ scenarios: [+ {+ label: 'Resolve',+ run: (toast) => {+ void toast.promise(+ new Promise<string>((resolve) => setTimeout(() => resolve('Upload'), 1200)),+ {+ loading: 'Uploading…',+ success: (value) => `${value} complete`,+ error: 'Upload failed',+ },+ )+ },+ },+ {+ label: 'Reject string',+ run: (toast) => {+ void toast+ .promise(+ new Promise((_, reject) =>+ setTimeout(() => reject(new Error('Network failed')), 1200),+ ),+ { loading: 'Connecting…', success: 'Connected', error: 'Connection failed' },+ )+ .catch(() => {})+ },+ },+ {+ label: 'Reject with details',+ run: (toast) => {+ void toast+ .promise(Promise.reject(new Error('Connection refused')), {+ loading: 'Uploading…',+ success: 'Uploaded',+ error: (error) => ({ title: 'Upload failed', description: String(error) }),+ })+ .catch(() => {})+ },+ },+ {+ label: 'Retain loading description',+ run: (toast) => {+ void toast+ .promise(Promise.reject(new Error('Denied')), {+ loading: { title: 'Uploading…', description: 'File: document.pdf' },+ success: 'Uploaded',+ error: 'Permission denied',+ })+ .catch(() => {})+ },+ },+ {+ label: 'Explicit promise action',+ run: (toast) => {+ void toast+ .promise(Promise.reject(new Error('Denied')), {+ loading: 'Checking…',+ success: 'Ready',+ error: {+ title: 'Access denied',+ actionProps: {+ children: 'Request access',+ onClick: () => toast.info('Access requested'),+ },+ },+ })+ .catch(() => {})+ },+ },+ ],+ },+}++export const StackAndDismissal: Story = {+ args: {+ description:+ 'Limit three visible cards. Hover or focus expands the stack. Close individual cards, dismiss all, or swipe upward/right; a downward gesture should not dismiss this top-anchored stack.',+ scenarios: [+ {+ label: 'Burst of six',+ run: (toast) => {+ for (let i = 1; i <= 6; i++)+ toast.error(`Failure ${i}`, { description: `Diagnostic ${i}` })+ },+ },+ {+ label: 'Mixed stack',+ run: (toast) => {+ toast.success('Saved')+ toast.warning('Quota low')+ toast.error('Sync failed', { description: details })+ },+ },+ {+ label: 'Persistent error',+ run: (toast) => toast.error('Still needs attention', { timeout: 0 }),+ },+ ],+ },+}++export const AutoDismissAndPause: Story = {+ args: {+ timeout: 3000,+ description:+ 'Default timeout is three seconds in this story. Hovering or keyboard focus pauses dismissal. Copy feedback must not extend the timeout or dismiss the card. Persistent errors remain until closed.',+ scenarios: [+ { label: 'Timed error', run: (toast) => toast.error('Expires after three seconds') },+ {+ label: 'Persistent error',+ run: (toast) => toast.error('Persistent error', { timeout: 0 }),+ },+ { label: 'Short success', run: (toast) => toast.success('Saved briefly', { timeout: 1000 }) },+ ],+ },+}++export const CopyFeedback: Story = {+ args: {+ description:+ 'Real clipboard integration: copy, paste into the field, and compare all lines. The action shows Copied for two seconds and remains focused. Repeated copying stays within the same toast.',+ scenarios: [+ {+ label: 'Show copyable error',+ run: (toast) => toast.error(diagnostic, { description: details }),+ },+ ],+ },+}++export const ClipboardFailure: Story = {+ ...CopyFeedback,+ args: {+ ...CopyFeedback.args,+ description:+ 'Simulated clipboard and fallback rejection. Copy reports failure in the same action; retry remains available and no secondary error toast appears.',+ },+ beforeEach: () => {+ const clipboard = spyOn(navigator.clipboard, 'writeText').mockRejectedValue(+ new Error('Permission denied'),+ )+ const fallback = spyOn(document, 'execCommand').mockReturnValue(false)+ return () => {+ clipboard.mockRestore()+ fallback.mockRestore()+ }+ },+}++export const ClipboardFallback: Story = {+ ...CopyFeedback,+ args: {+ ...CopyFeedback.args,+ description:+ 'Simulated Clipboard API rejection. The real foxact selection-based fallback runs with execCommand success simulated. Check that the copy button retains keyboard focus.',+ },+ beforeEach: () => {+ const clipboard = spyOn(navigator.clipboard, 'writeText').mockRejectedValue(+ new Error('Permission denied'),+ )+ const fallback = spyOn(document, 'execCommand').mockReturnValue(true)+ return () => {+ clipboard.mockRestore()+ fallback.mockRestore()+ }+ },+}++export const PendingCopyAndReplacement: Story = {+ args: {+ description:+ 'Clipboard completion is delayed two seconds. Click copy repeatedly, then replace or dismiss the card while pending. The new card must not show stale Copied feedback.',+ scenarios: [+ {+ label: 'Original error',+ run: (toast) => toast.error('Original diagnostic', { id: 'pending' }),+ },+ {+ label: 'Replace while copying',+ run: (toast) => toast.error('Replacement diagnostic', { id: 'pending' }),+ },+ { label: 'Dismiss while copying', run: (toast) => toast.dismiss('pending') },+ ],+ },+ beforeEach: () => {+ const clipboard = spyOn(navigator.clipboard, 'writeText').mockImplementation(+ () => new Promise((resolve) => setTimeout(resolve, 2000)),+ )+ return () => clipboard.mockRestore()+ },+}++function IsolatedHosts() {+ const [{ left, right }] = useState(() => {+ const make = () => {+ const manager = createToastManager()+ return { manager, toast: createToast(manager) }+ }+ return { left: make(), right: make() }+ })+ return (+ <main className="min-h-screen space-y-4 bg-background-body p-6">+ <p className="max-w-2xl text-sm text-text-secondary">+ Two independently owned managers reuse the same ID. Updating or dismissing one must leave+ the other intact. The second viewport uses the configuration host's 60px top offset.+ </p>+ <div className="flex max-w-2xl flex-wrap gap-3">+ <button+ type="button"+ className={buttonClassName}+ onClick={() => {+ left.toast.error('Left error', { id: 'shared' })+ right.toast.error('Right error', { id: 'shared' })+ }}+ >+ Show both+ </button>+ <button+ type="button"+ className={buttonClassName}+ onClick={() => left.toast.update('shared', { title: 'Left updated' })}+ >+ Update left+ </button>+ <button type="button" className={buttonClassName} onClick={() => left.toast.dismiss()}>+ Dismiss left+ </button>+ <button type="button" className={buttonClassName} onClick={() => right.toast.dismiss()}>+ Dismiss right+ </button>+ </div>+ <AppToastHost manager={left.manager} timeout={0} offset={{ top: 180, right: '52%' }} />+ <AppToastHost manager={right.manager} timeout={0} offset={{ top: 60 }} />+ </main>+ )+}+export const ScopedHostIsolation: Story = { render: () => <IsolatedHosts /> }++export const GlobalWebInstance: Story = {+ args: {+ description:+ 'Uses the actual web singleton and the AppToastHost already mounted by the Storybook decorator. Copy, typed calls, and dismissals use the same entrypoint as application callers.',+ scenarios: [+ {+ label: 'Global error',+ run: () => globalToast.error('Global request failed', { description: details, timeout: 0 }),+ },+ { label: 'Global success', run: () => globalToast.success('Global save complete') },+ { label: 'Dismiss global notifications', run: () => globalToast.dismiss() },+ ],+ },+ beforeEach: () => {+ globalToast.dismiss()+ return () => globalToast.dismiss()+ },+}++export const DarkTheme: Story = {+ ...CopyFeedback,+ globals: { theme: 'dark' },+}++export const NarrowViewport: Story = {+ ...LongContent,+ globals: { viewport: { value: 'toastMobile', isRotated: false } },+ parameters: {+ viewport: {+ options: {+ toastMobile: {+ name: 'Mobile 360px',+ styles: { width: '360px', height: '740px' },+ type: 'mobile',+ },+ },+ },+ },+}diff --git a/web/app/reset-password/check-code/page.tsx b/web/app/reset-password/check-code/page.tsxindex f1d3990e5bc..d6688511f02 100644--- a/web/app/reset-password/check-code/page.tsx+++ b/web/app/reset-password/check-code/page.tsx@@ -3,11 +3,11 @@ import { Button } from '@langgenius/dify-ui/button'import { Field, FieldError, FieldLabel } from '@langgenius/dify-ui/field'import { Form } from '@langgenius/dify-ui/form'import { Input } from '@langgenius/dify-ui/input'-import { toast } from '@langgenius/dify-ui/toast'import { useState } from 'react'import { useTranslation } from 'react-i18next'import { useLocale } from '#i18n'import Countdown from '@/app/components/signin/countdown'+import { toast } from '@/app/notifications'import useDocumentTitle from '@/hooks/use-document-title'import { useRouter, useSearchParams } from '@/next/navigation'import { sendResetPasswordCode, verifyResetPasswordCode } from '@/service/common'diff --git a/web/app/reset-password/page.tsx b/web/app/reset-password/page.tsxindex 1d3fd131c6b..858432a0d82 100644--- a/web/app/reset-password/page.tsx+++ b/web/app/reset-password/page.tsx@@ -3,10 +3,10 @@ import { Button } from '@langgenius/dify-ui/button'import { Field, FieldError, FieldLabel, FieldValidity } from '@langgenius/dify-ui/field'import { Form } from '@langgenius/dify-ui/form'import { Input } from '@langgenius/dify-ui/input'-import { toast } from '@langgenius/dify-ui/toast'import { useState } from 'react'import { useTranslation } from 'react-i18next'import { useLocale } from '#i18n'+import { toast } from '@/app/notifications'import { emailRegex } from '@/config'import useDocumentTitle from '@/hooks/use-document-title'import Link from '@/next/link'diff --git a/web/app/signin/check-code/page.tsx b/web/app/signin/check-code/page.tsxindex c38b0045529..fc85ea2bb34 100644--- a/web/app/signin/check-code/page.tsx+++ b/web/app/signin/check-code/page.tsx@@ -3,7 +3,6 @@ import { Button } from '@langgenius/dify-ui/button'import { Field, FieldError, FieldLabel } from '@langgenius/dify-ui/field'import { Form } from '@langgenius/dify-ui/form'import { Input } from '@langgenius/dify-ui/input'-import { toast } from '@langgenius/dify-ui/toast'import { useQueryClient, useSuspenseQuery } from '@tanstack/react-query'import { useEffect, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'@@ -11,6 +10,7 @@ import { useLocale } from '#i18n'import { trackEvent } from '@/app/components/base/amplitude'import Countdown from '@/app/components/signin/countdown'import { COUNT_DOWN_TIME_MS, useSetCountdownLeftTime } from '@/app/components/signin/storage'+import { toast } from '@/app/notifications'import { TURNSTILE_SITE_KEY } from '@/config'import { userProfileQueryOptions } from '@/features/account-profile/client'import { systemFeaturesQueryOptions } from '@/features/system-features/client'diff --git a/web/app/signin/components/mail-and-password-auth.tsx b/web/app/signin/components/mail-and-password-auth.tsxindex 70d94d8a0ab..08e7e93a135 100644--- a/web/app/signin/components/mail-and-password-auth.tsx+++ b/web/app/signin/components/mail-and-password-auth.tsx@@ -5,11 +5,11 @@ import { Form } from '@langgenius/dify-ui/form'import { IconButton } from '@langgenius/dify-ui/icon-button'import { Input } from '@langgenius/dify-ui/input'import { InputGroup, InputGroupAddon, InputGroupInput } from '@langgenius/dify-ui/input-group'-import { toast } from '@langgenius/dify-ui/toast'import { useQueryClient } from '@tanstack/react-query'import { useState } from 'react'import { useTranslation } from 'react-i18next'import { trackEvent } from '@/app/components/base/amplitude'+import { toast } from '@/app/notifications'import { emailRegex } from '@/config'import Link from '@/next/link'import { useRouter, useSearchParams } from '@/next/navigation'diff --git a/web/app/signin/components/sso-auth.tsx b/web/app/signin/components/sso-auth.tsxindex 0f08b4e55d4..8e7206ed64a 100644--- a/web/app/signin/components/sso-auth.tsx+++ b/web/app/signin/components/sso-auth.tsx@@ -3,10 +3,10 @@ import type { SsoProtocol } from '@dify/contracts/api/console/system-features/tyimport type { FC } from 'react'import { zSsoProtocol } from '@dify/contracts/api/console/system-features/zod.gen'import { Button } from '@langgenius/dify-ui/button'-import { toast } from '@langgenius/dify-ui/toast'import { useState } from 'react'import { useTranslation } from 'react-i18next'import { Lock01 } from '@/app/components/base/icons/src/vender/solid/security'+import { toast } from '@/app/notifications'import { useRouter, useSearchParams } from '@/next/navigation'import { getUserOAuth2SSOUrl, getUserOIDCSSOUrl, getUserSAMLSSOUrl } from '@/service/sso'diff --git a/web/app/signin/normal-form.tsx b/web/app/signin/normal-form.tsxindex fc28e790240..2b6181bee09 100644--- a/web/app/signin/normal-form.tsx+++ b/web/app/signin/normal-form.tsx@@ -1,11 +1,11 @@import { zLicenseStatus } from '@dify/contracts/api/console/system-features/zod.gen'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { RiContractLine, RiDoorLockLine, RiErrorWarningFill } from '@remixicon/react'import { useQuery, useSuspenseQuery } from '@tanstack/react-query'import { useEffect, useState } from 'react'import { useTranslation } from 'react-i18next'import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder'+import { toast } from '@/app/notifications'import { isLegacyBase401, userProfileQueryOptions } from '@/features/account-profile/client'import { systemFeaturesQueryOptions } from '@/features/system-features/client'import Link from '@/next/link'diff --git a/web/app/signin/one-more-step.tsx b/web/app/signin/one-more-step.tsxindex 3a553c6037b..8cf6494c1c3 100644--- a/web/app/signin/one-more-step.tsx+++ b/web/app/signin/one-more-step.tsx@@ -14,10 +14,10 @@ import {SelectLabel,SelectTrigger,} from '@langgenius/dify-ui/select'-import { toast } from '@langgenius/dify-ui/toast'import { useQueryClient } from '@tanstack/react-query'import { useReducer } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { resolvePostLoginRedirect } from '@/app/signin/utils/post-login-redirect'import { LICENSE_LINK } from '@/constants/link'import { languages } from '@/i18n/language'diff --git a/web/app/signup/check-code/page.tsx b/web/app/signup/check-code/page.tsxindex 97297f5a89a..ae015933dc3 100644--- a/web/app/signup/check-code/page.tsx+++ b/web/app/signup/check-code/page.tsx@@ -4,11 +4,11 @@ import { Button } from '@langgenius/dify-ui/button'import { Field, FieldError, FieldLabel } from '@langgenius/dify-ui/field'import { Form } from '@langgenius/dify-ui/form'import { Input } from '@langgenius/dify-ui/input'-import { toast } from '@langgenius/dify-ui/toast'import { useState } from 'react'import { useTranslation } from 'react-i18next'import { useLocale } from '#i18n'import Countdown from '@/app/components/signin/countdown'+import { toast } from '@/app/notifications'import useDocumentTitle from '@/hooks/use-document-title'import { useRouter, useSearchParams } from '@/next/navigation'import { useMailValidity, useSendMail } from '@/service/use-common'diff --git a/web/app/signup/set-password/page.tsx b/web/app/signup/set-password/page.tsxindex 81b2148df88..9e0d28d93a0 100644--- a/web/app/signup/set-password/page.tsx+++ b/web/app/signup/set-password/page.tsx@@ -12,13 +12,13 @@ import {} from '@langgenius/dify-ui/field'import { Form } from '@langgenius/dify-ui/form'import { Input } from '@langgenius/dify-ui/input'-import { toast } from '@langgenius/dify-ui/toast'import { useQueryClient } from '@tanstack/react-query'import Cookies from 'js-cookie'import { useCallback, useRef } from 'react'import { useTranslation } from 'react-i18next'import { useLocale } from '#i18n'import { rememberRegistrationSuccess } from '@/app/components/base/amplitude/registration-tracking'+import { toast } from '@/app/notifications'import { resolvePostLoginRedirect } from '@/app/signin/utils/post-login-redirect'import { validPassword } from '@/config'import useDocumentTitle from '@/hooks/use-document-title'diff --git a/web/features/agent-v2/agent-detail/access/components/__tests__/access-surface-cards.spec.tsx b/web/features/agent-v2/agent-detail/access/components/__tests__/access-surface-cards.spec.tsxindex c7ff7124249..107489dbb6c 100644--- a/web/features/agent-v2/agent-detail/access/components/__tests__/access-surface-cards.spec.tsx+++ b/web/features/agent-v2/agent-detail/access/components/__tests__/access-surface-cards.spec.tsx@@ -4,11 +4,11 @@ import type {} from '@dify/contracts/api/console/agent/types.gen'import type { AppDetail } from '@dify/contracts/api/console/apps/types.gen'import type React from 'react'-import { toast } from '@langgenius/dify-ui/toast'import { QueryClient } from '@tanstack/react-query'import { render, screen, waitFor, within } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { NuqsTestingAdapter } from 'nuqs/adapters/testing'+import { toast } from '@/app/notifications'import { AgentPermission } from '@/features/agent-v2/acl'import { consoleQuery } from '@/service/console'import { seedAccountProfileQuery } from '@/test/console/account-profile'@@ -41,7 +41,7 @@ vi.mock('@/context/i18n', () => ({useDocLink: () => (path: string) => `https://docs.example.test${path}`,}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: vi.fn(),success: vi.fn(),diff --git a/web/features/agent-v2/agent-detail/access/components/agent-api-key-modal.tsx b/web/features/agent-v2/agent-detail/access/components/agent-api-key-modal.tsxindex a7095abeaf1..9eabb3f9a66 100644--- a/web/features/agent-v2/agent-detail/access/components/agent-api-key-modal.tsx+++ b/web/features/agent-v2/agent-detail/access/components/agent-api-key-modal.tsx@@ -18,11 +18,11 @@ import {DialogTitle,} from '@langgenius/dify-ui/dialog'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'import { useState } from 'react'import { useTranslation } from 'react-i18next'import { CopyFeedback } from '@/app/components/base/copy-feedback'+import { toast } from '@/app/notifications'import useTimestamp from '@/hooks/use-timestamp'import { consoleQuery } from '@/service/console'diff --git a/web/features/agent-v2/agent-detail/access/components/service-api-access-card.tsx b/web/features/agent-v2/agent-detail/access/components/service-api-access-card.tsxindex 21bff295487..da373211f27 100644--- a/web/features/agent-v2/agent-detail/access/components/service-api-access-card.tsx+++ b/web/features/agent-v2/agent-detail/access/components/service-api-access-card.tsx@@ -3,12 +3,12 @@import type { AgentAppDetailWithSite } from '@dify/contracts/api/console/agent/types.gen'import { Button, buttonVariants } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'import { useState } from 'react'import { useTranslation } from 'react-i18next'import { AccessPointCard } from '@/app/components/base/access-point/card'import { AccessPointUrl } from '@/app/components/base/access-point/url'+import { toast } from '@/app/notifications'import { useDocLink } from '@/context/i18n'import { useAgentPermissions } from '@/features/agent-v2/permissions'import { consoleQuery } from '@/service/console'diff --git a/web/features/agent-v2/agent-detail/access/components/web-app-access-card.tsx b/web/features/agent-v2/agent-detail/access/components/web-app-access-card.tsxindex a1e91110141..6674d0ca221 100644--- a/web/features/agent-v2/agent-detail/access/components/web-app-access-card.tsx+++ b/web/features/agent-v2/agent-detail/access/components/web-app-access-card.tsx@@ -5,7 +5,6 @@ import type { AppSiteUpdatePayload } from '@dify/contracts/api/console/apps/typeimport type { ConfigParams, SettingsAppInfo } from '@/app/components/app/overview/settings'import type { AppIconType } from '@/types/app'import { Button } from '@langgenius/dify-ui/button'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useQueryClient } from '@tanstack/react-query'import { useState } from 'react'import { useTranslation } from 'react-i18next'@@ -19,6 +18,7 @@ import SettingsModal from '@/app/components/app/overview/settings'import { AccessPointCard } from '@/app/components/base/access-point/card'import { AccessPointUrl } from '@/app/components/base/access-point/url'import AppIcon from '@/app/components/base/app-icon'+import { toast } from '@/app/notifications'import { getAgentACLCapabilities } from '@/features/agent-v2/acl'import dynamic from '@/next/dynamic'import { consoleQuery } from '@/service/console'diff --git a/web/features/agent-v2/agent-detail/configure/__tests__/page.spec.tsx b/web/features/agent-v2/agent-detail/configure/__tests__/page.spec.tsxindex 093962482b8..56cbe85f94e 100644--- a/web/features/agent-v2/agent-detail/configure/__tests__/page.spec.tsx+++ b/web/features/agent-v2/agent-detail/configure/__tests__/page.spec.tsx@@ -196,7 +196,7 @@ vi.mock('@tanstack/react-query', async (importOriginal) => {}})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: toastMock,}))diff --git a/web/features/agent-v2/agent-detail/configure/__tests__/use-agent-configure-sync.spec.tsx b/web/features/agent-v2/agent-detail/configure/__tests__/use-agent-configure-sync.spec.tsxindex 5e27852b31a..2235abfbf99 100644--- a/web/features/agent-v2/agent-detail/configure/__tests__/use-agent-configure-sync.spec.tsx+++ b/web/features/agent-v2/agent-detail/configure/__tests__/use-agent-configure-sync.spec.tsx@@ -147,7 +147,7 @@ const configuredModel = {model: 'gpt-4o-mini',}-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: toastMock,}))diff --git a/web/features/agent-v2/agent-detail/configure/components/composer-session.tsx b/web/features/agent-v2/agent-detail/configure/components/composer-session.tsxindex 39d1f129eb6..e6173eff6e7 100644--- a/web/features/agent-v2/agent-detail/configure/components/composer-session.tsx+++ b/web/features/agent-v2/agent-detail/configure/components/composer-session.tsx@@ -8,13 +8,13 @@ import type {import type { useAgentConfigureData } from '../hooks'import type { AgentConfigureRightPanelMode } from '../state'import type { AgentPreviewChatController } from './preview/chat-conversation'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useQueryClient } from '@tanstack/react-query'import { useAtomValue, useSetAtom } from 'jotai'import { ScopeProvider } from 'jotai-scope'import { useCallback, useEffect, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder'+import { toast } from '@/app/notifications'import { agentSoulConfigToFormState } from '@/features/agent-v2/agent-composer/conversions'import { AgentComposerProvider } from '@/features/agent-v2/agent-composer/provider'import { rebaseAgentComposerDraftAtom } from '@/features/agent-v2/agent-composer/store'diff --git a/web/features/agent-v2/agent-detail/configure/components/orchestrate/__tests__/publish-bar.spec.tsx b/web/features/agent-v2/agent-detail/configure/components/orchestrate/__tests__/publish-bar.spec.tsxindex 40719552008..954167d03ee 100644--- a/web/features/agent-v2/agent-detail/configure/components/orchestrate/__tests__/publish-bar.spec.tsx+++ b/web/features/agent-v2/agent-detail/configure/components/orchestrate/__tests__/publish-bar.spec.tsx@@ -53,7 +53,7 @@ const composerQuery = vi.hoisted(() => ({shouldFail: false,}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: toastMock,}))diff --git a/web/features/agent-v2/agent-detail/configure/components/orchestrate/advanced/__tests__/env.spec.tsx b/web/features/agent-v2/agent-detail/configure/components/orchestrate/advanced/__tests__/env.spec.tsxindex f51f7d7b889..a96ef268255 100644--- a/web/features/agent-v2/agent-detail/configure/components/orchestrate/advanced/__tests__/env.spec.tsx+++ b/web/features/agent-v2/agent-detail/configure/components/orchestrate/advanced/__tests__/env.spec.tsx@@ -1,14 +1,14 @@-import { toast } from '@langgenius/dify-ui/toast'import { fireEvent, render, screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { beforeEach, describe, expect, it, vi } from 'vite-plus/test'+import { toast } from '@/app/notifications'import { defaultAgentSoulConfigFormState } from '@/features/agent-v2/agent-composer/form-state'import { AgentComposerProvider } from '@/features/agent-v2/agent-composer/provider'import { AgentOrchestrateReadOnlyContext } from '../../read-only-context'import { AgentEnvEditor, EnvVariablesTable } from '../env'import { getEnvImportPlatform, parseEnvImport } from '../env-utils'-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: vi.fn(),},diff --git a/web/features/agent-v2/agent-detail/configure/components/orchestrate/advanced/env.tsx b/web/features/agent-v2/agent-detail/configure/components/orchestrate/advanced/env.tsxindex e3243653b73..474601660a3 100644--- a/web/features/agent-v2/agent-detail/configure/components/orchestrate/advanced/env.tsx+++ b/web/features/agent-v2/agent-detail/configure/components/orchestrate/advanced/env.tsx@@ -12,11 +12,11 @@ import {SelectItemText,SelectTrigger,} from '@langgenius/dify-ui/select'-import { toast } from '@langgenius/dify-ui/toast'import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'import { useAtomValue, useSetAtom } from 'jotai'import { useEffect, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import {addEnvVariableAtom,agentComposerEnvVariablesAtom,diff --git a/web/features/agent-v2/agent-detail/configure/components/orchestrate/files/__tests__/index.spec.tsx b/web/features/agent-v2/agent-detail/configure/components/orchestrate/files/__tests__/index.spec.tsxindex ed1872b48c6..3483f7d00da 100644--- a/web/features/agent-v2/agent-detail/configure/components/orchestrate/files/__tests__/index.spec.tsx+++ b/web/features/agent-v2/agent-detail/configure/components/orchestrate/files/__tests__/index.spec.tsx@@ -1,11 +1,11 @@import type { AgentConfigApiContext } from '../../config-context'import type { AgentSoulConfigFormState } from '@/features/agent-v2/agent-composer/form-state'-import { toast } from '@langgenius/dify-ui/toast'import { QueryClient } from '@tanstack/react-query'import { act, fireEvent, render, screen, waitFor, within } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { useAtomValue } from 'jotai'import { beforeEach, describe, expect, it, vi } from 'vite-plus/test'+import { toast } from '@/app/notifications'import { formStateToAgentSoulConfig } from '@/features/agent-v2/agent-composer/conversions'import { defaultAgentSoulConfigFormState } from '@/features/agent-v2/agent-composer/form-state'import { AgentComposerProvider } from '@/features/agent-v2/agent-composer/provider'@@ -57,7 +57,7 @@ const mocks = vi.hoisted(() => ({},}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: vi.fn(),error: vi.fn(),diff --git a/web/features/agent-v2/agent-detail/configure/components/orchestrate/files/upload-dialog.tsx b/web/features/agent-v2/agent-detail/configure/components/orchestrate/files/upload-dialog.tsxindex 9c8d483ad69..8cbc3312e70 100644--- a/web/features/agent-v2/agent-detail/configure/components/orchestrate/files/upload-dialog.tsx+++ b/web/features/agent-v2/agent-detail/configure/components/orchestrate/files/upload-dialog.tsx@@ -19,13 +19,13 @@ import {} from '@langgenius/dify-ui/dialog'import { FileTreeIcon } from '@langgenius/dify-ui/file-tree'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation } from '@tanstack/react-query'import { useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import { useFileSizeLimit } from '@/app/components/base/file-uploader/hooks'import { getSupportFileType } from '@/app/components/base/file-uploader/utils'import { SupportUploadFileTypes } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { consoleQuery } from '@/service/console'import { useFileUploadConfig } from '@/service/use-common'import { formatFileSize } from '@/utils/format'diff --git a/web/features/agent-v2/agent-detail/configure/components/orchestrate/prompt-editor/index.tsx b/web/features/agent-v2/agent-detail/configure/components/orchestrate/prompt-editor/index.tsxindex c463fcbe942..db2d7e2c467 100644--- a/web/features/agent-v2/agent-detail/configure/components/orchestrate/prompt-editor/index.tsx+++ b/web/features/agent-v2/agent-detail/configure/components/orchestrate/prompt-editor/index.tsx@@ -17,7 +17,6 @@ import type {} from '@/features/agent-v2/agent-composer/form-state'import { cn } from '@langgenius/dify-ui/cn'import { Kbd } from '@langgenius/dify-ui/kbd'-import { toast } from '@langgenius/dify-ui/toast'import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'import { mergeRegister } from '@lexical/utils'@@ -39,6 +38,7 @@ import { Infotip } from '@/app/components/base/infotip'import PromptEditor from '@/app/components/base/prompt-editor'import BlockIcon from '@/app/components/workflow/block-icon'import { BlockEnum } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { agentComposerKnowledgeRetrievalsAtom } from '@/features/agent-v2/agent-composer/store-modules/knowledge'import { agentComposerPromptAtom } from '@/features/agent-v2/agent-composer/store-modules/prompt'import {diff --git a/web/features/agent-v2/agent-detail/configure/components/orchestrate/publish-bar/index.tsx b/web/features/agent-v2/agent-detail/configure/components/orchestrate/publish-bar/index.tsxindex d6bf797d589..5efe1ed2266 100644--- a/web/features/agent-v2/agent-detail/configure/components/orchestrate/publish-bar/index.tsx+++ b/web/features/agent-v2/agent-detail/configure/components/orchestrate/publish-bar/index.tsx@@ -10,13 +10,13 @@ import { Button } from '@langgenius/dify-ui/button'import { Collapsible, CollapsiblePanel } from '@langgenius/dify-ui/collapsible'import { Kbd, KbdGroup } from '@langgenius/dify-ui/kbd'import { StatusDot } from '@langgenius/dify-ui/status-dot'-import { toast } from '@langgenius/dify-ui/toast'import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'import { formatForDisplay, useHotkey } from '@tanstack/react-hotkeys'import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'import { useAtomValue } from 'jotai'import { useId, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { isAgentComposerDirtyAtom } from '@/features/agent-v2/agent-composer/store'import { useFormatTimeFromNow } from '@/hooks/use-format-time-from-now'import useTimestamp from '@/hooks/use-timestamp'diff --git a/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/__tests__/index.spec.tsx b/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/__tests__/index.spec.tsxindex debcb886f34..a68bb0ab526 100644--- a/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/__tests__/index.spec.tsx+++ b/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/__tests__/index.spec.tsx@@ -1,13 +1,13 @@import type { SkillResponse } from '@dify/contracts/api/console/workspaces/types.gen'import type { AgentConfigApiContext } from '../../config-context'import type { AgentSoulConfigFormState } from '@/features/agent-v2/agent-composer/form-state'-import { toast } from '@langgenius/dify-ui/toast'import { QueryClient, QueryClientProvider } from '@tanstack/react-query'import { fireEvent, render, screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { useAtomValue } from 'jotai'import { useState } from 'react'import { afterEach, beforeEach, describe, expect, it, vi } from 'vite-plus/test'+import { toast } from '@/app/notifications'import { formStateToAgentSoulConfig } from '@/features/agent-v2/agent-composer/conversions'import { defaultAgentSoulConfigFormState } from '@/features/agent-v2/agent-composer/form-state'import { AgentComposerProvider } from '@/features/agent-v2/agent-composer/provider'@@ -85,7 +85,7 @@ const mocks = vi.hoisted(() => ({skillEnabled: true,}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: vi.fn(),error: vi.fn(),diff --git a/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/index.tsx b/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/index.tsxindex 7e431b8cb2b..7cf56deed03 100644--- a/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/index.tsx+++ b/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/index.tsx@@ -17,7 +17,6 @@ import {DropdownMenuTrigger,} from '@langgenius/dify-ui/dropdown-menu'import { Popover, PopoverContent, PopoverTrigger } from '@langgenius/dify-ui/popover'-import { toast } from '@langgenius/dify-ui/toast'import {keepPreviousData,useInfiniteQuery,@@ -31,6 +30,7 @@ import { useCallback, useMemo, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import { SearchInput } from '@/app/components/base/search-input'import { SkeletonRectangle } from '@/app/components/base/skeleton'+import { toast } from '@/app/notifications'import {agentComposerSkillsAtom,removeAgentSkillAtom,diff --git a/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/upload-dialog.tsx b/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/upload-dialog.tsxindex 57c2d092cf8..f093e726b65 100644--- a/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/upload-dialog.tsx+++ b/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/upload-dialog.tsx@@ -15,11 +15,11 @@ import {DialogTitle,} from '@langgenius/dify-ui/dialog'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation } from '@tanstack/react-query'import { useRef, useState } from 'react'import { Trans, useTranslation } from 'react-i18next'import { useFileSizeLimit } from '@/app/components/base/file-uploader/hooks'+import { toast } from '@/app/notifications'import Link from '@/next/link'import { consoleQuery } from '@/service/console'import { useFileUploadConfig } from '@/service/use-common'diff --git a/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/use-skill-detail.ts b/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/use-skill-detail.tsindex aafcbfdce4a..0494e84c759 100644--- a/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/use-skill-detail.ts+++ b/web/features/agent-v2/agent-detail/configure/components/orchestrate/skills/use-skill-detail.ts@@ -4,11 +4,11 @@ import type { AgentConfigSkillFileResponse } from '@dify/contracts/api/console/aimport type { AgentConfigApiContext } from '../config-context'import type { AgentSkillDetail, AgentSkillDetailDownloadAction } from './detail-dialog'import type { AgentFileNode, AgentSkill } from '@/features/agent-v2/agent-composer/form-state'-import { toast } from '@langgenius/dify-ui/toast'import { queryOptions, skipToken, useQuery, useQueryClient } from '@tanstack/react-query'import Cookies from 'js-cookie'import { useCallback, useMemo, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { API_PREFIX, CSRF_COOKIE_NAME, CSRF_HEADER_NAME } from '@/config'import { consoleQuery } from '@/service/console'import { downloadBlob } from '@/utils/download'diff --git a/web/features/agent-v2/agent-detail/configure/components/orchestrate/tools/cli-tool/__tests__/dialog.spec.tsx b/web/features/agent-v2/agent-detail/configure/components/orchestrate/tools/cli-tool/__tests__/dialog.spec.tsxindex 977e75e85eb..444c6a6a796 100644--- a/web/features/agent-v2/agent-detail/configure/components/orchestrate/tools/cli-tool/__tests__/dialog.spec.tsx+++ b/web/features/agent-v2/agent-detail/configure/components/orchestrate/tools/cli-tool/__tests__/dialog.spec.tsx@@ -1,10 +1,10 @@-import { toast } from '@langgenius/dify-ui/toast'import { fireEvent, render, screen } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { beforeEach, describe, expect, it, vi } from 'vite-plus/test'+import { toast } from '@/app/notifications'import { CliToolDialog } from '../dialog'-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: vi.fn(),},diff --git a/web/features/agent-v2/agent-detail/configure/components/orchestrate/tools/cli-tool/dialog.tsx b/web/features/agent-v2/agent-detail/configure/components/orchestrate/tools/cli-tool/dialog.tsxindex 189970bf1aa..0e3d996f52a 100644--- a/web/features/agent-v2/agent-detail/configure/components/orchestrate/tools/cli-tool/dialog.tsx+++ b/web/features/agent-v2/agent-detail/configure/components/orchestrate/tools/cli-tool/dialog.tsx@@ -16,9 +16,9 @@ import { Field, FieldDescription, FieldLabel } from '@langgenius/dify-ui/field'import { Form } from '@langgenius/dify-ui/form'import { IconButton } from '@langgenius/dify-ui/icon-button'import { Input } from '@langgenius/dify-ui/input'-import { toast } from '@langgenius/dify-ui/toast'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { useDocLink } from '@/context/i18n'import { EnvVariablesTable } from '../../advanced/env'diff --git a/web/features/agent-v2/agent-detail/configure/components/preview/__tests__/chat.spec.tsx b/web/features/agent-v2/agent-detail/configure/components/preview/__tests__/chat.spec.tsxindex 6c66bed2c6b..8ceb0c610ca 100644--- a/web/features/agent-v2/agent-detail/configure/components/preview/__tests__/chat.spec.tsx+++ b/web/features/agent-v2/agent-detail/configure/components/preview/__tests__/chat.spec.tsx@@ -4,13 +4,13 @@ import type { AgentChatRuntimeEmptyStateProps } from '../chat-runtime'import type { FileEntity } from '@/app/components/base/file-uploader/types'import type { SpeechToTextTarget } from '@/app/components/base/voice-input/types'import type { AgentSoulConfigFormState } from '@/features/agent-v2/agent-composer/form-state'-import { toast } from '@langgenius/dify-ui/toast'import { QueryClient, QueryClientProvider } from '@tanstack/react-query'import { act, fireEvent, screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { createStore, Provider as JotaiProvider } from 'jotai'import { createRef, useState } from 'react'import { SupportUploadFileTypes } from '@/app/components/workflow/types'+import { toast } from '@/app/notifications'import { agentComposerDraftAtom } from '@/features/agent-v2/agent-composer/store'import { agentComposerModelAtom } from '@/features/agent-v2/agent-composer/store-modules/model'import { agentComposerPromptAtom } from '@/features/agent-v2/agent-composer/store-modules/prompt'@@ -38,7 +38,7 @@ const mockConsoleState = vi.hoisted(() => ({deploymentEdition: 'COMMUNITY' as 'CLOUD' | 'COMMUNITY' | 'ENTERPRISE',}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: vi.fn(),},diff --git a/web/features/agent-v2/agent-detail/configure/components/preview/__tests__/working-directory-panel.spec.tsx b/web/features/agent-v2/agent-detail/configure/components/preview/__tests__/working-directory-panel.spec.tsxindex 8317302679c..915a9c68e6c 100644--- a/web/features/agent-v2/agent-detail/configure/components/preview/__tests__/working-directory-panel.spec.tsx+++ b/web/features/agent-v2/agent-detail/configure/components/preview/__tests__/working-directory-panel.spec.tsx@@ -1,9 +1,9 @@import type { AgentWorkingDirectorySource } from '../working-directory-panel'-import { toast } from '@langgenius/dify-ui/toast'import { QueryClient, QueryClientProvider } from '@tanstack/react-query'import { render, screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { beforeEach, describe, expect, it, vi } from 'vite-plus/test'+import { toast } from '@/app/notifications'import { AgentWorkingDirectoryPanel } from '../working-directory-panel'type QueryOptionsInput = {@@ -182,7 +182,7 @@ vi.mock('@/utils/download', () => ({downloadUrl: mocks.downloadUrl,}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {success: mocks.toastSuccess,},diff --git a/web/features/agent-v2/agent-detail/configure/components/preview/chat-conversation.tsx b/web/features/agent-v2/agent-detail/configure/components/preview/chat-conversation.tsxindex 189b632d72c..ad7ac25a2b7 100644--- a/web/features/agent-v2/agent-detail/configure/components/preview/chat-conversation.tsx+++ b/web/features/agent-v2/agent-detail/configure/components/preview/chat-conversation.tsx@@ -12,13 +12,13 @@ import type { AgentComposerModel } from '@/features/agent-v2/agent-composer/formimport type { Inputs } from '@/models/debug'import { Avatar } from '@langgenius/dify-ui/avatar'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { useQueryClient, useSuspenseQuery } from '@tanstack/react-query'import { useCallback, useImperativeHandle, useLayoutEffect, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import { AgentRosterResponseContent } from '@/app/components/base/chat/chat/answer/agent-roster-response-content'import { useChat } from '@/app/components/base/chat/chat/hooks'import { getLastAnswer, isValidGeneratedAnswer } from '@/app/components/base/chat/utils'+import { toast } from '@/app/notifications'import { useDocLink } from '@/context/i18n'import { userProfileQueryOptions } from '@/features/account-profile/client'import dynamic from '@/next/dynamic'diff --git a/web/features/agent-v2/agent-detail/configure/components/preview/working-directory-panel.tsx b/web/features/agent-v2/agent-detail/configure/components/preview/working-directory-panel.tsxindex 401f3f12392..49d2bc305ab 100644--- a/web/features/agent-v2/agent-detail/configure/components/preview/working-directory-panel.tsx+++ b/web/features/agent-v2/agent-detail/configure/components/preview/working-directory-panel.tsx@@ -13,11 +13,11 @@ import type {import type { AgentFileNode } from '@/features/agent-v2/agent-composer/form-state'import { Dialog } from '@langgenius/dify-ui/dialog'import { Tabs, TabsIndicator, TabsList, TabsPanel, TabsTab } from '@langgenius/dify-ui/tabs'-import { toast } from '@langgenius/dify-ui/toast'import { skipToken, useMutation, useQueries, useQuery } from '@tanstack/react-query'import { useCallback, useState } from 'react'import { useTranslation } from 'react-i18next'import { Infotip } from '@/app/components/base/infotip'+import { toast } from '@/app/notifications'import { consoleClient, consoleQuery } from '@/service/console'import { downloadUrl } from '@/utils/download'import { getFileIconType } from '../orchestrate/files/file-icon'diff --git a/web/features/agent-v2/agent-detail/configure/use-agent-configure-build-draft.ts b/web/features/agent-v2/agent-detail/configure/use-agent-configure-build-draft.tsindex 01a2d7596e9..4c09def0579 100644--- a/web/features/agent-v2/agent-detail/configure/use-agent-configure-build-draft.ts+++ b/web/features/agent-v2/agent-detail/configure/use-agent-configure-build-draft.ts@@ -11,11 +11,11 @@ import type {AgentFileNode,AgentSoulConfigFormState,} from '@/features/agent-v2/agent-composer/form-state'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'import isEqual from 'fast-deep-equal'import { useCallback, useEffect, useMemo, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { agentSoulConfigToFormState } from '@/features/agent-v2/agent-composer/conversions'import { consoleQuery } from '@/service/console'import { usePrepareAgentBuildDraftBeforeRun } from './use-agent-build-draft-run'diff --git a/web/features/agent-v2/agent-detail/configure/use-agent-configure-sync.ts b/web/features/agent-v2/agent-detail/configure/use-agent-configure-sync.tsindex f2098c18718..11706d36f65 100644--- a/web/features/agent-v2/agent-detail/configure/use-agent-configure-sync.ts+++ b/web/features/agent-v2/agent-detail/configure/use-agent-configure-sync.ts@@ -3,7 +3,6 @@import type { AgentSoulConfig } from '@dify/contracts/api/console/agent/types.gen'import type { DefaultModel } from '@/app/components/header/account-setting/model-provider-page/declarations'import type { AgentSoulConfigFormState } from '@/features/agent-v2/agent-composer/form-state'-import { toast } from '@langgenius/dify-ui/toast'import { mutationOptions, useMutation, useQueryClient } from '@tanstack/react-query'import { debounce } from 'es-toolkit/compat'import isEqual from 'fast-deep-equal'@@ -12,6 +11,7 @@ import { useCallback, useEffect, useMemo, useRef } from 'react'import { useTranslation } from 'react-i18next'import { trackEvent } from '@/app/components/base/amplitude'import { useSerialAsyncCallback } from '@/app/components/workflow/hooks/use-serial-async-callback'+import { toast } from '@/app/notifications'import { getAgentACLCapabilities } from '@/features/agent-v2/acl'import { formStateToAgentSoulConfig } from '@/features/agent-v2/agent-composer/conversions'import {diff --git a/web/features/agent-v2/agent-detail/logs/__tests__/log-detail-panel.spec.tsx b/web/features/agent-v2/agent-detail/logs/__tests__/log-detail-panel.spec.tsxindex d620e5026c3..cdef32279b3 100644--- a/web/features/agent-v2/agent-detail/logs/__tests__/log-detail-panel.spec.tsx+++ b/web/features/agent-v2/agent-detail/logs/__tests__/log-detail-panel.spec.tsx@@ -39,7 +39,7 @@ vi.mock('@/app/components/base/chat/chat', () => ({},}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: mocks.toastError,success: mocks.toastSuccess,diff --git a/web/features/agent-v2/agent-detail/logs/components/log-detail-panel.tsx b/web/features/agent-v2/agent-detail/logs/components/log-detail-panel.tsxindex f3158fc49eb..4041a413a55 100644--- a/web/features/agent-v2/agent-detail/logs/components/log-detail-panel.tsx+++ b/web/features/agent-v2/agent-detail/logs/components/log-detail-panel.tsx@@ -5,13 +5,13 @@ import type {import type { IChatItem } from '@/app/components/base/chat/chat/type'import type { ChatConfig, OnFeedback } from '@/app/components/base/chat/types'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'import { skipToken, useMutation, useQuery, useQueryClient } from '@tanstack/react-query'import { useTranslation } from 'react-i18next'import Chat from '@/app/components/base/chat/chat'import CopyIcon from '@/app/components/base/copy-icon'import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder'+import { toast } from '@/app/notifications'import useTimestamp from '@/hooks/use-timestamp'import { consoleQuery } from '@/service/console'diff --git a/web/features/agent-v2/agent-detail/sidebar-actions.tsx b/web/features/agent-v2/agent-detail/sidebar-actions.tsxindex c4d4ea4db98..41a5db6448d 100644--- a/web/features/agent-v2/agent-detail/sidebar-actions.tsx+++ b/web/features/agent-v2/agent-detail/sidebar-actions.tsx@@ -10,10 +10,10 @@ import {DropdownMenuTrigger,} from '@langgenius/dify-ui/dropdown-menu'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'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 { useCanCreateAgents } from '@/features/agent-v2/permissions'import { DeleteAgentDialog } from '@/features/agent-v2/roster/components/delete-agent-dialog'diff --git a/web/features/agent-v2/roster/components/__tests__/agent-roster-list.spec.tsx b/web/features/agent-v2/roster/components/__tests__/agent-roster-list.spec.tsxindex 568929e7f29..fe86aae536c 100644--- a/web/features/agent-v2/roster/components/__tests__/agent-roster-list.spec.tsx+++ b/web/features/agent-v2/roster/components/__tests__/agent-roster-list.spec.tsx@@ -1,9 +1,9 @@import type { AgentAppPartial } from '@dify/contracts/api/console/agent/types.gen'import type { AgentRosterListState } from '../agent-roster-list'-import { toast } from '@langgenius/dify-ui/toast'import { QueryClient, QueryClientProvider } from '@tanstack/react-query'import { render, screen, waitFor, within } from '@testing-library/react'import userEvent from '@testing-library/user-event'+import { toast } from '@/app/notifications'import { AgentPermission } from '@/features/agent-v2/acl'import { AgentRosterList } from '../agent-roster-list'diff --git a/web/features/agent-v2/roster/components/__tests__/create-agent-dialog.spec.tsx b/web/features/agent-v2/roster/components/__tests__/create-agent-dialog.spec.tsxindex 379c4b5c07c..01d2655ef45 100644--- a/web/features/agent-v2/roster/components/__tests__/create-agent-dialog.spec.tsx+++ b/web/features/agent-v2/roster/components/__tests__/create-agent-dialog.spec.tsx@@ -24,7 +24,7 @@ vi.mock('@tanstack/react-query', () => ({}),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: toastMock,}))diff --git a/web/features/agent-v2/roster/components/__tests__/edit-agent-dialog.spec.tsx b/web/features/agent-v2/roster/components/__tests__/edit-agent-dialog.spec.tsxindex c6995c1e539..5de6fa9044a 100644--- a/web/features/agent-v2/roster/components/__tests__/edit-agent-dialog.spec.tsx+++ b/web/features/agent-v2/roster/components/__tests__/edit-agent-dialog.spec.tsx@@ -20,7 +20,7 @@ vi.mock('@tanstack/react-query', () => ({}),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: toastMock,}))diff --git a/web/features/agent-v2/roster/components/agent-roster-list.tsx b/web/features/agent-v2/roster/components/agent-roster-list.tsxindex 77ff2d6371b..a16a4a1936b 100644--- a/web/features/agent-v2/roster/components/agent-roster-list.tsx+++ b/web/features/agent-v2/roster/components/agent-roster-list.tsx@@ -19,13 +19,13 @@ import {DropdownMenuTrigger,} from '@langgenius/dify-ui/dropdown-menu'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { useId, useState } from 'react'import { useTranslation } from 'react-i18next'import { useExportAppDsl } from '@/app/components/app/use-export-app-dsl'import AppIcon from '@/app/components/base/app-icon'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 { useCanCreateAgents } from '@/features/agent-v2/permissions'import useTimestamp from '@/hooks/use-timestamp'diff --git a/web/features/agent-v2/roster/components/delete-agent-dialog.tsx b/web/features/agent-v2/roster/components/delete-agent-dialog.tsxindex 0d48d3c2fee..2dc67992da9 100644--- a/web/features/agent-v2/roster/components/delete-agent-dialog.tsx+++ b/web/features/agent-v2/roster/components/delete-agent-dialog.tsx@@ -9,9 +9,9 @@ import {AlertDialogDescription,AlertDialogTitle,} from '@langgenius/dify-ui/alert-dialog'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation } from '@tanstack/react-query'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { consoleQuery } from '@/service/console'type DeleteAgentDialogProps = {diff --git a/web/features/agent-v2/roster/components/duplicate-agent-dialog.tsx b/web/features/agent-v2/roster/components/duplicate-agent-dialog.tsxindex 5da78c8b859..53d9469068b 100644--- a/web/features/agent-v2/roster/components/duplicate-agent-dialog.tsx+++ b/web/features/agent-v2/roster/components/duplicate-agent-dialog.tsx@@ -12,11 +12,11 @@ import {} from '@langgenius/dify-ui/dialog'import { Form } from '@langgenius/dify-ui/form'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useQueryClient } from '@tanstack/react-query'import { useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import AppIconPicker from '@/app/components/base/app-icon-picker'+import { toast } from '@/app/notifications'import { consoleQuery } from '@/service/console'import { createAgentIconSelection } from './agent-form'import { AgentFormFields } from './agent-form-fields'diff --git a/web/features/home/continue-work/__tests__/item.spec.tsx b/web/features/home/continue-work/__tests__/item.spec.tsxindex 8bb5c886e1a..0e1f4dab7bc 100644--- a/web/features/home/continue-work/__tests__/item.spec.tsx+++ b/web/features/home/continue-work/__tests__/item.spec.tsx@@ -28,7 +28,7 @@ vi.mock('@/hooks/use-format-time-from-now', () => ({}),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {warning: toastMocks.warning,},diff --git a/web/features/home/continue-work/item.tsx b/web/features/home/continue-work/item.tsxindex 9b1d2bbdf77..2f5167ec18a 100644--- a/web/features/home/continue-work/item.tsx+++ b/web/features/home/continue-work/item.tsx@@ -2,13 +2,13 @@import type { RecentAppResponse } from '@dify/contracts/api/console/apps/types.gen'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { useSuspenseQuery } from '@tanstack/react-query'import { useAtomValue } from 'jotai'import { useId, useState } from 'react'import { useTranslation } from 'react-i18next'import { AppTypeIcon } from '@/app/components/app/type-selector'import AppIcon from '@/app/components/base/app-icon'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { userProfileQueryOptions } from '@/features/account-profile/client'import { systemFeaturesQueryOptions } from '@/features/system-features/client'diff --git a/web/features/home/home-content/__tests__/home-content.spec.tsx b/web/features/home/home-content/__tests__/home-content.spec.tsxindex 130e7bb3908..ed6f4d83801 100644--- a/web/features/home/home-content/__tests__/home-content.spec.tsx+++ b/web/features/home/home-content/__tests__/home-content.spec.tsx@@ -203,7 +203,7 @@ const toastMocks = vi.hoisted(() => {return { record, api }})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: toastMocks.api,}))diff --git a/web/features/new-rag/__tests__/add-source-page.spec.tsx b/web/features/new-rag/__tests__/add-source-page.spec.tsxindex c8954647001..25997282586 100644--- a/web/features/new-rag/__tests__/add-source-page.spec.tsx+++ b/web/features/new-rag/__tests__/add-source-page.spec.tsx@@ -18,7 +18,7 @@ vi.mock('@/next/navigation', () => ({ useRouter: () => routerMock }))const toastInfoMock = vi.hoisted(() => vi.fn())-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: { info: toastInfoMock },}))diff --git a/web/features/new-rag/__tests__/document-detail-page.spec.tsx b/web/features/new-rag/__tests__/document-detail-page.spec.tsxindex 6c402bdee50..030d1d2605e 100644--- a/web/features/new-rag/__tests__/document-detail-page.spec.tsx+++ b/web/features/new-rag/__tests__/document-detail-page.spec.tsx@@ -176,7 +176,7 @@ vi.mock('@/context/permission-state', () => ({refreshWorkspacePermissionKeysAfterMutationDenialAtom: permissionState.refreshAtom,}))-vi.mock('@langgenius/dify-ui/toast', () => ({ toast: toastState }))+vi.mock('@/app/notifications', () => ({ toast: toastState }))vi.mock('copy-to-clipboard', () => ({ default: vi.fn(() => true) }))vi.mock('@tanstack/react-virtual', () => ({diff --git a/web/features/new-rag/__tests__/documents-page.spec.tsx b/web/features/new-rag/__tests__/documents-page.spec.tsxindex 0c2c1b5d7eb..9993d15c294 100644--- a/web/features/new-rag/__tests__/documents-page.spec.tsx+++ b/web/features/new-rag/__tests__/documents-page.spec.tsx@@ -143,7 +143,7 @@ vi.mock('jotai', async (importOriginal) => {}})-vi.mock('@langgenius/dify-ui/toast', () => ({ toast: toastMock }))+vi.mock('@/app/notifications', () => ({ toast: toastMock }))const documentsInfiniteOptions = vi.hoisted(() =>vi.fn((options: Omit<InfiniteOptions, 'queryKind'>) => ({ ...options, queryKind: 'documents' })),diff --git a/web/features/new-rag/__tests__/new-knowledge-list.spec.tsx b/web/features/new-rag/__tests__/new-knowledge-list.spec.tsxindex fff892f4d76..84433110d43 100644--- a/web/features/new-rag/__tests__/new-knowledge-list.spec.tsx+++ b/web/features/new-rag/__tests__/new-knowledge-list.spec.tsx@@ -18,7 +18,7 @@ type ListKnowledgeSpacesInfiniteOptions = {const toastInfoMock = vi.hoisted(() => vi.fn())-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: { info: toastInfoMock },}))diff --git a/web/features/new-rag/__tests__/sources-page.spec.tsx b/web/features/new-rag/__tests__/sources-page.spec.tsxindex cd31c3a7d0f..dfaca911eda 100644--- a/web/features/new-rag/__tests__/sources-page.spec.tsx+++ b/web/features/new-rag/__tests__/sources-page.spec.tsx@@ -11,7 +11,7 @@ const permissionState = vi.hoisted(() => ({workspacePermissionKeys: ['dataset.acl.edit', 'dataset.external.connect'],}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: { error: toastErrorMock, info: toastInfoMock },}))diff --git a/web/features/new-rag/create-knowledge-page.tsx b/web/features/new-rag/create-knowledge-page.tsxindex 758d74253a0..17062ce875d 100644--- a/web/features/new-rag/create-knowledge-page.tsx+++ b/web/features/new-rag/create-knowledge-page.tsx@@ -27,11 +27,11 @@ import {SelectTrigger,} from '@langgenius/dify-ui/select'import { Textarea } from '@langgenius/dify-ui/textarea'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useQueryClient } from '@tanstack/react-query'import { useAtomValue } from 'jotai'import { useCallback, useEffect, useId, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import useDocumentTitle from '@/hooks/use-document-title'import { useRouter, useSearchParams } from '@/next/navigation'diff --git a/web/features/new-rag/document-chunk-detail.tsx b/web/features/new-rag/document-chunk-detail.tsxindex eca7f5214b2..c1ba713e1e4 100644--- a/web/features/new-rag/document-chunk-detail.tsx+++ b/web/features/new-rag/document-chunk-detail.tsx@@ -4,10 +4,10 @@ import type {LogicalDocumentRevision,} from '@dify/contracts/knowledge-fs/types.gen'import { Button } from '@langgenius/dify-ui/button'-import { toast } from '@langgenius/dify-ui/toast'import copy from 'copy-to-clipboard'import { useEffect, useMemo } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import {chunkCharacterCount,chunkContentParts,diff --git a/web/features/new-rag/document-list.tsx b/web/features/new-rag/document-list.tsxindex 2a578d5a04f..e6b72e7edda 100644--- a/web/features/new-rag/document-list.tsx+++ b/web/features/new-rag/document-list.tsx@@ -13,10 +13,10 @@ import {DropdownMenuSeparator,DropdownMenuTrigger,} from '@langgenius/dify-ui/dropdown-menu'-import { toast } from '@langgenius/dify-ui/toast'import { memo, useEffect, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder'+import { toast } from '@/app/notifications'import { useFormatTimeFromNow } from '@/hooks/use-format-time-from-now'import Link from '@/next/link'import { sourceName } from './document-model'diff --git a/web/features/new-rag/documents-page.tsx b/web/features/new-rag/documents-page.tsxindex b31c777593f..bc5933eefd4 100644--- a/web/features/new-rag/documents-page.tsx+++ b/web/features/new-rag/documents-page.tsx@@ -7,13 +7,13 @@ import type {} from './services/processing-task-events'import { Button } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { useInfiniteQuery, useMutation, useQueryClient } from '@tanstack/react-query'import { useAtomValue, useSetAtom } from 'jotai'import { debounce, parseAsString, parseAsStringLiteral, useQueryState } from 'nuqs'import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder'+import { toast } from '@/app/notifications'import {datasetDefaultPermissionKeysAtom,refreshWorkspacePermissionKeysAfterMutationDenialAtom,diff --git a/web/features/new-rag/knowledge-space-shell.tsx b/web/features/new-rag/knowledge-space-shell.tsxindex 7d6b3a20b1b..9ab62898a3d 100644--- a/web/features/new-rag/knowledge-space-shell.tsx+++ b/web/features/new-rag/knowledge-space-shell.tsx@@ -3,10 +3,10 @@import type { ReactNode } from 'react'import { Button, buttonVariants } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { useQuery } from '@tanstack/react-query'import { useTranslation } from 'react-i18next'import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder'+import { toast } from '@/app/notifications'import useDocumentTitle from '@/hooks/use-document-title'import Link from '@/next/link'import { usePathname } from '@/next/navigation'diff --git a/web/features/new-rag/new-knowledge-list.tsx b/web/features/new-rag/new-knowledge-list.tsxindex 189c920f2b5..549238700c5 100644--- a/web/features/new-rag/new-knowledge-list.tsx+++ b/web/features/new-rag/new-knowledge-list.tsx@@ -1,7 +1,6 @@'use client'import { Button, buttonVariants } from '@langgenius/dify-ui/button'-import { toast } from '@langgenius/dify-ui/toast'import { useInfiniteQuery } from '@tanstack/react-query'import { useAtomValue } from 'jotai'import { useState } from 'react'@@ -9,6 +8,7 @@ import { useTranslation } from 'react-i18next'import { SearchInput } from '@/app/components/base/search-input'import ExternalAPIPanel from '@/app/components/datasets/external-api/external-api-panel'import { ServiceApi } from '@/app/components/datasets/extra-info/service-api'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import Link from '@/next/link'import { consoleQuery } from '@/service/console'diff --git a/web/features/new-rag/sources-page.tsx b/web/features/new-rag/sources-page.tsxindex fcb7d9224b9..60fcdc4c2d7 100644--- a/web/features/new-rag/sources-page.tsx+++ b/web/features/new-rag/sources-page.tsx@@ -23,12 +23,12 @@ import {DropdownMenuTrigger,} from '@langgenius/dify-ui/dropdown-menu'import { StatusDot } from '@langgenius/dify-ui/status-dot'-import { toast } from '@langgenius/dify-ui/toast'import { useInfiniteQuery, useQueryClient } from '@tanstack/react-query'import { useAtomValue } from 'jotai'import { useEffect, useMemo, useState } from 'react'import { useTranslation } from 'react-i18next'import { LoadingPlaceholder } from '@/app/components/base/loading-placeholder'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import Link from '@/next/link'import { consoleClient, consoleQuery } from '@/service/console'diff --git a/web/features/new-rag/use-document-reindex.ts b/web/features/new-rag/use-document-reindex.tsindex a4f7a7bd87f..5b9a8f3d611 100644--- a/web/features/new-rag/use-document-reindex.ts+++ b/web/features/new-rag/use-document-reindex.ts@@ -1,10 +1,10 @@'use client'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useQueryClient } from '@tanstack/react-query'import { useSetAtom } from 'jotai'import { useEffect, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { refreshWorkspacePermissionKeysAfterMutationDenialAtom } from '@/context/permission-state'import { consoleQuery } from '@/service/console'import { DatasetACLPermission, hasPermission } from '@/utils/permission'diff --git a/web/features/skills/__tests__/detail-page.fixture.tsx b/web/features/skills/__tests__/detail-page.fixture.tsxindex 595c1959233..a845467feda 100644--- a/web/features/skills/__tests__/detail-page.fixture.tsx+++ b/web/features/skills/__tests__/detail-page.fixture.tsx@@ -60,7 +60,7 @@ const mocks = vi.hoisted(() => ({versionPatchMutationFn: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: mocks.toastError,info: mocks.toastInfo,diff --git a/web/features/skills/__tests__/page.spec.tsx b/web/features/skills/__tests__/page.spec.tsxindex 16e581165a2..b935abe32a9 100644--- a/web/features/skills/__tests__/page.spec.tsx+++ b/web/features/skills/__tests__/page.spec.tsx@@ -5,11 +5,11 @@ import type {SkillTagResponse,} from '@dify/contracts/api/console/workspaces/types.gen'import type { ReactNode } from 'react'-import { toast } from '@langgenius/dify-ui/toast'import { QueryClient, QueryClientProvider } from '@tanstack/react-query'import { fireEvent, render, screen, waitFor, within } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { beforeEach, describe, expect, it, vi } from 'vite-plus/test'+import { toast } from '@/app/notifications'import SkillsPage from '../page'type SkillsInfiniteOptions = {@@ -45,7 +45,7 @@ const mocks = vi.hoisted(() => ({tagsQueryOptions: vi.fn((_options: unknown) => ({})),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: vi.fn(),success: vi.fn(),diff --git a/web/features/skills/detail/builder-panel.tsx b/web/features/skills/detail/builder-panel.tsxindex 443189102fd..7d0f066aaa0 100644--- a/web/features/skills/detail/builder-panel.tsx+++ b/web/features/skills/detail/builder-panel.tsx@@ -8,7 +8,6 @@ import type { BuilderChatMessage, SkillBuilderAttachment, SkillBuilderModel } frimport type { FormValue } from '@/app/components/header/account-setting/model-provider-page/declarations'import { Button } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { useQuery, useQueryClient } from '@tanstack/react-query'import { useEffect, useId, useMemo, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'@@ -20,6 +19,7 @@ import {import { useDefaultModel } from '@/app/components/header/account-setting/model-provider-page/hooks'import ModelParameterModal from '@/app/components/header/account-setting/model-provider-page/model-parameter-modal'import { ModelSelector } from '@/app/components/header/account-setting/model-provider-page/model-selector'+import { toast } from '@/app/notifications'import { consoleQuery } from '@/service/console'import { sendSkillAssistMessage, uploadSkillFile } from '../client'import { SkillBuilderGridTexture } from './builder-grid-texture'diff --git a/web/features/skills/detail/file-editor.tsx b/web/features/skills/detail/file-editor.tsxindex fbe752440c4..38170101705 100644--- a/web/features/skills/detail/file-editor.tsx+++ b/web/features/skills/detail/file-editor.tsx@@ -9,13 +9,13 @@ import type { ChangeEvent, FormEvent, KeyboardEvent } from 'react'import type { SkillFileMutationCoordinator } from './shared'import { Button } from '@langgenius/dify-ui/button'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'import { noop } from 'es-toolkit/function'import { useCallback, useEffect, useMemo, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import { SkeletonRectangle } from '@/app/components/base/skeleton'import CodeEditor from '@/app/components/workflow/nodes/_base/components/editor/code-editor'+import { toast } from '@/app/notifications'import { useFormatTimeFromNow } from '@/hooks/use-format-time-from-now'import dynamic from '@/next/dynamic'import { consoleQuery } from '@/service/console'diff --git a/web/features/skills/detail/file-tree.tsx b/web/features/skills/detail/file-tree.tsxindex 7c546f15e7a..39beea3b2de 100644--- a/web/features/skills/detail/file-tree.tsx+++ b/web/features/skills/detail/file-tree.tsx@@ -50,7 +50,6 @@ import {ScrollAreaThumb,ScrollAreaViewport,} from '@langgenius/dify-ui/scroll-area'-import { toast } from '@langgenius/dify-ui/toast'import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'import { formatForDisplay, matchesKeyboardEvent, useHotkey } from '@tanstack/react-hotkeys'import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'@@ -63,6 +62,7 @@ import { gotoAnythingDialogHandle } from '@/app/components/goto-anything/dialog-import { GOTO_ANYTHING_HOTKEY } from '@/app/components/goto-anything/hotkeys'import AccountSection from '@/app/components/main-nav/components/account-section'import HelpMenu from '@/app/components/main-nav/components/help-menu'+import { toast } from '@/app/notifications'import Link from '@/next/link'import { consoleQuery } from '@/service/console'import { fetchSkillFileBlob, uploadSkillFile } from '../client'diff --git a/web/features/skills/detail/page.tsx b/web/features/skills/detail/page.tsxindex 1b918b5727a..5b9af3506b1 100644--- a/web/features/skills/detail/page.tsx+++ b/web/features/skills/detail/page.tsx@@ -10,10 +10,10 @@ import {AlertDialogDescription,AlertDialogTitle,} from '@langgenius/dify-ui/alert-dialog'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'import { useCallback, useEffect, useMemo, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import useDocumentTitle from '@/hooks/use-document-title'import Link from '@/next/link'import { consoleQuery } from '@/service/console'diff --git a/web/features/skills/detail/shared.tsx b/web/features/skills/detail/shared.tsxindex 2afa1dd2933..e740e8d084a 100644--- a/web/features/skills/detail/shared.tsx+++ b/web/features/skills/detail/shared.tsx@@ -12,8 +12,8 @@ import type {FormValue,} from '@/app/components/header/account-setting/model-provider-page/declarations'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { CodeLanguage } from '@/app/components/workflow/nodes/code/types'+import { toast } from '@/app/notifications'import { getFileIconType } from '@/features/agent-v2/agent-detail/configure/components/orchestrate/files/file-icon'import { consoleClient, consoleQuery } from '@/service/console'import {diff --git a/web/features/skills/detail/sidebar-actions.tsx b/web/features/skills/detail/sidebar-actions.tsxindex 611bad6c07c..191dc923d62 100644--- a/web/features/skills/detail/sidebar-actions.tsx+++ b/web/features/skills/detail/sidebar-actions.tsx@@ -19,10 +19,10 @@ import {} from '@langgenius/dify-ui/dropdown-menu'import { Field, FieldLabel } from '@langgenius/dify-ui/field'import { InputGroup, InputGroupAddon, InputGroupInput } from '@langgenius/dify-ui/input-group'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'import { useState } from 'react'import { Trans, useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { useRouter } from '@/next/navigation'import { consoleQuery } from '@/service/console'import { downloadBlob } from '@/utils/download'diff --git a/web/features/skills/detail/skill-display-name-editor.tsx b/web/features/skills/detail/skill-display-name-editor.tsxindex d7c519e6139..54a38a1f519 100644--- a/web/features/skills/detail/skill-display-name-editor.tsx+++ b/web/features/skills/detail/skill-display-name-editor.tsx@@ -2,10 +2,10 @@import type { SkillDetailResponse } from '@dify/contracts/api/console/workspaces/types.gen'import type { SkillFileMutationCoordinator } from './shared'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useQueryClient } from '@tanstack/react-query'import { useLayoutEffect, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { consoleQuery } from '@/service/console'import {getAsyncSkillErrorPayload,diff --git a/web/features/skills/detail/skill-metadata.tsx b/web/features/skills/detail/skill-metadata.tsxindex 461d7e895a2..529605cc946 100644--- a/web/features/skills/detail/skill-metadata.tsx+++ b/web/features/skills/detail/skill-metadata.tsx@@ -17,12 +17,12 @@ import {ComboboxTrigger,createComboboxItems,} from '@langgenius/dify-ui/combobox'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'import { useMemo, useState } from 'react'import { useTranslation } from 'react-i18next'import AppIcon from '@/app/components/base/app-icon'import { SkeletonRectangle } from '@/app/components/base/skeleton'+import { toast } from '@/app/notifications'import { isCreateTagOption } from '@/features/tag-management/components/tag-combobox-item'import { TagManagementModal } from '@/features/tag-management/components/tag-management-modal'import { TagSearchContentView } from '@/features/tag-management/components/tag-search-content'diff --git a/web/features/skills/detail/version-panel.tsx b/web/features/skills/detail/version-panel.tsxindex 207733753d6..c63badf2104 100644--- a/web/features/skills/detail/version-panel.tsx+++ b/web/features/skills/detail/version-panel.tsx@@ -31,10 +31,10 @@ import { IconButton } from '@langgenius/dify-ui/icon-button'import { Input } from '@langgenius/dify-ui/input'import { Popover, PopoverContent, PopoverTrigger } from '@langgenius/dify-ui/popover'import { Textarea } from '@langgenius/dify-ui/textarea'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useQueryClient } from '@tanstack/react-query'import { useId, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import useTimestamp from '@/hooks/use-timestamp'import { consoleQuery } from '@/service/console'import { getSkillVersionTitle, invalidateSkillDetail } from './shared'diff --git a/web/features/skills/page.tsx b/web/features/skills/page.tsxindex 1e256f976e4..2f6816b4dd6 100644--- a/web/features/skills/page.tsx+++ b/web/features/skills/page.tsx@@ -31,7 +31,6 @@ import {ScrollAreaThumb,ScrollAreaViewport,} from '@langgenius/dify-ui/scroll-area'-import { toast } from '@langgenius/dify-ui/toast'import { useInfiniteQuery, useMutation, useQuery, useQueryClient } from '@tanstack/react-query'import { useDebounce } from 'ahooks'import { useQueryState } from 'nuqs'@@ -40,6 +39,7 @@ import { Trans, useTranslation } from 'react-i18next'import { SearchInput } from '@/app/components/base/search-input'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 { SkillCardTags } from '@/features/tag-management/components/skill-card-tags'import { TagFilter } from '@/features/tag-management/components/tag-filter'import useDocumentTitle from '@/hooks/use-document-title'diff --git a/web/features/tag-management/__tests__/tag-item-editor.spec.tsx b/web/features/tag-management/__tests__/tag-item-editor.spec.tsxindex 4efdf35ff99..c40536c7634 100644--- a/web/features/tag-management/__tests__/tag-item-editor.spec.tsx+++ b/web/features/tag-management/__tests__/tag-item-editor.spec.tsx@@ -70,7 +70,7 @@ vi.mock('@/service/console', () => ({},}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: tagMocks.api,}))diff --git a/web/features/tag-management/__tests__/tag-management-modal.spec.tsx b/web/features/tag-management/__tests__/tag-management-modal.spec.tsxindex 5bd1f6fdb32..42d41572a5e 100644--- a/web/features/tag-management/__tests__/tag-management-modal.spec.tsx+++ b/web/features/tag-management/__tests__/tag-management-modal.spec.tsx@@ -20,7 +20,7 @@ const { mockNotify, mockToast } = vi.hoisted(() => {return { mockNotify, mockToast }})-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: mockToast,}))diff --git a/web/features/tag-management/__tests__/tag-selector.spec.tsx b/web/features/tag-management/__tests__/tag-selector.spec.tsxindex 653fae669ec..65cb82ae6e5 100644--- a/web/features/tag-management/__tests__/tag-selector.spec.tsx+++ b/web/features/tag-management/__tests__/tag-selector.spec.tsx@@ -19,7 +19,7 @@ const { mockToast } = vi.hoisted(() => {return { mockToast }})-vi.mock('@langgenius/dify-ui/toast', () => ({ toast: mockToast }))+vi.mock('@/app/notifications', () => ({ toast: mockToast }))const { mockUseQueryData, createTag, bindTag, unBindTag } = vi.hoisted(() => {const mockUseQueryData: { current: Tag[] } = { current: [] }diff --git a/web/features/tag-management/components/tag-item-editor.tsx b/web/features/tag-management/components/tag-item-editor.tsxindex 434ea325e68..ca531e69d25 100644--- a/web/features/tag-management/components/tag-item-editor.tsx+++ b/web/features/tag-management/components/tag-item-editor.tsx@@ -9,12 +9,12 @@ import {AlertDialogTitle,} from '@langgenius/dify-ui/alert-dialog'import { cn } from '@langgenius/dify-ui/cn'-import { toast } from '@langgenius/dify-ui/toast'import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'import { useMutation } from '@tanstack/react-query'import { useDebounceFn } from 'ahooks'import { useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { consoleQuery } from '@/service/console'type TagItemEditorProps = {diff --git a/web/features/tag-management/components/tag-management-modal.tsx b/web/features/tag-management/components/tag-management-modal.tsxindex 8b81e18d178..8e6eb9434ec 100644--- a/web/features/tag-management/components/tag-management-modal.tsx+++ b/web/features/tag-management/components/tag-management-modal.tsx@@ -2,11 +2,11 @@import type { TagType } from '@dify/contracts/api/console/tags/types.gen'import { Dialog, DialogClose, DialogContent } from '@langgenius/dify-ui/dialog'import { IconButton } from '@langgenius/dify-ui/icon-button'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useQuery } from '@tanstack/react-query'import { useAtomValue } from 'jotai'import { useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { consoleQuery } from '@/service/console'import { hasPermission } from '@/utils/permission'diff --git a/web/features/tag-management/components/tag-selector.tsx b/web/features/tag-management/components/tag-selector.tsxindex 77719877b6d..35859accf66 100644--- a/web/features/tag-management/components/tag-selector.tsx+++ b/web/features/tag-management/components/tag-selector.tsx@@ -10,11 +10,11 @@ import {ComboboxTrigger,createComboboxItems,} from '@langgenius/dify-ui/combobox'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useQuery } from '@tanstack/react-query'import { useAtomValue } from 'jotai'import { useCallback, useMemo, useState } from 'react'import { useTranslation } from 'react-i18next'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { consoleQuery } from '@/service/console'import { hasPermission } from '@/utils/permission'diff --git a/web/hooks/use-import-dsl.spec.tsx b/web/hooks/use-import-dsl.spec.tsxindex 65b0a141f15..d82a98aa12d 100644--- a/web/hooks/use-import-dsl.spec.tsx+++ b/web/hooks/use-import-dsl.spec.tsx@@ -16,7 +16,7 @@ const toastMocks = vi.hoisted(() => ({warning: vi.fn(),}))-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: toastMocks,}))diff --git a/web/hooks/use-import-dsl.ts b/web/hooks/use-import-dsl.tsindex b7b05c8edae..b137dc6c554 100644--- a/web/hooks/use-import-dsl.ts+++ b/web/hooks/use-import-dsl.ts@@ -1,12 +1,12 @@import type { AppImportPayload, Import } from '@dify/contracts/api/console/apps/types.gen'import type { AppIconType } from '@/types/app'-import { toast } from '@langgenius/dify-ui/toast'import { useMutation, useSuspenseQuery } from '@tanstack/react-query'import { useAtomValue } from 'jotai'import { createElement, useCallback, useRef, useState } from 'react'import { useTranslation } from 'react-i18next'import DSLImportWarningDescription from '@/app/components/app/create-from-dsl-modal/dsl-import-warning-description'import { usePluginDependencies } from '@/app/components/workflow/plugin-dependency/hooks'+import { toast } from '@/app/notifications'import { workspacePermissionKeysAtom } from '@/context/permission-state'import { userProfileQueryOptions } from '@/features/account-profile/client'import { systemFeaturesQueryOptions } from '@/features/system-features/client'diff --git a/web/i18n/locales/ar-TN/common.json b/web/i18n/locales/ar-TN/common.jsonindex 2b1f439734d..b32a43550c9 100644--- a/web/i18n/locales/ar-TN/common.json+++ b/web/i18n/locales/ar-TN/common.json@@ -450,6 +450,8 @@"operation.confirmAction": "يرجى تأكيد الإجراء الخاص بك.","operation.copied": "تم النسخ","operation.copy": "نسخ",+ "operation.copyErrorDetails": "نسخ تفاصيل الخطأ",+ "operation.copyErrorFailed": "فشل النسخ. أعد المحاولة","operation.copyImage": "نسخ الصورة","operation.create": "إنشاء","operation.deSelectAll": "إلغاء تحديد الكل",diff --git a/web/i18n/locales/az-AZ/common.json b/web/i18n/locales/az-AZ/common.jsonindex ffb361bed99..8bd7f8d9f0b 100644--- a/web/i18n/locales/az-AZ/common.json+++ b/web/i18n/locales/az-AZ/common.json@@ -449,6 +449,8 @@"operation.confirmAction": "Əməliyyatını təsdiqlə.","operation.copied": "Kopyalandı","operation.copy": "Kopyala",+ "operation.copyErrorDetails": "Xəta təfərrüatlarını kopyala",+ "operation.copyErrorFailed": "Kopyalama alınmadı. Yenidən cəhd et","operation.copyImage": "Şəkli kopyala","operation.create": "Yarat","operation.deSelectAll": "Bütün seçimləri ləğv et",diff --git a/web/i18n/locales/de-DE/common.json b/web/i18n/locales/de-DE/common.jsonindex 58cb17c3ea0..dd7e08e858b 100644--- a/web/i18n/locales/de-DE/common.json+++ b/web/i18n/locales/de-DE/common.json@@ -450,6 +450,8 @@"operation.confirmAction": "Bitte bestätigen Sie Ihre Aktion.","operation.copied": "Kopiert","operation.copy": "Kopieren",+ "operation.copyErrorDetails": "Fehlerdetails kopieren",+ "operation.copyErrorFailed": "Kopieren fehlgeschlagen. Erneut versuchen","operation.copyImage": "Bild kopieren","operation.create": "Erstellen","operation.deSelectAll": "Alle abwählen",diff --git a/web/i18n/locales/en-US/common.json b/web/i18n/locales/en-US/common.jsonindex 7179f8078af..a79bf6625f8 100644--- a/web/i18n/locales/en-US/common.json+++ b/web/i18n/locales/en-US/common.json@@ -450,6 +450,8 @@"operation.confirmAction": "Please confirm your action.","operation.copied": "Copied","operation.copy": "Copy",+ "operation.copyErrorDetails": "Copy error details",+ "operation.copyErrorFailed": "Copy failed. Retry","operation.copyImage": "Copy Image","operation.create": "Create","operation.deSelectAll": "Deselect All",diff --git a/web/i18n/locales/es-ES/common.json b/web/i18n/locales/es-ES/common.jsonindex c3c49934658..75056e85d02 100644--- a/web/i18n/locales/es-ES/common.json+++ b/web/i18n/locales/es-ES/common.json@@ -450,6 +450,8 @@"operation.confirmAction": "Por favor, confirme su acción.","operation.copied": "Copiado","operation.copy": "Copiar",+ "operation.copyErrorDetails": "Copiar detalles del error",+ "operation.copyErrorFailed": "Error al copiar. Reintentar","operation.copyImage": "Copiar imagen","operation.create": "Crear","operation.deSelectAll": "Deseleccionar todo",diff --git a/web/i18n/locales/fa-IR/common.json b/web/i18n/locales/fa-IR/common.jsonindex 944032a9fd7..f3a6381e4de 100644--- a/web/i18n/locales/fa-IR/common.json+++ b/web/i18n/locales/fa-IR/common.json@@ -450,6 +450,8 @@"operation.confirmAction": "لطفاً اقدام خود را تأیید کنید.","operation.copied": "کپی","operation.copy": "کپی",+ "operation.copyErrorDetails": "کپی جزئیات خطا",+ "operation.copyErrorFailed": "کپی ناموفق بود. تلاش مجدد","operation.copyImage": "کپی تصویر","operation.create": "ایجاد","operation.deSelectAll": "همه را انتخاب نکنید",diff --git a/web/i18n/locales/fr-FR/common.json b/web/i18n/locales/fr-FR/common.jsonindex 0efc9dc1dfd..f72fe237736 100644--- a/web/i18n/locales/fr-FR/common.json+++ b/web/i18n/locales/fr-FR/common.json@@ -450,6 +450,8 @@"operation.confirmAction": "Veuillez confirmer votre action.","operation.copied": "Copied","operation.copy": "Copier",+ "operation.copyErrorDetails": "Copier les détails de l’erreur",+ "operation.copyErrorFailed": "Échec de la copie. Réessayer","operation.copyImage": "Copier l’image","operation.create": "Créer","operation.deSelectAll": "Désélectionner tout",diff --git a/web/i18n/locales/hi-IN/common.json b/web/i18n/locales/hi-IN/common.jsonindex a1e86a2238d..d97f31dad19 100644--- a/web/i18n/locales/hi-IN/common.json+++ b/web/i18n/locales/hi-IN/common.json@@ -450,6 +450,8 @@"operation.confirmAction": "कृपया अपनी क्रिया की पुष्टि करें।","operation.copied": "कॉपी किया गया","operation.copy": "कॉपी करें",+ "operation.copyErrorDetails": "त्रुटि का विवरण कॉपी करें",+ "operation.copyErrorFailed": "कॉपी नहीं हुआ। फिर कोशिश करें","operation.copyImage": "छवि कॉपी करें","operation.create": "बनाएं","operation.deSelectAll": "सभी चयन हटाएँ",diff --git a/web/i18n/locales/id-ID/common.json b/web/i18n/locales/id-ID/common.jsonindex 5126857bb74..c8e27ba8989 100644--- a/web/i18n/locales/id-ID/common.json+++ b/web/i18n/locales/id-ID/common.json@@ -450,6 +450,8 @@"operation.confirmAction": "Silakan konfirmasi tindakan Anda.","operation.copied": "Disalin","operation.copy": "Menyalin",+ "operation.copyErrorDetails": "Salin detail kesalahan",+ "operation.copyErrorFailed": "Gagal menyalin. Coba lagi","operation.copyImage": "Salin Gambar","operation.create": "Menciptakan","operation.deSelectAll": "Batalkan pilihan Semua",diff --git a/web/i18n/locales/it-IT/common.json b/web/i18n/locales/it-IT/common.jsonindex ed517d0292d..5f37d415ee3 100644--- a/web/i18n/locales/it-IT/common.json+++ b/web/i18n/locales/it-IT/common.json@@ -450,6 +450,8 @@"operation.confirmAction": "Per favore conferma la tua azione.","operation.copied": "Copiato","operation.copy": "Copia",+ "operation.copyErrorDetails": "Copia dettagli errore",+ "operation.copyErrorFailed": "Copia non riuscita. Riprova","operation.copyImage": "Copia immagine","operation.create": "Crea","operation.deSelectAll": "Deseleziona tutto",diff --git a/web/i18n/locales/ja-JP/common.json b/web/i18n/locales/ja-JP/common.jsonindex c36b3978350..796264cdf6c 100644--- a/web/i18n/locales/ja-JP/common.json+++ b/web/i18n/locales/ja-JP/common.json@@ -450,6 +450,8 @@"operation.confirmAction": "操作を確認してください。","operation.copied": "コピーしました","operation.copy": "コピー",+ "operation.copyErrorDetails": "エラーの詳細をコピー",+ "operation.copyErrorFailed": "コピーに失敗しました。再試行","operation.copyImage": "画像をコピー","operation.create": "作成","operation.deSelectAll": "すべて選択解除",diff --git a/web/i18n/locales/ko-KR/common.json b/web/i18n/locales/ko-KR/common.jsonindex b7eefa7eb50..6b987bbf03e 100644--- a/web/i18n/locales/ko-KR/common.json+++ b/web/i18n/locales/ko-KR/common.json@@ -450,6 +450,8 @@"operation.confirmAction": "귀하의 행동을 확인해 주세요.","operation.copied": "복사","operation.copy": "복사",+ "operation.copyErrorDetails": "오류 세부 정보 복사",+ "operation.copyErrorFailed": "복사 실패. 다시 시도","operation.copyImage": "이미지 복사","operation.create": "생성","operation.deSelectAll": "모두 선택 해제",diff --git a/web/i18n/locales/lo-LA/common.json b/web/i18n/locales/lo-LA/common.jsonindex edad7073829..a9c1e13e536 100644--- a/web/i18n/locales/lo-LA/common.json+++ b/web/i18n/locales/lo-LA/common.json@@ -450,6 +450,8 @@"operation.confirmAction": "ກະລຸນາຢືນຢັນການດຳເນີນການຂອງທ່ານ.","operation.copied": "ຄັດລອກແລ້ວ","operation.copy": "ຄັດລອກ",+ "operation.copyErrorDetails": "ສຳເນົາລາຍລະອຽດຂໍ້ຜິດພາດ",+ "operation.copyErrorFailed": "ສຳເນົາບໍ່ສຳເລັດ. ລອງໃໝ່","operation.copyImage": "ຄັດລອກຮູບພາບ","operation.create": "ສ້າງ","operation.deSelectAll": "ຍົກເລີກການເລືອກທັງໝົດ",diff --git a/web/i18n/locales/nl-NL/common.json b/web/i18n/locales/nl-NL/common.jsonindex 2fd3b5d38ef..87bc98c3a5a 100644--- a/web/i18n/locales/nl-NL/common.json+++ b/web/i18n/locales/nl-NL/common.json@@ -450,6 +450,8 @@"operation.confirmAction": "Please confirm your action.","operation.copied": "Copied","operation.copy": "Copy",+ "operation.copyErrorDetails": "Foutdetails kopiëren",+ "operation.copyErrorFailed": "Kopiëren mislukt. Opnieuw proberen","operation.copyImage": "Copy Image","operation.create": "Create","operation.deSelectAll": "Deselect All",diff --git a/web/i18n/locales/pl-PL/common.json b/web/i18n/locales/pl-PL/common.jsonindex ce37d533d55..897481aca3a 100644--- a/web/i18n/locales/pl-PL/common.json+++ b/web/i18n/locales/pl-PL/common.json@@ -450,6 +450,8 @@"operation.confirmAction": "Proszę potwierdzić swoją akcję.","operation.copied": "Kopiowane","operation.copy": "Kopiuj",+ "operation.copyErrorDetails": "Kopiuj szczegóły błędu",+ "operation.copyErrorFailed": "Kopiowanie nie powiodło się. Spróbuj ponownie","operation.copyImage": "Kopiuj obraz","operation.create": "Utwórz","operation.deSelectAll": "Odznacz wszystkie",diff --git a/web/i18n/locales/pt-BR/common.json b/web/i18n/locales/pt-BR/common.jsonindex b88ab8c7049..089f40bda76 100644--- a/web/i18n/locales/pt-BR/common.json+++ b/web/i18n/locales/pt-BR/common.json@@ -450,6 +450,8 @@"operation.confirmAction": "Por favor, confirme sua ação.","operation.copied": "Copiado","operation.copy": "Copiar",+ "operation.copyErrorDetails": "Copiar detalhes do erro",+ "operation.copyErrorFailed": "Falha ao copiar. Tentar novamente","operation.copyImage": "Copiar imagem","operation.create": "Criar","operation.deSelectAll": "Desmarcar tudo",diff --git a/web/i18n/locales/ro-RO/common.json b/web/i18n/locales/ro-RO/common.jsonindex 64d0c2b6f00..6c0e3da3bba 100644--- a/web/i18n/locales/ro-RO/common.json+++ b/web/i18n/locales/ro-RO/common.json@@ -450,6 +450,8 @@"operation.confirmAction": "Vă rugăm să confirmați acțiunea dumneavoastră.","operation.copied": "Copiat","operation.copy": "Copiază",+ "operation.copyErrorDetails": "Copiază detaliile erorii",+ "operation.copyErrorFailed": "Copierea a eșuat. Reîncearcă","operation.copyImage": "Copiere imagine","operation.create": "Creează","operation.deSelectAll": "Deselectați tot",diff --git a/web/i18n/locales/ru-RU/common.json b/web/i18n/locales/ru-RU/common.jsonindex c1c94c8d92a..7573cf2347a 100644--- a/web/i18n/locales/ru-RU/common.json+++ b/web/i18n/locales/ru-RU/common.json@@ -450,6 +450,8 @@"operation.confirmAction": "Пожалуйста, подтвердите ваше действие.","operation.copied": "Скопированы","operation.copy": "Копировать",+ "operation.copyErrorDetails": "Копировать сведения об ошибке",+ "operation.copyErrorFailed": "Не удалось скопировать. Повторить","operation.copyImage": "Скопировать изображение","operation.create": "Создать","operation.deSelectAll": "Снять выделение со всех",diff --git a/web/i18n/locales/sl-SI/common.json b/web/i18n/locales/sl-SI/common.jsonindex e4cd5e7ccab..af9f0c968cb 100644--- a/web/i18n/locales/sl-SI/common.json+++ b/web/i18n/locales/sl-SI/common.json@@ -450,6 +450,8 @@"operation.confirmAction": "Prosimo, potrdite svoje dejanje.","operation.copied": "Kopirati","operation.copy": "Kopiraj",+ "operation.copyErrorDetails": "Kopiraj podrobnosti napake",+ "operation.copyErrorFailed": "Kopiranje ni uspelo. Poskusi znova","operation.copyImage": "Kopiraj sliko","operation.create": "Ustvari","operation.deSelectAll": "Odberi vse",diff --git a/web/i18n/locales/th-TH/common.json b/web/i18n/locales/th-TH/common.jsonindex 1293111607c..be75457107b 100644--- a/web/i18n/locales/th-TH/common.json+++ b/web/i18n/locales/th-TH/common.json@@ -450,6 +450,8 @@"operation.confirmAction": "กรุณายืนยันการกระทำของคุณ","operation.copied": "คัด ลอก","operation.copy": "ลอก",+ "operation.copyErrorDetails": "คัดลอกรายละเอียดข้อผิดพลาด",+ "operation.copyErrorFailed": "คัดลอกไม่สำเร็จ ลองอีกครั้ง","operation.copyImage": "คัดลอกรูปภาพ","operation.create": "สร้าง","operation.deSelectAll": "ยกเลิกการเลือกทั้งหมด",diff --git a/web/i18n/locales/tr-TR/common.json b/web/i18n/locales/tr-TR/common.jsonindex 64ccdeb7196..2be6c1e708a 100644--- a/web/i18n/locales/tr-TR/common.json+++ b/web/i18n/locales/tr-TR/common.json@@ -450,6 +450,8 @@"operation.confirmAction": "Lütfen işleminizi onaylayın.","operation.copied": "Kopyalandı","operation.copy": "Kopyala",+ "operation.copyErrorDetails": "Hata ayrıntılarını kopyala",+ "operation.copyErrorFailed": "Kopyalama başarısız. Yeniden dene","operation.copyImage": "Resmi Kopyala","operation.create": "Oluştur","operation.deSelectAll": "Hepsini Seçme",diff --git a/web/i18n/locales/uk-UA/common.json b/web/i18n/locales/uk-UA/common.jsonindex fb11fb3df95..39d7e01999b 100644--- a/web/i18n/locales/uk-UA/common.json+++ b/web/i18n/locales/uk-UA/common.json@@ -450,6 +450,8 @@"operation.confirmAction": "Будь ласка, підтвердіть свої дії.","operation.copied": "Скопійовані","operation.copy": "Копіювати",+ "operation.copyErrorDetails": "Копіювати відомості про помилку",+ "operation.copyErrorFailed": "Не вдалося скопіювати. Повторити","operation.copyImage": "Скопіювати зображення","operation.create": "Створити","operation.deSelectAll": "Вимкнути все",diff --git a/web/i18n/locales/vi-VN/common.json b/web/i18n/locales/vi-VN/common.jsonindex 71e1cccce04..44401890f64 100644--- a/web/i18n/locales/vi-VN/common.json+++ b/web/i18n/locales/vi-VN/common.json@@ -450,6 +450,8 @@"operation.confirmAction": "Vui lòng xác nhận hành động của bạn.","operation.copied": "Sao chép","operation.copy": "Sao chép",+ "operation.copyErrorDetails": "Sao chép chi tiết lỗi",+ "operation.copyErrorFailed": "Sao chép thất bại. Thử lại","operation.copyImage": "Sao chép hình ảnh","operation.create": "Tạo mới","operation.deSelectAll": "Bỏ chọn tất cả",diff --git a/web/i18n/locales/zh-Hans/common.json b/web/i18n/locales/zh-Hans/common.jsonindex ea81c7d584e..76b326894a8 100644--- a/web/i18n/locales/zh-Hans/common.json+++ b/web/i18n/locales/zh-Hans/common.json@@ -450,6 +450,8 @@"operation.confirmAction": "请确认您的操作。","operation.copied": " 已复制","operation.copy": "复制",+ "operation.copyErrorDetails": "复制错误详情",+ "operation.copyErrorFailed": "复制失败,重试","operation.copyImage": "复制图片","operation.create": "创建","operation.deSelectAll": "取消全选",diff --git a/web/i18n/locales/zh-Hant/common.json b/web/i18n/locales/zh-Hant/common.jsonindex f476ada0932..d3d23450632 100644--- a/web/i18n/locales/zh-Hant/common.json+++ b/web/i18n/locales/zh-Hant/common.json@@ -450,6 +450,8 @@"operation.confirmAction": "請確認您的操作。","operation.copied": "複製","operation.copy": "複製",+ "operation.copyErrorDetails": "複製錯誤詳細資訊",+ "operation.copyErrorFailed": "複製失敗,重試","operation.copyImage": "複製圖像","operation.create": "建立","operation.deSelectAll": "全不選",diff --git a/web/service/__tests__/request-error-toast.spec.ts b/web/service/__tests__/request-error-toast.spec.tsindex c76780b4c29..ce0542e6fe9 100644--- a/web/service/__tests__/request-error-toast.spec.ts+++ b/web/service/__tests__/request-error-toast.spec.ts@@ -1,10 +1,10 @@-import { toast } from '@langgenius/dify-ui/toast'import { afterEach, beforeEach, describe, expect, it, vi } from 'vite-plus/test'+import { toast } from '@/app/notifications'// oxlint-disable-next-line no-restricted-imports -- Exercise the shared request transport and its notification behavior.import { base } from '../fetch'import { clearRequestErrorToasts, notifyRequestError } from '../request-error-toast'-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: { error: vi.fn() },}))diff --git a/web/service/base.spec.ts b/web/service/base.spec.tsindex 2360eefc26a..586e4fcb9f4 100644--- a/web/service/base.spec.ts+++ b/web/service/base.spec.ts@@ -1,6 +1,6 @@-import { toast } from '@langgenius/dify-ui/toast'import { waitFor } from '@testing-library/react'import { afterEach, beforeEach, describe, expect, it, vi } from 'vite-plus/test'+import { toast } from '@/app/notifications'import { PUBLIC_API_PREFIX } from '@/config'// oxlint-disable-next-line no-restricted-importsimport {@@ -18,7 +18,7 @@ import {const refreshAccessTokenOrReLoginMock = vi.hoisted(() => vi.fn())-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {error: vi.fn(),},diff --git a/web/service/base.ts b/web/service/base.tsindex 4d0d2f9c9f9..a50169071d6 100644--- a/web/service/base.ts+++ b/web/service/base.ts@@ -28,9 +28,9 @@ import type {WorkflowPausedResponse,WorkflowStartedResponse,} from '@/types/workflow'-import { toast } from '@langgenius/dify-ui/toast'import Cookies from 'js-cookie'import { discardRegistrationSessionState } from '@/app/components/base/amplitude/registration-session-state'+import { toast } from '@/app/notifications'import {API_PREFIX,CSRF_COOKIE_NAME,diff --git a/web/service/fetch.spec.ts b/web/service/fetch.spec.tsindex 55c7cc613cc..e74a774911b 100644--- a/web/service/fetch.spec.ts+++ b/web/service/fetch.spec.ts@@ -8,14 +8,14 @@ import {// oxlint-disable-next-line no-restricted-importsimport { base } from './fetch'-vi.mock('@langgenius/dify-ui/toast', () => ({+vi.mock('@/app/notifications', () => ({toast: {add: vi.fn(),error: vi.fn(),},}))-const { toast } = await import('@langgenius/dify-ui/toast')+const { toast } = await import('@/app/notifications')describe('base', () => {beforeEach(() => {diff --git a/web/service/request-error-toast.ts b/web/service/request-error-toast.tsindex 5588e0753c1..f1d9743fd32 100644--- a/web/service/request-error-toast.ts+++ b/web/service/request-error-toast.ts@@ -1,4 +1,4 @@-import { toast } from '@langgenius/dify-ui/toast'+import { toast } from '@/app/notifications'const DEDUPE_WINDOW_MS = 10000