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
refactor(ui): split toast stories and align app toaster naming (#44510)
yyhda1b1dbe41a4
diff --git a/packages/dify-ui/src/toast/index.stories.tsx b/packages/dify-ui/src/toast/index.stories.tsxindex 2831f351ef2..0b87992624c 100644--- a/packages/dify-ui/src/toast/index.stories.tsx+++ b/packages/dify-ui/src/toast/index.stories.tsx@@ -1,395 +1,469 @@import type { Meta, StoryObj } from '@storybook/react-vite'+import type { ToastType } from '.'import * as React from 'react'-import { expect, within } from 'storybook/test'+import { expect, waitFor, within } from 'storybook/test'import { createToast, createToastManager, Toaster } from '.'import { Button } from '../button'-const manager = createToastManager()-const toast = createToast(manager)+type ToastExampleProps = {+ type: ToastType+ title: string+ description?: string+}-const longToastTitle =- 'operation error S3: PutObject, exceeded maximum number of attempts, 3, StatusCode: 0, RequestID: , HostID: , request send failed'-const longToastDescription =- 'Put "https://plugin/assets/1bd032bb73218a5d141b80cab7111?x-id=PutObject": dial tcp 192.168.0.200:19000: connect: connection refused, icon small en_US failed to remap assets failed to store plugin asset'+function ToastExample({ type, title, description }: ToastExampleProps) {+ const [manager] = React.useState(createToastManager)+ const toast = createToast(manager)-const buttonClassName =- 'rounded-lg border border-divider-subtle bg-components-button-secondary-bg px-3 py-2 text-sm text-text-secondary shadow-xs outline-hidden transition-colors hover:bg-state-base-hover focus-visible:ring-2 focus-visible:ring-state-accent-solid'-const cardClassName =- 'flex min-h-[220px] flex-col gap-4 rounded-2xl border border-divider-subtle bg-components-panel-bg p-6 shadow-sm shadow-shadow-shadow-3'--function ExampleCard({- eyebrow,- title,- description,- children,-}: {- eyebrow: string- title: string- description: string- children: React.ReactNode-}) {return (- <section className={cardClassName}>- <div className="space-y-2">- <div className="text-xs tracking-[0.18em] text-text-tertiary uppercase">{eyebrow}</div>- <h3 className="text-base leading-6 font-semibold text-text-primary">{title}</h3>- <p className="text-sm leading-6 text-text-secondary">{description}</p>- </div>- <div className="mt-auto flex flex-wrap gap-3">{children}</div>- </section>+ <React.Fragment>+ <Toaster toastManager={manager} />+ <Button onClick={() => toast[type](title, { description })}>Show notification</Button>+ </React.Fragment>)}-function VariantExamples() {- const createVariantToast = (type: 'success' | 'error' | 'warning' | 'info') => {- const copy = {- success: {- title: 'Changes saved',- description: 'Your draft is available to collaborators.',- },- error: {- title: 'Sync failed',- description: 'Check your network connection and try again.',- },- warning: {- title: 'Storage almost full',- description: 'You have less than 10% of workspace quota remaining.',- },- info: {- title: 'Invitation sent',- description: 'An email has been sent to the new teammate.',+const meta = {+ title: 'Base/UI/Toast',+ component: ToastExample,+ parameters: {+ layout: 'fullscreen',+ docs: {+ description: {+ component:+ 'Create a manager with `createToastManager()`, pass it to `Toaster`, and use `createToast(manager)` to send notifications from outside the React tree. Each example owns its manager. `Toaster` supplies the Base UI provider, portal, viewport, and default cards; Base UI manages dismissal, timers, focus, and stacking state. Press F6 to enter or leave the notifications region. The default timeout is 5 seconds and the visible stack limit is 3. Lifecycle examples use `timeout={0}` so they remain available for inspection.',},- } as const+ story: { inline: false, height: '440px' },+ },+ },+ decorators: [+ (Story) => (+ <div className="flex min-h-100 flex-wrap items-end gap-3 bg-background-default-subtle p-6">+ <Story />+ </div>+ ),+ ],+ argTypes: {+ type: { control: 'select', options: ['success', 'info', 'warning', 'error'] },+ title: { control: 'text' },+ description: { control: 'text' },+ },+ args: {+ type: 'success',+ title: 'Export complete',+ description: 'Your workflow is ready to download.',+ },+ play: async ({ args, canvas, canvasElement, userEvent }) => {+ const body = within(canvasElement.ownerDocument.body)+ await userEvent.click(canvas.getByRole('button', { name: 'Show notification' }))+ const notification = await body.findByRole('dialog', { name: args.title })+ await waitFor(() => expect(notification).toBeVisible())+ if (args.description) {+ await expect(within(notification).getByText(args.description)).toBeVisible()+ }+ },+} satisfies Meta<typeof ToastExample>- toast[type](copy[type].title, {- description: copy[type].description,- })- }+export default meta+type Story = StoryObj<typeof meta>++export const Success: Story = {}++export const Info: Story = {+ args: {+ type: 'info',+ title: 'Workflow restored',+ description: 'A collaborator restored an earlier version.',+ },+}++export const Warning: Story = {+ args: {+ type: 'warning',+ title: 'Import completed with warnings',+ description: 'Two unsupported files were skipped.',+ },+}++export const Error: Story = {+ args: {+ type: 'error',+ title: 'Export failed',+ description: 'The storage service is unavailable. Try again later.',+ },+}++function StackedExample() {+ const [manager] = React.useState(createToastManager)+ const toast = createToast(manager)+ const countRef = React.useRef(0)return (- <ExampleCard- eyebrow="Variants"- title="Tone-specific notifications"- description="Trigger the four supported tones from the shared viewport to validate iconography, gradient treatment, and copy density."- >- <button- type="button"- className={buttonClassName}- onClick={() => createVariantToast('success')}- >- Success- </button>- <button type="button" className={buttonClassName} onClick={() => createVariantToast('info')}>- Info- </button>- <button- type="button"- className={buttonClassName}- onClick={() => createVariantToast('warning')}+ <React.Fragment>+ <Toaster toastManager={manager} timeout={0} limit={3} />+ <Button+ onClick={() => {+ countRef.current += 1+ toast.info(`Background task ${countRef.current} completed`)+ }}>- Warning- </button>- <button type="button" className={buttonClassName} onClick={() => createVariantToast('error')}>- Error- </button>- </ExampleCard>+ Add notification+ </Button>+ <Button variant="secondary" onClick={() => toast.dismiss()}>+ Clear notifications+ </Button>+ </React.Fragment>)}-function StackExamples() {- const createStack = () => {- ;[- {- type: 'info' as const,- title: 'Generating preview',- description: 'The first toast compresses behind the newest notification.',- },- {- type: 'warning' as const,- title: 'Review required',- description: 'A second toast should deepen the stack without breaking spacing.',- },- {- type: 'success' as const,- title: 'Ready to publish',- description: 'The newest toast stays frontmost while older items tuck behind it.',+export const Stacked: Story = {+ parameters: {+ controls: { disable: true },+ docs: {+ description: {+ story:+ 'Add notifications repeatedly to inspect the three-item stack and overflow. Hover or focus the viewport to expand it; clear the stack to start again.',},- ].forEach((item) => {- toast[item.type](item.title, {- description: item.description,- })- })- }+ },+ },+ render: () => <StackedExample />,+ play: async ({ canvas, canvasElement, userEvent }) => {+ const body = within(canvasElement.ownerDocument.body)+ const add = canvas.getByRole('button', { name: 'Add notification' })+ await userEvent.click(add)+ await userEvent.click(add)+ await userEvent.click(add)+ await userEvent.hover(await body.findByRole('dialog', { name: 'Background task 3 completed' }))+ await expect(body.getAllByRole('dialog')).toHaveLength(3)+ for (const notification of body.getAllByRole('dialog')) {+ await expect(notification).toHaveAttribute('data-expanded')+ }+ },+}- const createBurst = () => {- Array.from({ length: 5 }).forEach((_, index) => {- toast[index % 2 === 0 ? 'info' : 'success'](`Background task ${index + 1}`, {- description: 'Use this to inspect how the stack behaves near the host limit.',- })- })- }+function VaryingHeightsExample() {+ const [manager] = React.useState(createToastManager)+ const toast = createToast(manager)- const createVaryingHeightStack = () => {- toast.error('Failed to publish the workflow', {+ const showStack = () => {+ toast.error('Workflow could not be published', {+ id: 'publication',description:- 'The workflow could not be published because several dependent resources are unavailable. Check the model provider credentials, reconnect the knowledge base, and try publishing again after every dependency is ready.',- })- toast.success('Short front toast', {- description: 'Short message.',+ 'Several dependent resources are unavailable. Check the model provider credentials, reconnect the knowledge base, and try publishing again after every dependency is ready.',})+ toast.success('Export complete', { id: 'export' })}return (- <ExampleCard- eyebrow="Stack"- title="Stacked viewport behavior"- description="These examples mirror the Base UI docs pattern: repeated triggers should compress into a single shared stack at the top-right corner."- >- <button type="button" className={buttonClassName} onClick={createStack}>- Create 3 stacked toasts- </button>- <button type="button" className={buttonClassName} onClick={createBurst}>- Stress the stack- </button>- <button type="button" className={buttonClassName} onClick={createVaryingHeightStack}>- Varying heights- </button>- </ExampleCard>+ <React.Fragment>+ <Toaster toastManager={manager} timeout={0} />+ <Button onClick={showStack}>Show different heights</Button>+ </React.Fragment>)}-function PromiseExamples() {- const [pendingExample, setPendingExample] = React.useState<'success' | 'error' | null>(null)+export const VaryingHeights: Story = {+ parameters: {+ controls: { disable: true },+ docs: {+ description: {+ story:+ 'A tall notification sits behind a short one. The collapsed stack uses the front card’s height; hover or focus reveals each card at its own height.',+ },+ },+ },+ render: () => <VaryingHeightsExample />,+ play: async ({ canvas, canvasElement, userEvent }) => {+ const body = within(canvasElement.ownerDocument.body)+ await userEvent.click(canvas.getByRole('button', { name: 'Show different heights' }))+ const front = await body.findByRole('dialog', { name: 'Export complete' })+ const behind = body.getByRole('dialog', { name: 'Workflow could not be published' })+ await waitFor(() => {+ expect(Math.abs(behind.clientHeight - front.clientHeight)).toBeLessThanOrEqual(1)+ })+ await userEvent.hover(front)+ await waitFor(() => expect(behind.clientHeight).toBeGreaterThan(front.clientHeight))+ await waitFor(() =>+ expect(within(behind).getByText(/Several dependent resources/)).toBeVisible(),+ )+ },+}- const exportDsl = async (outcome: 'success' | 'error') => {- if (pendingExample) return+function ActionExample() {+ const [manager] = React.useState(createToastManager)+ const toast = createToast(manager)- setPendingExample(outcome)- const request = new Promise<string>((resolve, reject) => {- window.setTimeout(() => {- if (outcome === 'success') resolve('customer-support-agent.yml')- else reject(new Error('The DSL could not be generated.'))- }, 1400)+ const archive = () => {+ const id = toast.success('Project archived', {+ description: 'You can restore the project with Undo.',+ actionProps: {+ children: 'Undo',+ onClick: () => {+ toast.dismiss(id)+ toast.success('Project restored')+ },+ },})+ }- await toast- .promise(request, {- loading: {- title: 'Preparing DSL export',- description: 'Collecting the app configuration and generating a YAML file.',- },+ return (+ <React.Fragment>+ <Toaster toastManager={manager} timeout={0} />+ <Button onClick={archive}>Archive project</Button>+ </React.Fragment>+ )+}++export const WithAction: Story = {+ parameters: {+ controls: { disable: true },+ docs: {+ description: {+ story:+ 'Use `actionProps` for a notification action. The caller closes the original notification when Undo completes.',+ },+ },+ },+ render: () => <ActionExample />,+ play: async ({ canvas, canvasElement, userEvent }) => {+ const body = within(canvasElement.ownerDocument.body)+ await userEvent.click(canvas.getByRole('button', { name: 'Archive project' }))+ const archived = await body.findByRole('dialog', { name: 'Project archived' })+ await userEvent.click(within(archived).getByRole('button', { name: 'Undo' }))+ const restored = await body.findByRole('dialog', { name: 'Project restored' })+ await waitFor(() => expect(restored).toBeVisible())+ await waitFor(() => expect(archived).not.toBeInTheDocument())+ },+}++function PromiseExample({ outcome }: { outcome: 'success' | 'error' }) {+ const [manager] = React.useState(createToastManager)+ const toast = createToast(manager)+ const [request, setRequest] = React.useState<{+ resolve: (fileName: string) => void+ reject: (error: Error) => void+ } | null>(null)++ const startExport = () => {+ const promise = new Promise<string>((resolve, reject) => setRequest({ resolve, reject }))+ void toast+ .promise(promise, {+ loading: 'Preparing export',success: (fileName) => ({- title: 'Download started',- description: `${fileName} was sent to your browser.`,- timeout: 3000,- }),- error: () => ({- title: 'Export failed',- description: 'The DSL could not be generated. Try again.',+ title: 'Export complete',+ description: `${fileName} is ready to download.`,}),+ error: 'Export failed',}).catch(() => undefined)-- setPendingExample(null)+ .finally(() => setRequest(null))}return (- <ExampleCard- eyebrow="Promise"- title="Export lifecycle"- description="A single toast follows the export from preparation to browser handoff, while the trigger prevents duplicate requests."- >- <Button- variant="secondary"- loading={pendingExample === 'success'}- disabled={pendingExample === 'error'}- onClick={() => exportDsl('success')}- >- Export DSL+ <React.Fragment>+ <Toaster toastManager={manager} timeout={0} />+ <Button disabled={request !== null} onClick={startExport}>+ Start export</Button><Buttonvariant="secondary"- loading={pendingExample === 'error'}- disabled={pendingExample === 'success'}- onClick={() => exportDsl('error')}+ disabled={request === null}+ onClick={() => {+ if (outcome === 'success') request?.resolve('workflow.yml')+ else request?.reject(new globalThis.Error('Storage unavailable'))+ }}>- Simulate failure+ {outcome === 'success' ? 'Complete export' : 'Fail export'}</Button>- </ExampleCard>+ </React.Fragment>)}-function ActionExamples() {- const createActionToast = () => {- let archivedToastId = ''- archivedToastId = toast.warning('Project archived', {- description: 'You can restore it from workspace settings for the next 30 days.',- timeout: 10000,- actionProps: {- children: 'Undo',- onClick: () => {- toast.dismiss(archivedToastId)- toast.success('Project restored', {- description: 'The workspace is active again.',- })- },+export const PromiseSuccess: Story = {+ parameters: {+ controls: { disable: true },+ docs: {+ description: {+ story:+ 'Start an export, then resolve the simulated request. `toast.promise` updates the same card from loading to success. The completion button makes each state available for inspection.',},- })- }+ },+ },+ render: () => <PromiseExample outcome="success" />,+ play: async ({ canvas, canvasElement, userEvent }) => {+ const body = within(canvasElement.ownerDocument.body)+ await userEvent.click(canvas.getByRole('button', { name: 'Start export' }))+ const notification = await body.findByRole('dialog', { name: 'Preparing export' })+ await expect(notification).toHaveAttribute('data-type', 'loading')+ await userEvent.click(canvas.getByRole('button', { name: 'Complete export' }))+ await expect(await body.findByRole('dialog', { name: 'Export complete' })).toBe(notification)+ await waitFor(() =>+ expect(within(notification).getByText('workflow.yml is ready to download.')).toBeVisible(),+ )+ await expect(canvas.getByRole('button', { name: 'Start export' })).toBeEnabled()+ },+}- const createLongCopyToast = () => {- toast.error(longToastTitle, {- description: longToastDescription,- actionProps: {- children: 'View details',- onClick: () => {- toast.info('Job details opened')- },+export const PromiseError: Story = {+ parameters: {+ controls: { disable: true },+ docs: {+ description: {+ story:+ 'Reject the simulated request to inspect loading → error. The rejection is handled after the notification reports the failure.',},- })- }-- return (- <ExampleCard- eyebrow="Action"- title="Actionable toasts"- description="Use these to verify the secondary action button, multi-line content, and the close affordance under tighter layouts."- >- <button type="button" className={buttonClassName} onClick={createActionToast}>- Undo action- </button>- <button type="button" className={buttonClassName} onClick={createLongCopyToast}>- Long content- </button>- </ExampleCard>- )+ },+ },+ render: () => <PromiseExample outcome="error" />,+ play: async ({ canvas, canvasElement, userEvent }) => {+ const body = within(canvasElement.ownerDocument.body)+ await userEvent.click(canvas.getByRole('button', { name: 'Start export' }))+ const notification = await body.findByRole('dialog', { name: 'Preparing export' })+ await expect(notification).toHaveAttribute('data-type', 'loading')+ await userEvent.click(canvas.getByRole('button', { name: 'Fail export' }))+ await expect(await body.findByRole('dialog', { name: 'Export failed' })).toBe(notification)+ await waitFor(() => expect(notification).toBeVisible())+ await expect(notification).toHaveAttribute('data-type', 'error')+ await expect(canvas.getByRole('button', { name: 'Start export' })).toBeEnabled()+ },}-function DeduplicateExamples() {- const saveCountRef = React.useRef(0)-- const saveDraft = () => {- saveCountRef.current += 1- toast.success('Draft saved', {- id: 'draft-save-status',- description:- saveCountRef.current === 1- ? 'Click again while this toast is visible to update the same mounted toast.'- : `Same toast updated ${saveCountRef.current} times.`,- })- }+function DeduplicatedExample() {+ const [manager] = React.useState(createToastManager)+ const toast = createToast(manager)+ const savesRef = React.useRef(0)return (- <ExampleCard- eyebrow="Deduplicated"- title="Same-id upsert"- description="Matches the Base UI deduplicated toast example: repeated triggers use a stable id, so the visible toast is updated instead of adding another stack item."- >- <button type="button" className={buttonClassName} onClick={saveDraft}>+ <React.Fragment>+ <Toaster toastManager={manager} timeout={0} />+ <Button+ onClick={() => {+ savesRef.current += 1+ toast.success('Draft saved', {+ id: 'draft-save',+ description: `Saved ${savesRef.current} times in this session.`,+ })+ }}+ >Save draft- </button>- </ExampleCard>+ </Button>+ </React.Fragment>)}-function UpdateExamples() {- const createUpdatableToast = () => {- const toastId = toast.info('Import started', {- description: 'Preparing assets and metadata for processing.',- timeout: 0,- })-- window.setTimeout(() => {- toast.update(toastId, {- type: 'success',- title: 'Import finished',- description: '128 records were imported successfully.',- timeout: 5000,- })- }, 1400)- }-- const clearAll = () => {- toast.dismiss()- }-- return (- <ExampleCard- eyebrow="Update"- title="Programmatic lifecycle"- description="This example exercises manual updates on an existing toast and keeps a clear-all control nearby for repeated interaction during review."- >- <button type="button" className={buttonClassName} onClick={createUpdatableToast}>- Add then update- </button>- <button type="button" className={buttonClassName} onClick={clearAll}>- Clear all- </button>- </ExampleCard>- )+export const Deduplicated: Story = {+ parameters: {+ controls: { disable: true },+ docs: {+ description: {+ story:+ 'Repeated calls with the same `id` update the mounted notification instead of adding another card. Dify uses Base UI’s upsert behavior without adding a pulse animation.',+ },+ },+ },+ render: () => <DeduplicatedExample />,+ play: async ({ canvas, canvasElement, userEvent }) => {+ const body = within(canvasElement.ownerDocument.body)+ const save = canvas.getByRole('button', { name: 'Save draft' })+ await userEvent.click(save)+ const notification = await body.findByRole('dialog', { name: 'Draft saved' })+ await userEvent.click(save)+ await waitFor(() =>+ expect(within(notification).getByText('Saved 2 times in this session.')).toBeVisible(),+ )+ await expect(body.getAllByRole('dialog')).toEqual([notification])+ },}-function ToastDocsDemo() {+function UpdateExample() {+ const [manager] = React.useState(createToastManager)+ const toast = createToast(manager)+ const [id, setId] = React.useState<string | null>(null)+return (<React.Fragment>- <Toaster toastManager={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">- <div className="text-xs tracking-[0.18em] text-text-tertiary uppercase">- Base UI toast docs- </div>- <h2 className="text-[24px] leading-8 font-semibold text-text-primary">- Shared stacked toast examples- </h2>- <p className="max-w-3xl text-sm leading-6 text-text-secondary">- Each example card below triggers the same shared toast viewport in the top-right- corner, so you can review stacking, state transitions, actions, and tone variants the- same way the official Base UI documentation demonstrates toast behavior.- </p>- </div>- <div className="grid grid-cols-1 gap-4 xl:grid-cols-2">- <VariantExamples />- <StackExamples />- <PromiseExamples />- <ActionExamples />- <DeduplicateExamples />- <UpdateExamples />- </div>- </div>- </div>+ <Toaster toastManager={manager} timeout={0} />+ <Button+ disabled={id !== null}+ onClick={() => {+ setId(toast.info('Import queued', { onClose: () => setId(null) }))+ }}+ >+ Queue import+ </Button>+ <Button+ variant="secondary"+ disabled={id === null}+ onClick={() => {+ if (id)+ toast.update(id, {+ type: 'success',+ title: 'Import complete',+ description: '128 records imported.',+ })+ }}+ >+ Complete import+ </Button>+ <Button+ variant="secondary"+ disabled={id === null}+ onClick={() => {+ if (id) toast.dismiss(id)+ }}+ >+ Dismiss import+ </Button></React.Fragment>)}-const meta = {- title: 'Base/UI/Toast',- component: ToastDocsDemo,+export const ProgrammaticUpdate: Story = {parameters: {- layout: 'fullscreen',+ controls: { disable: true },docs: {description: {- component:- 'Dify toast host built on Base UI Toast. The story is organized as multiple example panels that all feed the same shared toast viewport, matching the way the Base UI documentation showcases toast behavior.',+ story:+ 'Keep the returned notification ID to update or dismiss it later, without a promise. The close callback resets the controls for another run.',},},},- tags: ['autodocs'],-} satisfies Meta<typeof ToastDocsDemo>--export default meta-type Story = StoryObj<typeof meta>--export const DocsPattern: Story = {- render: () => <ToastDocsDemo />,+ render: () => <UpdateExample />,play: async ({ canvas, canvasElement, userEvent }) => {const body = within(canvasElement.ownerDocument.body)+ await userEvent.click(canvas.getByRole('button', { name: 'Queue import' }))+ const notification = await body.findByRole('dialog', { name: 'Import queued' })+ await userEvent.click(canvas.getByRole('button', { name: 'Complete import' }))+ await expect(await body.findByRole('dialog', { name: 'Import complete' })).toBe(notification)+ await userEvent.click(canvas.getByRole('button', { name: 'Dismiss import' }))+ await waitFor(() => expect(notification).not.toBeInTheDocument())+ await expect(canvas.getByRole('button', { name: 'Queue import' })).toBeEnabled()+ },+}- await userEvent.click(canvas.getByRole('button', { name: 'Long content' }))+const longToastTitle =+ 'operation error S3: PutObject, exceeded maximum number of attempts, 3, StatusCode: 0, RequestID: , HostID: , request send failed'+const longToastDescription =+ 'Put "https://plugin/assets/1bd032bb73218a5d141b80cab7111?x-id=PutObject": dial tcp 192.168.0.200:19000: connect: connection refused, icon small en_US failed to remap assets failed to store plugin asset'- const title = await body.findByText(longToastTitle)- const description = await body.findByText(longToastDescription)- expect(title.scrollWidth).toBeLessThanOrEqual(title.clientWidth)- expect(description.scrollWidth).toBeLessThanOrEqual(description.clientWidth)+export const LongContent: Story = {+ args: { type: 'error', title: longToastTitle, description: longToastDescription },+ parameters: {+ docs: {+ description: {+ story:+ 'Long diagnostic text wraps within the card. Resize the preview to inspect the title, description, and close button at narrow widths.',+ },+ },+ },+ play: async ({ canvas, canvasElement, userEvent }) => {+ const body = within(canvasElement.ownerDocument.body)+ await userEvent.click(canvas.getByRole('button', { name: 'Show notification' }))+ const notification = await body.findByRole('dialog', { name: longToastTitle })+ await waitFor(() => expect(notification).toBeVisible())+ const title = within(notification).getByText(longToastTitle)+ const description = within(notification).getByText(longToastDescription)+ await expect(title.scrollWidth).toBeLessThanOrEqual(title.clientWidth)+ await expect(description.scrollWidth).toBeLessThanOrEqual(description.clientWidth)},}diff --git a/web/.storybook/preview.tsx b/web/.storybook/preview.tsxindex 2cbbdbe7df3..81d6a44d5c4 100644--- a/web/.storybook/preview.tsx+++ b/web/.storybook/preview.tsx@@ -2,7 +2,7 @@ import type { Decorator, Preview } from '@storybook/react'import type { Resource } from 'i18next'import { withThemeByDataAttribute } from '@storybook/addon-themes'import { QueryClient, QueryClientProvider } from '@tanstack/react-query'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'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}><>- <AppToastHost />+ <AppToaster /><Story /></></I18N>diff --git a/web/__tests__/billing/cloud-plan-payment-flow.test.tsx b/web/__tests__/billing/cloud-plan-payment-flow.test.tsxindex 6d934408b2a..a5ec1cf3ed8 100644--- a/web/__tests__/billing/cloud-plan-payment-flow.test.tsx+++ b/web/__tests__/billing/cloud-plan-payment-flow.test.tsx@@ -5,7 +5,7 @@ import userEvent from '@testing-library/user-event'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 { AppToaster } from '@/app/notifications/app-toaster'import { createConsoleQueryWrapper } from '@/test/console/query-data'import { render } from '@/test/console/render'import { createDeferred } from '@/test/deferred'@@ -48,7 +48,7 @@ const renderPlan = ({const { wrapper } = createConsoleQueryWrapper()return render(<>- <AppToastHost timeout={0} />+ <AppToaster timeout={0} /><CloudPlanItemplan={plan}billingInterval={billingInterval}diff --git a/web/app/components/app/annotation/__tests__/index.spec.tsx b/web/app/components/app/annotation/__tests__/index.spec.tsxindex 66383ce3d58..cef6973f21c 100644--- a/web/app/components/app/annotation/__tests__/index.spec.tsx+++ b/web/app/components/app/annotation/__tests__/index.spec.tsx@@ -7,7 +7,7 @@ import { 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 { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import {createCatalogModelFixture,createModelCatalogFixture,@@ -107,7 +107,7 @@ function setup(quota = { size: 0, limit: 10 }) {renderWithConsoleQuery(<NuqsTestingAdapter><Annotation appDetail={createAppDetailFixture({ id: 'app-id', mode: 'chat' })} />- <AppToastHost />+ <AppToaster /></NuqsTestingAdapter>,{queryClient,diff --git a/web/app/components/app/configuration/__tests__/configuration-flow.spec.tsx b/web/app/components/app/configuration/__tests__/configuration-flow.spec.tsxindex bb79311a23f..560074d2cce 100644--- a/web/app/components/app/configuration/__tests__/configuration-flow.spec.tsx+++ b/web/app/components/app/configuration/__tests__/configuration-flow.spec.tsx@@ -11,7 +11,7 @@ import { DETAIL_SIDEBAR_COOKIE_NAME } from '@/app/components/detail-sidebar/cookimport { PermissionType } from '@/app/components/plugins/types'import { useStore as usePluginDependenciesStore } from '@/app/components/workflow/plugin-dependency/store'import { toast } from '@/app/notifications'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import { EventEmitterContextProvider } from '@/context/event-emitter-provider'import { consoleQuery } from '@/service/console'import { createHttpError } from '@/service/http-error'@@ -183,7 +183,7 @@ function setup({ app = createApp() }: { app?: ReturnType<typeof createApp> } = {<ErrorBoundary fallback={(error) => <CommonLayoutError error={error} retry={() => {}} />}><Configuration /></ErrorBoundary>- <AppToastHost />+ <AppToaster /></EventEmitterContextProvider></UrlState>,{diff --git a/web/app/components/app/configuration/__tests__/index.spec.tsx b/web/app/components/app/configuration/__tests__/index.spec.tsxindex b69fa5596d9..25635b3d703 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 { act, render, screen } from '@testing-library/react'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import Configuration from '../index'import { toast } from '../toast'@@ -23,7 +23,7 @@ describe('Configuration', () => {it('routes configuration notifications to their own viewport', async () => {render(<>- <AppToastHost />+ <AppToaster /><Configuration /></>,)diff --git a/web/app/components/app/configuration/debug/__tests__/index.spec.tsx b/web/app/components/app/configuration/debug/__tests__/index.spec.tsxindex cbb6293ca7f..7bf1f2f0ebd 100644--- a/web/app/components/app/configuration/debug/__tests__/index.spec.tsx+++ b/web/app/components/app/configuration/debug/__tests__/index.spec.tsx@@ -12,7 +12,7 @@ import {import { FeaturesProvider } from '@/app/components/base/features/context'import { createFeaturesStore } from '@/app/components/base/features/store'import { toast } from '@/app/notifications'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import ConfigContext from '@/context/debug-configuration'import { EventEmitterContextProvider } from '@/context/event-emitter-provider'import { consoleQuery } from '@/service/console'@@ -166,8 +166,8 @@ function setup({setConfigs(next)}}/>- <AppToastHost />- <AppToastHost manager={appConfigurationToastManager} />+ <AppToaster />+ <AppToaster manager={appConfigurationToastManager} /></EventEmitterContextProvider></FeaturesProvider></ConfigContext.Provider>diff --git a/web/app/components/app/configuration/debug/debug-with-multiple-model/__tests__/index.spec.tsx b/web/app/components/app/configuration/debug/debug-with-multiple-model/__tests__/index.spec.tsxindex 9e9d5f4a4f1..08ae947c309 100644--- a/web/app/components/app/configuration/debug/debug-with-multiple-model/__tests__/index.spec.tsx+++ b/web/app/components/app/configuration/debug/debug-with-multiple-model/__tests__/index.spec.tsx@@ -10,7 +10,7 @@ import {import { FeaturesProvider } from '@/app/components/base/features/context'import { createFeaturesStore } from '@/app/components/base/features/store'import { toast } from '@/app/notifications'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import ConfigContext from '@/context/debug-configuration'import { useEventEmitterContextContext } from '@/context/event-emitter'import { EventEmitterContextProvider } from '@/context/event-emitter-provider'@@ -133,8 +133,8 @@ function setup({onOpenLog={onOpenLog}checkCanSend={checkCanSend}/>- <AppToastHost />- <AppToastHost manager={appConfigurationToastManager} />+ <AppToaster />+ <AppToaster manager={appConfigurationToastManager} /></EventEmitterContextProvider></FeaturesProvider></ConfigContext.Provider>diff --git a/web/app/components/app/configuration/debug/debug-with-single-model/__tests__/index.spec.tsx b/web/app/components/app/configuration/debug/debug-with-single-model/__tests__/index.spec.tsxindex 48cc426d855..40adf85edd5 100644--- a/web/app/components/app/configuration/debug/debug-with-single-model/__tests__/index.spec.tsx+++ b/web/app/components/app/configuration/debug/debug-with-single-model/__tests__/index.spec.tsx@@ -11,7 +11,7 @@ import {import { FeaturesProvider } from '@/app/components/base/features/context'import { createFeaturesStore } from '@/app/components/base/features/store'import { toast } from '@/app/notifications'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import ConfigContext from '@/context/debug-configuration'import { EventEmitterContextProvider } from '@/context/event-emitter-provider'import { renderWithConsoleQuery } from '@/test/console/query-data'@@ -100,8 +100,8 @@ function setup({chatContainerRef={createRef<HTMLDivElement>()}checkCanSend={checkCanSend}/>- <AppToastHost manager={appConfigurationToastManager} />- <AppToastHost />+ <AppToaster manager={appConfigurationToastManager} />+ <AppToaster /></EventEmitterContextProvider></FeaturesProvider></ConfigContext.Provider>,diff --git a/web/app/components/app/configuration/index.tsx b/web/app/components/app/configuration/index.tsxindex c88bb02cd2b..ae820ad7aaa 100644--- a/web/app/components/app/configuration/index.tsx+++ b/web/app/components/app/configuration/index.tsx@@ -1,6 +1,6 @@'use client'import * as React from 'react'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'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 (<>- <AppToastHost manager={appConfigurationToastManager} offset={{ top: 60 }} />+ <AppToaster manager={appConfigurationToastManager} offset={{ top: 60 }} /><ConfigurationView {...viewModel} /></>)diff --git a/web/app/components/app/log/__tests__/list.spec.tsx b/web/app/components/app/log/__tests__/list.spec.tsxindex b5eb8716f86..bcc72763632 100644--- a/web/app/components/app/log/__tests__/list.spec.tsx+++ b/web/app/components/app/log/__tests__/list.spec.tsx@@ -13,7 +13,7 @@ import { act, fireEvent, 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 { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import {createCatalogModelFixture,createModelCatalogFixture,@@ -218,7 +218,7 @@ function renderConversationList({const rendered = renderWithConsoleQuery(<UrlState><ConversationList appDetail={appDetail} logs={logs} onRefresh={onRefresh} />- <AppToastHost />+ <AppToaster /></UrlState>,{ queryClient: createClient() },)diff --git a/web/app/components/apps/__tests__/index.spec.tsx b/web/app/components/apps/__tests__/index.spec.tsxindex 6d39bc866f2..7e79e4c032c 100644--- a/web/app/components/apps/__tests__/index.spec.tsx+++ b/web/app/components/apps/__tests__/index.spec.tsx@@ -9,7 +9,7 @@ import { act, 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 { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import { consoleQuery } from '@/service/console'import { marketplaceQuery } from '@/service/marketplace'import { seedModelProviderQueries } from '@/test/console/model-provider'@@ -155,7 +155,7 @@ async function setup({renderWithConsoleQuery(<NuqsTestingAdapter hasMemory searchParams={api.params}><Apps />- <AppToastHost timeout={0} />+ <AppToaster timeout={0} /></NuqsTestingAdapter>,{queryClient,diff --git a/web/app/components/base/agent-log-modal/index.stories.tsx b/web/app/components/base/agent-log-modal/index.stories.tsxindex 9270a103ca1..9d2a679bb03 100644--- a/web/app/components/base/agent-log-modal/index.stories.tsx+++ b/web/app/components/base/agent-log-modal/index.stories.tsx@@ -3,7 +3,7 @@ import type { Meta, StoryObj } from '@storybook/nextjs-vite'import type { IChatItem } from '@/app/components/base/chat/chat/type'import { useEffect, useRef } from 'react'import { fn } from 'storybook/test'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import AgentLogModal from '.'const MOCK_RESPONSE: AgentLogResponse = {@@ -96,7 +96,7 @@ const AgentLogModalDemo = ({ width = 960, onCancel }: { width?: number; onCancelreturn (<>- <AppToastHost />+ <AppToaster /><div className="relative min-h-135 w-full bg-background-default-subtle p-6"><AgentLogModalappId="app-1"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 d1140bed51c..20527a377c8 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@@ -4,7 +4,7 @@ import type { ChatConfig } from '../../types'import type { AppConversationData, AppData, AppMeta, ConversationItem } from '@/models/share'import { QueryClient, QueryClientProvider } from '@tanstack/react-query'import { act, renderHook, waitFor } from '@testing-library/react'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import { useWebAppStore } from '@/context/web-app-context'import { httpErrorFromResponse } from '@/service/http-error'import {@@ -83,7 +83,7 @@ const createQueryClient = () => {const createWrapper = (queryClient: QueryClient) => {return ({ children }: { children: ReactNode }) => (<QueryClientProvider client={queryClient}>- <AppToastHost />+ <AppToaster />{children}</QueryClientProvider>)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 db42cf5d889..03e3106af41 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@@ -4,7 +4,7 @@ import type { ChatContextValue } from '../../context'import { act, render, screen, waitFor, within } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { toast } from '@/app/notifications'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import { createConsoleQueryWrapper } from '@/test/console/query-data'import { createDeferred } from '@/test/deferred'import {@@ -106,7 +106,7 @@ describe('Operation', () => {wrapper: ({ children }) => (<QueryWrapper><ChatContextProvider {...mockContextValue}>{children}</ChatContextProvider>- <AppToastHost timeout={0} />+ <AppToaster timeout={0} /></QueryWrapper>),},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 19b4ad73e37..6b9feff64c5 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@@ -7,7 +7,7 @@ import type { FileResponse } from '@/types/workflow'import { gzipSync } from 'node:zlib'import { QueryClientProvider } from '@tanstack/react-query'import { act, renderHook, waitFor } from '@testing-library/react'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import { useWebAppStore } from '@/context/web-app-context'import { consoleQuery } from '@/service/console'import {@@ -90,7 +90,7 @@ const mockGenerationConversationName = vi.mocked(generationConversationName)const createWrapper = (queryClient: QueryClient) => {return ({ children }: { children: ReactNode }) => (<QueryClientProvider client={queryClient}>- <AppToastHost />+ <AppToaster />{children}</QueryClientProvider>)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 0a4e924be01..777f97ba336 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@@ -5,7 +5,7 @@ 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 { AppToaster } from '@/app/notifications/app-toaster'import { TransferMethod } from '@/types/app'import FileUploaderInAttachmentWrapper from './index'@@ -86,7 +86,7 @@ const AttachmentDemo = (props: React.ComponentProps<typeof FileUploaderInAttachmreturn (<>- <AppToastHost />+ <AppToaster /><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 b4b399df005..9f92df778ae 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@@ -3,7 +3,7 @@ import type { FileEntity } from '../types'import type { FileUpload } from '@/app/components/base/features/types'import { useState } from 'react'import { SupportUploadFileTypes } from '@/app/components/workflow/types'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'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 (<>- <AppToastHost />+ <AppToaster /><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/image-uploader/__tests__/image-preview.spec.tsx b/web/app/components/base/image-uploader/__tests__/image-preview.spec.tsxindex fe551b1b8b4..5dac2e700ef 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@@ -2,7 +2,7 @@ import type { ComponentProps } from 'react'import { act, fireEvent, render, screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { toast } from '@/app/notifications'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import { createDeferred } from '@/test/deferred'import ImagePreview from '../image-preview'@@ -32,7 +32,7 @@ const setup = (props: Partial<ComponentProps<typeof ImagePreview>> = {}) => {onCancel={onCancel}{...props}/>- <AppToastHost timeout={0} />+ <AppToaster timeout={0} /></>,)return { user, clipboardWrite, windowOpen, download, onCancel }diff --git a/web/app/components/custom/custom-web-app-brand/__tests__/index.spec.tsx b/web/app/components/custom/custom-web-app-brand/__tests__/index.spec.tsxindex ffd582b9b17..d9b3b2f9992 100644--- a/web/app/components/custom/custom-web-app-brand/__tests__/index.spec.tsx+++ b/web/app/components/custom/custom-web-app-brand/__tests__/index.spec.tsx@@ -3,7 +3,7 @@ import { ORPCError } from '@orpc/client'import { act, screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { toast } from '@/app/notifications'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import { consoleQuery } from '@/service/console'import { createConsoleQueryClient, renderWithConsoleQuery } from '@/test/console/query-data'import { createDeferred } from '@/test/deferred'@@ -44,7 +44,7 @@ const renderBrand = ({const rendered = renderWithConsoleQuery(<><CustomWebAppBrand />- <AppToastHost timeout={0} />+ <AppToaster timeout={0} /></>,{queryClient,diff --git a/web/app/components/datasets/create/file-uploader/__tests__/index.spec.tsx b/web/app/components/datasets/create/file-uploader/__tests__/index.spec.tsxindex e81b09927a4..ff6be1bafd6 100644--- a/web/app/components/datasets/create/file-uploader/__tests__/index.spec.tsx+++ b/web/app/components/datasets/create/file-uploader/__tests__/index.spec.tsx@@ -5,7 +5,7 @@ import { act, fireEvent, screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { useState } from 'react'import { toast } from '@/app/notifications'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import { consoleQuery } from '@/service/console'import { createConsoleQueryClient, renderWithConsoleQuery } from '@/test/console/query-data'import { createDeferred } from '@/test/deferred'@@ -85,7 +85,7 @@ const setup = ({renderWithConsoleQuery(<><Owner />- <AppToastHost timeout={0} />+ <AppToaster timeout={0} /></>,{ queryClient, systemFeatures: { deployment_edition: edition } },)diff --git a/web/app/components/datasets/create/step-two/__tests__/index.spec.tsx b/web/app/components/datasets/create/step-two/__tests__/index.spec.tsxindex c03fd081bfe..07a01dfe728 100644--- a/web/app/components/datasets/create/step-two/__tests__/index.spec.tsx+++ b/web/app/components/datasets/create/step-two/__tests__/index.spec.tsx@@ -8,7 +8,7 @@ import { act, screen, waitFor, within } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { assert } from 'vite-plus/test'import { toast } from '@/app/notifications'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import DatasetDetailContext from '@/context/dataset-detail'import { DataSourceProvider } from '@/models/common'import { ChunkingMode, DataSourceType } from '@/models/datasets'@@ -114,7 +114,7 @@ async function setup(const tree = (// oxlint-disable-next-line eslint-react/no-context-provider -- use-context-selector contexts require their Provider rather than React 19 context rendering.<DatasetDetailContext.Provider value={{ dataset }}>- <AppToastHost timeout={0} />+ <AppToaster timeout={0} /><StepTwodataSourceType={DataSourceType.FILE}files={[{ id: 'file-1', name: 'handbook.pdf', extension: 'pdf' }]}diff --git a/web/app/components/datasets/documents/components/__tests__/operations.spec.tsx b/web/app/components/datasets/documents/components/__tests__/operations.spec.tsxindex 7b016f7eedf..e96877ad3b9 100644--- a/web/app/components/datasets/documents/components/__tests__/operations.spec.tsx+++ b/web/app/components/datasets/documents/components/__tests__/operations.spec.tsx@@ -4,7 +4,7 @@ import { act, screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { afterEach, beforeEach, describe, expect, it, vi } from 'vite-plus/test'import { toast } from '@/app/notifications'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import { renderWithConsoleQuery } from '@/test/console/query-data'import Operations from '../operations'@@ -63,7 +63,7 @@ const render = (ui: ReactElement) =>renderWithConsoleQuery(<>{ui}- <AppToastHost />+ <AppToaster /></>,)diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/__tests__/index.spec.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/__tests__/index.spec.tsxindex 63b9feb697f..e5863e421a3 100644--- a/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/__tests__/index.spec.tsx+++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/__tests__/index.spec.tsx@@ -2,7 +2,7 @@ import type { FileResponse } from '@dify/contracts/api/console/files/types.gen'import { screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { toast } from '@/app/notifications'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import { consoleQuery } from '@/service/console'import { createConsoleQueryClient, renderWithConsoleQuery } from '@/test/console/query-data'import { createFileUploadConfigFixture } from '@/test/fixtures/file-upload-config'@@ -46,7 +46,7 @@ const setup = ({renderWithConsoleQuery(<DataSourceContext value={store}><LocalFile allowedExtensions={allowedExtensions} supportBatchUpload={supportBatchUpload} />- <AppToastHost timeout={0} />+ <AppToaster timeout={0} /></DataSourceContext>,{ queryClient, systemFeatures: { deployment_edition: 'CLOUD' } },)diff --git a/web/app/components/datasets/documents/detail/__tests__/index.spec.tsx b/web/app/components/datasets/documents/detail/__tests__/index.spec.tsxindex 7392281deec..23819673a46 100644--- a/web/app/components/datasets/documents/detail/__tests__/index.spec.tsx+++ b/web/app/components/datasets/documents/detail/__tests__/index.spec.tsx@@ -13,7 +13,7 @@ import { act, screen, waitFor, within } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { afterEach, beforeEach, describe, expect, it, vi } from 'vite-plus/test'import { toast } from '@/app/notifications'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import DatasetDetailContext from '@/context/dataset-detail'import { EventEmitterContextProvider } from '@/context/event-emitter-provider'import { consoleQuery } from '@/service/console'@@ -106,7 +106,7 @@ const render = (ui: ReactElement) => {><EventEmitterContextProvider>{ui}- <AppToastHost timeout={0} />+ <AppToaster timeout={0} /></EventEmitterContextProvider></DatasetDetailContext.Provider>,{ queryClient, workspacePermissionKeys: [] },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 0b686206f2c..01e2bbbc4c2 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@@ -3,7 +3,7 @@ import type ImageUploader from '@/app/components/datasets/common/image-uploader/import { act, screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { toast } from '@/app/notifications'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import { ChunkingMode } from '@/models/datasets'import { renderWithConsoleQuery as render } from '@/test/console/query-data'import { IndexingType } from '../../../create/step-two'@@ -177,7 +177,7 @@ it('opens the newly created chunk through the success notification action', asynmockFullScreen = truerender(<>- <AppToastHost timeout={0} />+ <AppToaster timeout={0} /><NewSegmentModal {...props} /></>,)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 6cffe64524b..a5f40715908 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@@ -3,7 +3,7 @@ import { screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { beforeEach, expect, it, vi } from 'vite-plus/test'import { toast } from '@/app/notifications'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import { renderWithConsoleQuery as render } from '@/test/console/query-data'import NewChildSegmentModal from '../new-child-segment'@@ -124,7 +124,7 @@ it('refreshes a full document after creation and opens the new child from the tomockFullScreen = truerender(<>- <AppToastHost timeout={0} />+ <AppToaster timeout={0} /><NewChildSegmentModal {...props} /></>,)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 af9d4dfe95c..f0af02cd1ff 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@@ -4,7 +4,7 @@ import { act, screen } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { NuqsTestingAdapter } from 'nuqs/adapters/testing'import { toast } from '@/app/notifications'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import DatasetDetailContext from '@/context/dataset-detail'import { consoleQuery } from '@/service/console'import { seedModelProviderQueries } from '@/test/console/model-provider'@@ -44,7 +44,7 @@ const show = (overrides: Partial<Parameters<typeof ModifyRetrievalModal>[0]> = {<Drawer open><ModifyRetrievalModal {...props} /></Drawer>- <AppToastHost />+ <AppToaster /></DatasetDetailContext.Provider></NuqsTestingAdapter>,{ queryClient },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 0c5febbe19b..a7b534d076a 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@@ -3,7 +3,7 @@ import type { consoleClient } from '@/service/console'import { act, screen, waitFor, within } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { toast } from '@/app/notifications'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import { renderWithConsoleQuery } from '@/test/console/query-data'import { createDatasetFixture } from '@/test/fixtures/dataset'import { DatasetACLPermission } from '@/utils/permission'@@ -52,7 +52,7 @@ function setup(const onSuccess = vi.fn()renderWithConsoleQuery(<>- <AppToastHost />+ <AppToaster /><DatasetCard dataset={dataset} onSuccess={onSuccess} /></>,{diff --git a/web/app/components/goto-anything/__tests__/index.spec.tsx b/web/app/components/goto-anything/__tests__/index.spec.tsxindex 12511247653..e18e89af16b 100644--- a/web/app/components/goto-anything/__tests__/index.spec.tsx+++ b/web/app/components/goto-anything/__tests__/index.spec.tsx@@ -13,7 +13,7 @@ import { createNode } from '@/app/components/workflow/__tests__/fixtures'import { renderWorkflowFlowHook } from '@/app/components/workflow/__tests__/workflow-test-env'import { useWorkflowSearch } from '@/app/components/workflow/hooks/use-workflow-search'import { toast } from '@/app/notifications'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import { seedCurrentWorkspaceQuery } from '@/test/console/current-workspace'import { createConsoleQueryWrapper } from '@/test/console/query-data'import { createDeferred } from '@/test/deferred'@@ -146,7 +146,7 @@ function setup({ datasetOperator = false, enableSkill = true, canInstall = true<ConsoleWrapper><ThemeProvider defaultTheme="light" enableSystem={false}><GotoAnything />- <AppToastHost timeout={0} />+ <AppToaster timeout={0} /></ThemeProvider></ConsoleWrapper>,)diff --git a/web/app/components/header/account-setting/data-source-page-new/__tests__/index.spec.tsx b/web/app/components/header/account-setting/data-source-page-new/__tests__/index.spec.tsxindex dc682a87fa6..c84dd416e63 100644--- a/web/app/components/header/account-setting/data-source-page-new/__tests__/index.spec.tsx+++ b/web/app/components/header/account-setting/data-source-page-new/__tests__/index.spec.tsx@@ -12,7 +12,7 @@ import { NuqsTestingAdapter } from 'nuqs/adapters/testing'import ReadmePanel from '@/app/components/plugins/readme-panel'import { PluginCategoryEnum } from '@/app/components/plugins/types'import { toast } from '@/app/notifications'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import { consoleQuery } from '@/service/console'import { seedModelProviderQueries } from '@/test/console/model-provider'import { createConsoleQueryClient, renderWithConsoleQuery } from '@/test/console/query-data'@@ -132,7 +132,7 @@ function setup(<NuqsTestingAdapter><DataSourcePage {...props} /><ReadmePanel />- <AppToastHost />+ <AppToaster /></NuqsTestingAdapter></ThemeProvider>,{diff --git a/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/model-list-test-env.tsx b/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/model-list-test-env.tsxindex b99b52678f6..a061c7de202 100644--- a/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/model-list-test-env.tsx+++ b/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/model-list-test-env.tsx@@ -3,7 +3,7 @@ import type { ModelItem } from '../../declarations'import { zModelCredentialResponse } from '@dify/contracts/api/console/workspaces/zod.gen'import userEvent from '@testing-library/user-event'import { NuqsTestingAdapter } from 'nuqs/adapters/testing'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import { ModalContextProvider } from '@/context/modal-context-provider'import {createProviderResponseFixture,@@ -60,7 +60,7 @@ export function renderModelList({onCollapse={onCollapse}onChange={onChange}/>- <AppToastHost timeout={0} />+ <AppToaster timeout={0} /></ModalContextProvider></NuqsTestingAdapter>,{ features: { model_load_balancing_enabled: true }, workspacePermissionKeys: permissions },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 2ba21b77838..2ef30226307 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@@ -4,7 +4,7 @@ import { act, 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 { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import { ModalContextProvider } from '@/context/modal-context-provider'import { consoleQuery } from '@/service/console'import { createProviderResponseFixture } from '@/test/console/model-provider'@@ -114,7 +114,7 @@ const renderModal = (onSave={onSave}onClose={onClose}/>- <AppToastHost timeout={0} />+ <AppToaster timeout={0} /></ModalContextProvider></NuqsTestingAdapter>,{diff --git a/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/provider-card-actions.spec.tsx b/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/provider-card-actions.spec.tsxindex 9bca80d5175..8ee0e9aef6b 100644--- a/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/provider-card-actions.spec.tsx+++ b/web/app/components/header/account-setting/model-provider-page/provider-added-card/__tests__/provider-card-actions.spec.tsx@@ -7,7 +7,7 @@ import { act, screen, waitFor, within } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { PluginCategoryEnum, PluginSource } from '@/app/components/plugins/types'import { toast } from '@/app/notifications'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import { ModalContextProvider } from '@/context/modal-context-provider'import { consoleQuery } from '@/service/console'import { normalizeInstalledPluginDetail } from '@/service/use-plugins'@@ -117,7 +117,7 @@ function setup(const result = render(<ModalContextProvider><ProviderCardActions {...props} />- <AppToastHost timeout={0} />+ <AppToaster timeout={0} /></ModalContextProvider>,)return { ...result, user: userEvent.setup() }@@ -284,7 +284,7 @@ it.each(['2.0.0', '0.5.0'])(providerLabel="Provider Plugin"onUpdate={onUpdate}/>- <AppToastHost timeout={0} />+ <AppToaster timeout={0} /></ModalContextProvider>,)expect(within(dialog).getByText(`1.0.0 -> ${next}`)).toBeInTheDocument()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 a8624381854..68461e11adc 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@@ -2,7 +2,7 @@ import type { GetAccountProfileResponse } from '@dify/contracts/api/console/accoimport { QueryClientProvider } from '@tanstack/react-query'import { act, screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import { setLocaleOnClient } from '@/i18n/client'import { languages } from '@/i18n/language'import { createAccountProfileQueryClient } from '@/test/console/account-profile'@@ -58,7 +58,7 @@ const renderPage = () => {return render(<QueryClientProvider client={queryClient}><PreferencePage />- <AppToastHost />+ <AppToaster /></QueryClientProvider>,)}diff --git a/web/app/components/plugins/plugin-detail-panel/detail-header/__tests__/index.spec.tsx b/web/app/components/plugins/plugin-detail-panel/detail-header/__tests__/index.spec.tsxindex 9a82c8a652f..9806dda19b5 100644--- a/web/app/components/plugins/plugin-detail-panel/detail-header/__tests__/index.spec.tsx+++ b/web/app/components/plugins/plugin-detail-panel/detail-header/__tests__/index.spec.tsx@@ -9,7 +9,7 @@ import { act, screen, waitFor, within } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { PluginSource } from '@/app/components/plugins/types'import { toast } from '@/app/notifications'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import { ModalContextProvider } from '@/context/modal-context-provider'import { normalizeInstalledPluginDetail } from '@/service/use-plugins'import { seedModelProviderQueries } from '@/test/console/model-provider'@@ -120,7 +120,7 @@ function setup(props: Partial<ComponentProps<typeof DetailHeader>> = {}, enableMrender(<ModalContextProvider><DetailHeader detail={detail} onUpdate={onUpdate} {...props} />- <AppToastHost timeout={0} />+ <AppToaster timeout={0} /></ModalContextProvider>,enableMarketplace,)diff --git a/web/app/components/rag-pipeline/components/panel/__tests__/index.spec.tsx b/web/app/components/rag-pipeline/components/panel/__tests__/index.spec.tsxindex ba5da7e00eb..ab415f1db0d 100644--- a/web/app/components/rag-pipeline/components/panel/__tests__/index.spec.tsx+++ b/web/app/components/rag-pipeline/components/panel/__tests__/index.spec.tsx@@ -11,7 +11,7 @@ import DatasetsDetailProvider from '@/app/components/workflow/datasets-detail-stimport { useStore } from '@/app/components/workflow/store'import { BlockEnum, WorkflowRunningStatus } from '@/app/components/workflow/types'import { toast } from '@/app/notifications'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import DatasetDetailContext from '@/context/dataset-detail'import { EventEmitterContextProvider } from '@/context/event-emitter-provider'import { DatasourceType } from '@/models/pipeline'@@ -149,7 +149,7 @@ function setup(initialStoreState: Partial<Shape> = {}) {<DatasetsDetailProvider nodes={nodes}><OpenPanels /><RagPipelinePanel />- <AppToastHost timeout={0} />+ <AppToaster timeout={0} /></DatasetsDetailProvider></DatasetDetailContext.Provider></EventEmitterContextProvider>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 7b8e21e0cd8..20a64bdcccf 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@@ -7,7 +7,7 @@ import { WorkflowContext } from '@/app/components/workflow/context'import { renderEditor } from '@/app/components/workflow/editor-resource/__tests__/render'import { createWorkflowStore } from '@/app/components/workflow/store'import { toast } from '@/app/notifications'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import { expectLoadingButton } from '@/test/button'import { createDeferred } from '@/test/deferred'import { createPipelineVariable } from '@/test/pipeline-variables'@@ -47,7 +47,7 @@ function setup() {const view = (dataSourceNodeId: string) => (<QueryClientProvider client={client}><WorkflowContext value={store}>- <AppToastHost />+ <AppToaster /><DocumentProcessingdataSourceNodeId={dataSourceNodeId}onProcess={onProcess}diff --git a/web/app/components/tools/mcp/__tests__/modal.spec.tsx b/web/app/components/tools/mcp/__tests__/modal.spec.tsxindex 064c624a86a..164639d94d5 100644--- a/web/app/components/tools/mcp/__tests__/modal.spec.tsx+++ b/web/app/components/tools/mcp/__tests__/modal.spec.tsx@@ -4,7 +4,7 @@ import type { ComponentProps } from 'react'import { act, screen, waitFor } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { toast } from '@/app/notifications'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import { createHttpError } from '@/service/http-error'import { createConsoleQueryWrapper } from '@/test/console/query-data'import { createDeferred } from '@/test/deferred'@@ -43,7 +43,7 @@ const setup = (wrapper: ({ children }) => (<ConsoleWrapper>{children}- <AppToastHost timeout={0} />+ <AppToaster timeout={0} /></ConsoleWrapper>),})diff --git a/web/app/components/workflow-app/components/__tests__/workflow-panel.spec.tsx b/web/app/components/workflow-app/components/__tests__/workflow-panel.spec.tsxindex 50bea666126..644a13e4dca 100644--- a/web/app/components/workflow-app/components/__tests__/workflow-panel.spec.tsx+++ b/web/app/components/workflow-app/components/__tests__/workflow-panel.spec.tsx@@ -9,7 +9,7 @@ import { createStartNode } from '@/app/components/workflow/__tests__/fixtures'import DatasetsDetailProvider from '@/app/components/workflow/datasets-detail-store/provider'import { useStore } from '@/app/components/workflow/store'import { toast } from '@/app/notifications'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import { EventEmitterContextProvider } from '@/context/event-emitter-provider'import { seedModelProviderQueries } from '@/test/console/model-provider'import { createConsoleQueryWrapper, seedAppDetail } from '@/test/console/query-data'@@ -126,7 +126,7 @@ function setup(<DatasetsDetailProvider nodes={nodes}><OpenPanels /><WorkflowPanel />- <AppToastHost timeout={0} />+ <AppToaster timeout={0} /></DatasetsDetailProvider></EventEmitterContextProvider></FeaturesProvider>diff --git a/web/app/components/workflow/hooks/__tests__/use-checklist.spec.tsx b/web/app/components/workflow/hooks/__tests__/use-checklist.spec.tsxindex 83d255dfe61..92eef4cac37 100644--- a/web/app/components/workflow/hooks/__tests__/use-checklist.spec.tsx+++ b/web/app/components/workflow/hooks/__tests__/use-checklist.spec.tsx@@ -12,7 +12,7 @@ import { useState } from 'react'import ReactFlow, { ReactFlowProvider, useEdges, useNodes } from 'reactflow'import { CollectionType } from '@/app/components/tools/types'import { toast } from '@/app/notifications'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import { consoleQuery } from '@/service/console'import { seedModelProviderQueries } from '@/test/console/model-provider'import { createConsoleQueryWrapper } from '@/test/console/query-data'@@ -89,7 +89,7 @@ function createChecklistWrapper({ nodes, edges }: Graph, options: ChecklistOptio<ReactFlowProvider><ReactFlow nodes={nodes} edges={edges} />{children}- <AppToastHost timeout={0} />+ <AppToaster timeout={0} /></ReactFlowProvider></DatasetsDetailProvider></CatalogProvider>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 5330888dd91..6dda69d9fdd 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@@ -9,7 +9,7 @@ import {import { renderWorkflowFlowHook as renderHook } from '@/app/components/workflow/__tests__/workflow-test-env'import { BlockEnum, InputVarType, VarType } from '@/app/components/workflow/types'import { toast } from '@/app/notifications'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import { consoleClient } from '@/service/console'import useOneStepRun from '../use-one-step-run'@@ -44,7 +44,7 @@ vi.mock('@/service/console', async (importOriginal) => {})const renderUseOneStepRun = (type: BlockEnum = BlockEnum.IfElse) => {- render(createElement(AppToastHost))+ render(createElement(AppToaster))const nodes = [createStartNode({ id: 'start', data: { variables: [] } }),createNode({ id: 'if-else-node', data: { type, title: 'Test node' } }),diff --git a/web/app/layout.tsx b/web/app/layout.tsxindex 8af69ab5789..cfe6fd537a3 100644--- a/web/app/layout.tsx+++ b/web/app/layout.tsx@@ -5,7 +5,7 @@ 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 { AppToaster } from '@/app/notifications/app-toaster'import { IS_PROD } from '@/config'import { getDatasetMap } from '@/env'import AppAccessBoundary from '@/features/app-access-error/boundary'@@ -86,7 +86,7 @@ export default async function RootLayout({ children }: { children: React.ReactNo<TanStackQueryProvider><HydrationBoundary state={dehydratedState}><I18nServerProvider>- <AppToastHost timeout={5000} limit={3} />+ <AppToaster timeout={5000} limit={3} /><SystemFeaturesBootstrapBoundary><TooltipProvider delay={300} closeDelay={200}><AppAccessBoundary>{children}</AppAccessBoundary>diff --git a/web/app/notifications/__tests__/copy.browser.spec.tsx b/web/app/notifications/__tests__/copy.browser.spec.tsxindex 3601d01869a..97a9e803f8f 100644--- a/web/app/notifications/__tests__/copy.browser.spec.tsx+++ b/web/app/notifications/__tests__/copy.browser.spec.tsx@@ -1,7 +1,7 @@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'+import { AppToaster } from '../app-toaster'// 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.@@ -16,7 +16,7 @@ it('reveals a contained copy action on hover at 360px and keeps the card open af<button type="button" style={{ position: 'fixed', bottom: 16, left: 16 }}>Outside notifications</button>- <AppToastHost manager={manager} timeout={0} />+ <AppToaster manager={manager} timeout={0} /></>,)const outside = screen.getByRole('button', { name: 'Outside notifications' })@@ -61,7 +61,7 @@ it('reveals the action for keyboard focus and supports reverse tabbing', async (const manager = createToastManager()const toast = createToast(manager)try {- const screen = await render(<AppToastHost manager={manager} timeout={0} />)+ const screen = await render(<AppToaster manager={manager} timeout={0} />)toast.error('Keyboard error')const card = screen.getByRole('dialog', { name: 'Keyboard error' })const copy = screen.getByRole('button', { name: 'common.operation.copyErrorDetails' })diff --git a/web/app/notifications/__tests__/toast.spec.tsx b/web/app/notifications/__tests__/toast.spec.tsxindex fa8740515be..18ee7f2ff6f 100644--- a/web/app/notifications/__tests__/toast.spec.tsx+++ b/web/app/notifications/__tests__/toast.spec.tsx@@ -1,7 +1,7 @@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'+import { AppToaster } from '../app-toaster'const copy = vi.fn()const clipboardDescriptor = Object.getOwnPropertyDescriptor(navigator, 'clipboard')@@ -16,7 +16,7 @@ beforeEach(() => {function setup() {const manager = createToastManager()const toast = createToast(manager)- render(<AppToastHost manager={manager} timeout={0} />)+ render(<AppToaster manager={manager} timeout={0} />)const user = userEvent.setup()Object.defineProperty(navigator, 'clipboard', { configurable: true, value: { writeText: copy } })return { toast, user }@@ -137,8 +137,8 @@ it('keeps scoped managers isolated from each other', async () => {const secondToast = createToast(second)render(<>- <AppToastHost manager={first} timeout={0} />- <AppToastHost manager={second} timeout={0} />+ <AppToaster manager={first} timeout={0} />+ <AppToaster manager={second} timeout={0} /></>,)act(() => {diff --git a/web/app/notifications/host.tsx b/web/app/notifications/app-toaster.tsxsimilarity index 91%rename from web/app/notifications/host.tsxrename to web/app/notifications/app-toaster.tsxindex d5f3677f29a..c572cadb170 100644--- a/web/app/notifications/host.tsx+++ b/web/app/notifications/app-toaster.tsx@@ -5,7 +5,7 @@ import { ToastCard, Toaster, useToasts } from '@langgenius/dify-ui/toast'import { manager } from '.'import { CopyErrorAction } from './copy-error-action'-export type AppToastHostProps = {+export type AppToasterProps = {manager?: ToastManagertimeout?: numberlimit?: number@@ -27,12 +27,12 @@ function Notifications() {})}-export function AppToastHost({+export function AppToaster({manager: toastManager = manager,timeout = 5000,limit = 3,offset,-}: AppToastHostProps) {+}: AppToasterProps) {return (<Toaster toastManager={toastManager} timeout={timeout} limit={limit} offset={offset}><Notifications />diff --git a/web/app/notifications/notifications.stories.tsx b/web/app/notifications/notifications.stories.tsxindex c5707dea4b7..2d1bd2f4ccf 100644--- a/web/app/notifications/notifications.stories.tsx+++ b/web/app/notifications/notifications.stories.tsx@@ -4,7 +4,7 @@ import { createToast, createToastManager, Toaster } from '@langgenius/dify-ui/toimport { useState } from 'react'import { expect, spyOn, userEvent, within } from 'storybook/test'import { toast as globalToast } from '.'-import { AppToastHost } from './host'+import { AppToaster } from './app-toaster'type Scenario = { label: string; run: (toast: ToastApi) => void }type PlaygroundProps = {@@ -65,7 +65,7 @@ function Playground({{primitive ? (<Toaster toastManager={manager} timeout={timeout} limit={limit} />) : (- <AppToastHost manager={manager} timeout={timeout} limit={limit} />+ <AppToaster manager={manager} timeout={timeout} limit={limit} />)}</main>)@@ -515,8 +515,8 @@ function IsolatedHosts() {Dismiss right</button></div>- <AppToastHost manager={left.manager} timeout={0} offset={{ top: 180, right: '52%' }} />- <AppToastHost manager={right.manager} timeout={0} offset={{ top: 60 }} />+ <AppToaster manager={left.manager} timeout={0} offset={{ top: 180, right: '52%' }} />+ <AppToaster manager={right.manager} timeout={0} offset={{ top: 60 }} /></main>)}@@ -525,7 +525,7 @@ 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.',+ 'Uses the actual web singleton and the AppToaster already mounted by the Storybook decorator. Copy, typed calls, and dismissals use the same entrypoint as application callers.',scenarios: [{label: 'Global error',diff --git a/web/i18n/__tests__/route-loading.spec.tsx b/web/i18n/__tests__/route-loading.spec.tsxindex a4dff499f21..26295d4c01f 100644--- a/web/i18n/__tests__/route-loading.spec.tsx+++ b/web/i18n/__tests__/route-loading.spec.tsx@@ -7,7 +7,7 @@ import { renderToString } from 'react-dom/server'import { useTranslation } from 'react-i18next'import { I18nClientProvider } from '@/app/components/provider/i18n'import { I18nServerProvider } from '@/app/components/provider/i18n-server'-import { AppToastHost } from '@/app/notifications/host'+import { AppToaster } from '@/app/notifications/app-toaster'import { changeLanguage } from '../client'import { useLocale } from '../lib.client'@@ -183,7 +183,7 @@ describe('on-demand translation loading', () => {const toast = createToast(manager)const content = () => (<I18nClientProvider locale="en-US" resource={{ 'en-US': resources['en-US'] }}>- <AppToastHost manager={manager} timeout={0} />+ <AppToaster manager={manager} timeout={0} /><input aria-label="Shared draft" />{mocks.pathname === '/signin' ? <Label /> : <Destination />}</I18nClientProvider>