From 9e13e339b8d55363b4c6831720f306f874abf010 Mon Sep 17 00:00:00 2001
From: yyh <92089059+lyzno1@users.noreply.github.com>
Date: Sun, 20 Sep 2026 01:40:49 +0000
Subject: [PATCH 01/29] feat(ui): add reusable breadcrumbs and migrate Web
navigation (#42534)
---
lint.config.ts | 9 +
packages/dify-ui/README.md | 2 +-
packages/dify-ui/docs/authoring.md | 8 +
packages/dify-ui/package.json | 4 +
packages/dify-ui/src/alert-dialog/index.tsx | 2 +-
packages/dify-ui/src/autocomplete/index.tsx | 2 +-
.../src/breadcrumb/__tests__/types.tsx | 42 +
.../dify-ui/src/breadcrumb/index.stories.tsx | 300 +++++
packages/dify-ui/src/breadcrumb/index.tsx | 97 ++
.../src/button/__tests__/index.spec.tsx | 2 +-
packages/dify-ui/src/checkbox/index.tsx | 2 +-
.../dify-ui/src/collapsible/index.stories.tsx | 4 +-
packages/dify-ui/src/combobox/index.tsx | 2 +-
.../src/context-menu/__tests__/index.spec.tsx | 2 +-
packages/dify-ui/src/context-menu/index.tsx | 2 +-
packages/dify-ui/src/dialog/index.tsx | 2 +-
packages/dify-ui/src/drawer/index.tsx | 2 +-
.../dropdown-menu/__tests__/index.spec.tsx | 2 +-
packages/dify-ui/src/dropdown-menu/index.tsx | 2 +-
packages/dify-ui/src/icon-button/index.tsx | 2 +-
packages/dify-ui/src/input-group/index.tsx | 2 +-
packages/dify-ui/src/kbd/index.tsx | 2 +-
packages/dify-ui/src/number-field/index.tsx | 2 +-
packages/dify-ui/src/popover/index.tsx | 2 +-
.../src/preview-card/__tests__/index.spec.tsx | 2 +-
packages/dify-ui/src/preview-card/index.tsx | 2 +-
packages/dify-ui/src/radio-group/index.tsx | 2 +-
.../src/scroll-area/__tests__/index.spec.tsx | 2 +-
.../dify-ui/src/scroll-area/index.stories.tsx | 2 +-
.../__tests__/index.spec.tsx | 2 +-
.../dify-ui/src/segmented-control/index.tsx | 2 +-
packages/dify-ui/src/select/index.tsx | 2 +-
packages/dify-ui/src/spinner/index.tsx | 4 +-
packages/dify-ui/src/status-dot/index.tsx | 2 +-
packages/dify-ui/src/switch/index.tsx | 2 +-
.../src/textarea/__tests__/index.spec.tsx | 2 +-
packages/dify-ui/src/textarea/index.tsx | 2 +-
packages/dify-ui/src/toast/index.tsx | 2 +-
.../src/tooltip/__tests__/index.spec.tsx | 2 +-
packages/dify-ui/src/tooltip/index.tsx | 2 +-
packages/dify-ui/tsconfig.json | 1 +
.../components/app-sidebar/app-detail-top.tsx | 53 +-
.../app-sidebar/dataset-detail-top.tsx | 53 +-
.../add-member-or-group-pop.spec.tsx | 10 +-
.../group-picker-layout.browser.spec.tsx | 62 +
.../add-member-or-group-pop/breadcrumb.tsx | 98 +-
.../add-member-or-group-pop/index.tsx | 10 +-
.../breadcrumbs/__tests__/bucket.spec.tsx | 46 -
.../breadcrumbs/__tests__/drive.spec.tsx | 63 -
.../breadcrumbs/__tests__/index.spec.tsx | 1157 +++--------------
.../breadcrumbs/__tests__/item.spec.tsx | 48 -
.../file-list/header/breadcrumbs/bucket.tsx | 78 +-
.../file-list/header/breadcrumbs/drive.tsx | 28 +-
.../dropdown/__tests__/index.spec.tsx | 819 ------------
.../dropdown/__tests__/item.spec.tsx | 54 -
.../dropdown/__tests__/menu.spec.tsx | 89 --
.../header/breadcrumbs/dropdown/index.tsx | 65 +-
.../header/breadcrumbs/dropdown/item.tsx | 21 -
.../header/breadcrumbs/dropdown/menu.tsx | 27 -
.../file-list/header/breadcrumbs/index.tsx | 116 +-
.../file-list/header/breadcrumbs/item.tsx | 65 +-
.../marketplace/creator-profile/view.tsx | 45 +-
.../snippet-list/__tests__/index.spec.tsx | 4 +
web/app/components/snippet-list/index.tsx | 37 +-
.../__tests__/snippet-detail-top.spec.tsx | 38 +
.../components/snippet-detail-top.tsx | 63 +-
.../single-run-form.browser.spec.tsx | 41 +
.../components/single-run-form.tsx | 43 +-
.../__tests__/agent-log-nav.browser.spec.tsx | 39 +
.../workflow/run/agent-log/agent-log-nav.tsx | 112 +-
.../working-directory-breadcrumb.spec.tsx | 16 +-
.../preview/working-directory-breadcrumb.tsx | 134 +-
.../agent-v2/agent-detail/navigation.tsx | 50 +-
.../new-rag/knowledge-space-shell.tsx | 46 +-
web/features/skills/detail/file-tree.tsx | 47 +-
75 files changed, 1489 insertions(+), 2721 deletions(-)
create mode 100644 packages/dify-ui/src/breadcrumb/__tests__/types.tsx
create mode 100644 packages/dify-ui/src/breadcrumb/index.stories.tsx
create mode 100644 packages/dify-ui/src/breadcrumb/index.tsx
create mode 100644 web/app/components/app/app-access-control/__tests__/group-picker-layout.browser.spec.tsx
delete mode 100644 web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/__tests__/bucket.spec.tsx
delete mode 100644 web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/__tests__/drive.spec.tsx
delete mode 100644 web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/__tests__/item.spec.tsx
delete mode 100644 web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/dropdown/__tests__/index.spec.tsx
delete mode 100644 web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/dropdown/__tests__/item.spec.tsx
delete mode 100644 web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/dropdown/__tests__/menu.spec.tsx
delete mode 100644 web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/dropdown/item.tsx
delete mode 100644 web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/dropdown/menu.tsx
create mode 100644 web/app/components/snippets/components/__tests__/snippet-detail-top.spec.tsx
create mode 100644 web/app/components/workflow/nodes/human-input/components/__tests__/single-run-form.browser.spec.tsx
create mode 100644 web/app/components/workflow/run/agent-log/__tests__/agent-log-nav.browser.spec.tsx
diff --git a/lint.config.ts b/lint.config.ts
index bf84dec886b..e543a0a153f 100644
--- a/lint.config.ts
+++ b/lint.config.ts
@@ -1153,6 +1153,15 @@ export const lintConfig = {
{
files: ['packages/dify-ui/**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}'],
rules: {
+ 'unicorn/import-style': [
+ 'error',
+ {
+ extendDefaultStyles: false,
+ styles: {
+ react: { namespace: true },
+ },
+ },
+ ],
'react/exhaustive-deps': [
'error',
{
diff --git a/packages/dify-ui/README.md b/packages/dify-ui/README.md
index d124e42c99f..e27216366bc 100644
--- a/packages/dify-ui/README.md
+++ b/packages/dify-ui/README.md
@@ -43,7 +43,7 @@ Import `styles.css` once from the consumer's root stylesheet or entrypoint.
| Form | `./form`, `./field`, `./fieldset`, `./input`, `./input-group`, `./textarea`, `./checkbox`, `./checkbox-group`, `./radio-group`, `./number-field`, `./select`, `./slider`, `./switch` |
| Layout | `./scroll-area` |
| Media | `./avatar` |
-| Navigation | `./file-tree`, `./pagination`, `./tabs` |
+| Navigation | `./breadcrumb`, `./file-tree`, `./pagination`, `./tabs` |
| Overlay and menu | `./alert-dialog`, `./context-menu`, `./dialog`, `./drawer`, `./dropdown-menu`, `./popover`, `./preview-card`, `./tooltip` |
| Search and pick | `./autocomplete`, `./combobox`, `./select` |
diff --git a/packages/dify-ui/docs/authoring.md b/packages/dify-ui/docs/authoring.md
index 536b744c872..20bcce9d05f 100644
--- a/packages/dify-ui/docs/authoring.md
+++ b/packages/dify-ui/docs/authoring.md
@@ -5,6 +5,14 @@ module-local and publish the complete surface through separate `export { ... }`
`export type { ... }` manifests at the bottom of the file. Do not mix scattered inline exports
with the manifest or use wildcard exports.
+## React imports
+
+Use React namespace imports throughout this package, including stories and tests. Use
+`import * as React from 'react'` when calling React runtime APIs, and
+`import type * as React from 'react'` when referencing only React types. A runtime namespace
+import also covers React types; do not add separate named type imports. JSX alone does not
+require an explicit React import.
+
## Subpaths and names
Every public primitive needs a matching `package.json#exports` subpath. Import relatively between
diff --git a/packages/dify-ui/package.json b/packages/dify-ui/package.json
index 8084254b75f..9d60deb5639 100644
--- a/packages/dify-ui/package.json
+++ b/packages/dify-ui/package.json
@@ -21,6 +21,10 @@
"types": "./src/avatar/index.tsx",
"import": "./src/avatar/index.tsx"
},
+ "./breadcrumb": {
+ "types": "./src/breadcrumb/index.tsx",
+ "import": "./src/breadcrumb/index.tsx"
+ },
"./button": {
"types": "./src/button/index.tsx",
"import": "./src/button/index.tsx"
diff --git a/packages/dify-ui/src/alert-dialog/index.tsx b/packages/dify-ui/src/alert-dialog/index.tsx
index 9789d2f6740..0e5f8ce2e73 100644
--- a/packages/dify-ui/src/alert-dialog/index.tsx
+++ b/packages/dify-ui/src/alert-dialog/index.tsx
@@ -1,8 +1,8 @@
'use client'
+import type * as React from 'react'
import type { ButtonProps } from '../button'
import { AlertDialog as BaseAlertDialog } from '@base-ui/react/alert-dialog'
-import * as React from 'react'
import { Button } from '../button'
import { cn } from '../cn'
import { modalBackdropClassName, modalPopupAnimationClassName } from '../overlay-shared'
diff --git a/packages/dify-ui/src/autocomplete/index.tsx b/packages/dify-ui/src/autocomplete/index.tsx
index 3d1fc3f4c29..6dd17fadd9f 100644
--- a/packages/dify-ui/src/autocomplete/index.tsx
+++ b/packages/dify-ui/src/autocomplete/index.tsx
@@ -1,10 +1,10 @@
'use client'
import type { VariantProps } from 'class-variance-authority'
+import type * as React from 'react'
import type { Placement } from '../placement'
import { Autocomplete as BaseAutocomplete } from '@base-ui/react/autocomplete'
import { cva } from 'class-variance-authority'
-import * as React from 'react'
import { cn } from '../cn'
import { textControlCompoundInputFocusClassName } from '../form-control-shared'
import {
diff --git a/packages/dify-ui/src/breadcrumb/__tests__/types.tsx b/packages/dify-ui/src/breadcrumb/__tests__/types.tsx
new file mode 100644
index 00000000000..69cfc7a45fe
--- /dev/null
+++ b/packages/dify-ui/src/breadcrumb/__tests__/types.tsx
@@ -0,0 +1,42 @@
+import {
+ Breadcrumb,
+ BreadcrumbItem,
+ BreadcrumbLink,
+ BreadcrumbList,
+ BreadcrumbPage,
+ BreadcrumbSeparator,
+} from '@langgenius/dify-ui/breadcrumb'
+
+export function breadcrumbTypeContracts() {
+ const labelled =
+ const referenced =
+ const link = } aria-current="page" />
+
+ // @ts-expect-error A navigation name must be supplied by the consumer.
+ const unnamed =
+ // @ts-expect-error Choose one accessible naming mechanism.
+ const duplicateName =
+ // @ts-expect-error Structural parts do not expose render.
+ const rootRender = } />
+ // @ts-expect-error List semantics are fixed.
+ const listRender = } />
+ // @ts-expect-error Item semantics are fixed.
+ const itemRender = } />
+ // @ts-expect-error Use BreadcrumbLink for an interactive current page.
+ const pageRender = } />
+ // @ts-expect-error Customize decorative content through children.
+ const separatorRender = } />
+
+ return {
+ labelled,
+ referenced,
+ link,
+ unnamed,
+ duplicateName,
+ rootRender,
+ listRender,
+ itemRender,
+ pageRender,
+ separatorRender,
+ }
+}
diff --git a/packages/dify-ui/src/breadcrumb/index.stories.tsx b/packages/dify-ui/src/breadcrumb/index.stories.tsx
new file mode 100644
index 00000000000..13b2483cc98
--- /dev/null
+++ b/packages/dify-ui/src/breadcrumb/index.stories.tsx
@@ -0,0 +1,300 @@
+import type { Meta, StoryObj } from '@storybook/react-vite'
+import * as React from 'react'
+import { expect, waitFor, within } from 'storybook/test'
+import {
+ Breadcrumb,
+ BreadcrumbItem,
+ BreadcrumbLink,
+ BreadcrumbList,
+ BreadcrumbPage,
+ BreadcrumbSeparator,
+} from '.'
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuTrigger,
+} from '../dropdown-menu'
+import { IconButton } from '../icon-button'
+
+const meta = {
+ title: 'Base/UI/Breadcrumb',
+ component: Breadcrumb,
+ parameters: {
+ layout: 'centered',
+ a11y: { config: { rules: [{ id: 'color-contrast', enabled: true }] } },
+ docs: {
+ description: {
+ component:
+ 'Explicit navigation anatomy with a required localized aria-label or aria-labelledby. ' +
+ 'Separators are decorative list siblings. Only BreadcrumbLink supports render, for components that forward props and refs to an anchor. ' +
+ 'Current links remain interactive; BreadcrumbPage is static text. No route inference, automatic separators, truncation, or collapsing. ' +
+ 'The default layout is a single row with consistent typography and tertiary ancestor links / primary current text. ' +
+ 'Consumers own typography overrides, available width, and overflow handling.',
+ },
+ },
+ },
+ args: { 'aria-label': 'Breadcrumb' },
+ decorators: [
+ (Story) => (
+
+
+
+ ),
+ ],
+} satisfies Meta
+
+export default meta
+type Story = StoryObj
+
+export const Default: Story = {
+ render: (args) => (
+
+
+
+ Home
+
+
+
+ Knowledge
+
+
+
+ Product documents
+
+
+
+ ),
+ play: async ({ canvas, userEvent }) => {
+ const navigation = within(canvas.getByRole('navigation', { name: 'Breadcrumb' }))
+ await expect(navigation.getAllByRole('listitem')).toHaveLength(3)
+ const home = navigation.getByRole('link', { name: 'Home' })
+ home.focus()
+ await userEvent.tab()
+ await expect(navigation.getByRole('link', { name: 'Knowledge' })).toHaveFocus()
+ await expect(navigation.getByText('Product documents')).toHaveAttribute('aria-current', 'page')
+ },
+}
+
+export const CurrentPageLink: Story = {
+ render: (args) => (
+
+
+
+ Home
+
+
+
+
+ Documents
+
+
+
+
+ ),
+ play: async ({ canvas, userEvent }) => {
+ canvas.getByRole('link', { name: 'Home' }).focus()
+ await userEvent.tab()
+ const current = canvas.getByRole('link', { name: 'Documents', current: 'page' })
+ await expect(current).toHaveFocus()
+ await expect(current).toHaveAttribute('href', '#documents')
+ await expect(current).not.toHaveAttribute('aria-disabled')
+ },
+}
+
+function StoryLink({ children, ...props }: React.ComponentProps<'a'>) {
+ return {children}
+}
+
+function RenderLinkExample() {
+ const ref = React.useRef(null)
+ return (
+
+
+
+
+ }>
+ Projects
+
+
+
+
+ Design system
+
+
+
+
+
+ )
+}
+
+export const RenderLink: Story = {
+ render: () => ,
+ play: async ({ canvas, userEvent }) => {
+ await userEvent.click(canvas.getByRole('button', { name: 'Focus project link' }))
+ await expect(canvas.getByRole('link', { name: 'Projects' })).toHaveFocus()
+ await expect(canvas.getByRole('link', { name: 'Projects' })).toHaveAttribute(
+ 'href',
+ '#projects',
+ )
+ },
+}
+
+export const LabelledBy: Story = {
+ render: () => (
+
+
+ Project location
+
+
+
+
+ Projects
+
+
+
+ Design system
+
+
+
+
+ ),
+}
+
+export const RightToLeft: Story = {
+ render: () => (
+
+
+
+ الرئيسية
+
+
+
+
+
+ المعرفة
+
+
+
+
+
+ المستندات
+
+
+
+ ),
+}
+
+export const TruncatedLabel: Story = {
+ parameters: {
+ docs: {
+ description: {
+ story:
+ 'The consumer constrains one item and truncates its text, leaving the anchor focus outline and its full accessible name intact.',
+ },
+ },
+ },
+ render: (args) => (
+
+
+
+ Home
+
+
+
+
+ Research and development documentation
+
+
+
+
+ Overview
+
+
+
+ ),
+}
+
+export const CollapsedAncestors: Story = {
+ parameters: {
+ docs: {
+ description: {
+ story:
+ 'Collapsing is an explicit DropdownMenu composition. Its trigger owns the accessible name; hidden ancestors remain links. Escape restores focus to the trigger.',
+ },
+ },
+ },
+ render: (args) => (
+
+
+
+ Home
+
+
+
+
+
+
+
+ }
+ />
+
+ }>Projects
+ }>Knowledge
+
+
+
+
+
+ Documents
+
+
+
+ ),
+ play: async ({ canvas, canvasElement, userEvent }) => {
+ const trigger = canvas.getByRole('button', { name: 'Show ancestor pages' })
+ trigger.focus()
+ await userEvent.keyboard('{Enter}')
+ const body = within(canvasElement.ownerDocument.body)
+ await expect(await body.findByRole('menuitem', { name: 'Projects' })).toBeVisible()
+ await userEvent.keyboard('{Escape}')
+ await waitFor(() => expect(trigger).toHaveFocus())
+ },
+}
+
+export const Dark: Story = {
+ ...Default,
+ globals: { theme: 'dark' },
+}
+
+export const Typography: Story = {
+ parameters: {
+ docs: {
+ description: {
+ story:
+ 'Set typography on the list to change the size and weight of every item together. Links and current text inherit these styles.',
+ },
+ },
+ },
+ render: () => (
+
+
+
+ Documentation
+
+
+
+ Getting started
+
+
+
+ ),
+}
diff --git a/packages/dify-ui/src/breadcrumb/index.tsx b/packages/dify-ui/src/breadcrumb/index.tsx
new file mode 100644
index 00000000000..91fdf4bc092
--- /dev/null
+++ b/packages/dify-ui/src/breadcrumb/index.tsx
@@ -0,0 +1,97 @@
+'use client'
+
+import type * as React from 'react'
+import { mergeProps } from '@base-ui/react/merge-props'
+import { useRender } from '@base-ui/react/use-render'
+import { cn } from '../cn'
+
+type BreadcrumbName =
+ | { 'aria-label': string; 'aria-labelledby'?: never }
+ | { 'aria-label'?: never; 'aria-labelledby': string }
+
+type BreadcrumbProps = Omit, 'aria-label' | 'aria-labelledby'> &
+ BreadcrumbName
+type BreadcrumbListProps = React.ComponentProps<'ol'>
+type BreadcrumbItemProps = React.ComponentProps<'li'>
+type BreadcrumbLinkProps = useRender.ComponentProps<'a'>
+type BreadcrumbPageProps = React.ComponentProps<'span'>
+type BreadcrumbSeparatorProps = React.ComponentProps<'li'>
+
+function Breadcrumb({ className, ...props }: BreadcrumbProps) {
+ return
+}
+
+function BreadcrumbList({ className, ...props }: BreadcrumbListProps) {
+ return (
+
+ )
+}
+
+function BreadcrumbItem({ className, ...props }: BreadcrumbItemProps) {
+ return
+}
+
+function BreadcrumbLink({ className, render, ...props }: BreadcrumbLinkProps) {
+ return useRender({
+ defaultTagName: 'a',
+ render,
+ props: mergeProps<'a'>(
+ {
+ className: cn(
+ 'inline-flex min-w-0 items-center gap-1 rounded-sm whitespace-nowrap text-text-tertiary hover:text-text-secondary focus-visible:ring-2 focus-visible:ring-state-accent-solid focus-visible:outline-hidden aria-[current=page]:text-text-primary',
+ className,
+ ),
+ },
+ props,
+ ),
+ })
+}
+
+function BreadcrumbPage({ className, ...props }: BreadcrumbPageProps) {
+ return (
+
+ )
+}
+
+function BreadcrumbSeparator({ children = '/', className, ...props }: BreadcrumbSeparatorProps) {
+ return (
+
+ {children}
+
+ )
+}
+
+export {
+ Breadcrumb,
+ BreadcrumbItem,
+ BreadcrumbLink,
+ BreadcrumbList,
+ BreadcrumbPage,
+ BreadcrumbSeparator,
+}
+export type {
+ BreadcrumbItemProps,
+ BreadcrumbLinkProps,
+ BreadcrumbListProps,
+ BreadcrumbPageProps,
+ BreadcrumbProps,
+ BreadcrumbSeparatorProps,
+}
diff --git a/packages/dify-ui/src/button/__tests__/index.spec.tsx b/packages/dify-ui/src/button/__tests__/index.spec.tsx
index e58d031af6d..4e871ad27c8 100644
--- a/packages/dify-ui/src/button/__tests__/index.spec.tsx
+++ b/packages/dify-ui/src/button/__tests__/index.spec.tsx
@@ -1,4 +1,4 @@
-import * as React from 'react'
+import type * as React from 'react'
import { userEvent } from 'vite-plus/test/browser'
import { render } from 'vitest-browser-react'
import { Button } from '../index'
diff --git a/packages/dify-ui/src/checkbox/index.tsx b/packages/dify-ui/src/checkbox/index.tsx
index 70222dee054..e7c57be6a84 100644
--- a/packages/dify-ui/src/checkbox/index.tsx
+++ b/packages/dify-ui/src/checkbox/index.tsx
@@ -1,8 +1,8 @@
'use client'
import type { Checkbox as BaseCheckboxNS } from '@base-ui/react/checkbox'
+import type * as React from 'react'
import { Checkbox as BaseCheckbox } from '@base-ui/react/checkbox'
-import * as React from 'react'
import { cn } from '../cn'
const checkboxRootClassName = cn(
diff --git a/packages/dify-ui/src/collapsible/index.stories.tsx b/packages/dify-ui/src/collapsible/index.stories.tsx
index b9a050abe0b..6949bff074d 100644
--- a/packages/dify-ui/src/collapsible/index.stories.tsx
+++ b/packages/dify-ui/src/collapsible/index.stories.tsx
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from '@storybook/react-vite'
import type { CollapsiblePanelProps } from '.'
-import { useState } from 'react'
+import * as React from 'react'
import { expect, waitFor } from 'storybook/test'
import { Collapsible, CollapsiblePanel, CollapsibleTrigger } from '.'
import { Button } from '../button'
@@ -156,7 +156,7 @@ export const IconButtonTrigger: Story = {
}
function ControlledDemo() {
- const [open, setOpen] = useState(true)
+ const [open, setOpen] = React.useState(true)
return (
- }
- />
-
-
-
-
-
-
-
-
/
-
+ <>
+
+
+ $['operation.more'], { ns: 'common' })}
+ className="data-popup-open:bg-state-base-hover"
+ >
+
+
+ }
+ />
+
+ {breadcrumbs.map((breadcrumb, index) => (
+ onBreadcrumbClick(startIndex + index)}
+ >
+ {breadcrumb}
+
+ ))}
+
+
+
+
+ >
)
}
diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/dropdown/item.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/dropdown/item.tsx
deleted file mode 100644
index 27fd12e210a..00000000000
--- a/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/dropdown/item.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import { DropdownMenuItem } from '@langgenius/dify-ui/dropdown-menu'
-import * as React from 'react'
-
-type ItemProps = {
- name: string
- index: number
- onBreadcrumbClick: (index: number) => void
-}
-
-const Item = ({ name, index, onBreadcrumbClick }: ItemProps) => {
- return (
-
onBreadcrumbClick(index)}
- >
- {name}
-
- )
-}
-
-export default React.memo(Item)
diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/dropdown/menu.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/dropdown/menu.tsx
deleted file mode 100644
index 6ceb016c2b6..00000000000
--- a/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/dropdown/menu.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-import * as React from 'react'
-import Item from './item'
-
-type MenuProps = {
- breadcrumbs: string[]
- startIndex: number
- onBreadcrumbClick: (index: number) => void
-}
-
-const Menu = ({ breadcrumbs, startIndex, onBreadcrumbClick }: MenuProps) => {
- return (
-
- {breadcrumbs.map((breadcrumb, index) => {
- return (
-
- )
- })}
-
- )
-}
-
-export default React.memo(Menu)
diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/index.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/index.tsx
index 051aff77cdb..a1f1da2aff2 100644
--- a/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/index.tsx
+++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/index.tsx
@@ -1,3 +1,4 @@
+import { Breadcrumb, BreadcrumbList } from '@langgenius/dify-ui/breadcrumb'
import * as React from 'react'
import { useCallback, useMemo } from 'react'
import { useTranslation } from 'react-i18next'
@@ -94,7 +95,7 @@ const Breadcrumbs = ({
)
return (
-
+
{showSearchResult && (
{t(($) => $['onlineDrive.breadcrumbs.searchResult'], {
@@ -110,64 +111,63 @@ const Breadcrumbs = ({
)}
{!showSearchResult && !showBucketListTitle && (
-
- {hasBucket && bucket && (
- 0}
- />
- )}
- {!hasBucket && }
- {!breadcrumbsConfig.needCollapsed && (
- <>
- {breadcrumbsConfig.original.map((breadcrumb, index) => {
- const isLast = index === breadcrumbsConfig.original.length - 1
- return (
-
- )
- })}
- >
- )}
- {breadcrumbsConfig.needCollapsed && (
- <>
- {breadcrumbsConfig.prefixBreadcrumbs.map((breadcrumb, index) => {
- return (
-
- )
- })}
- $['onlineDrive.breadcrumbs.allFiles'], { ns: 'datasetPipeline' })}
+ className="w-full"
+ >
+
+ {hasBucket && bucket && (
+
-
- >
- )}
-
+ )}
+ {!hasBucket &&
}
+ {!breadcrumbsConfig.needCollapsed && (
+ <>
+ {breadcrumbsConfig.original.map((breadcrumb, index) => {
+ const isLast = index === breadcrumbsConfig.original.length - 1
+ return (
+
handleClickBreadcrumb(index)}
+ name={breadcrumb}
+ title={breadcrumb}
+ current={isLast}
+ />
+ )
+ })}
+ >
+ )}
+ {breadcrumbsConfig.needCollapsed && (
+ <>
+ {breadcrumbsConfig.prefixBreadcrumbs.map((breadcrumb, index) => {
+ return (
+ handleClickBreadcrumb(index)}
+ name={breadcrumb}
+ title={breadcrumb}
+ />
+ )
+ })}
+
+ handleClickBreadcrumb(breadcrumbs.length - 1)}
+ name={breadcrumbsConfig.lastBreadcrumb!}
+ title={breadcrumbsConfig.lastBreadcrumb!}
+ current
+ />
+ >
+ )}
+
+
)}
)
diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/item.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/item.tsx
index 4d564b7c5d0..14ef7736794 100644
--- a/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/item.tsx
+++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/online-drive/file-list/header/breadcrumbs/item.tsx
@@ -1,50 +1,39 @@
+import { BreadcrumbSeparator, BreadcrumbItem as PathItem } from '@langgenius/dify-ui/breadcrumb'
import { cn } from '@langgenius/dify-ui/cn'
-import * as React from 'react'
-import { useCallback } from 'react'
type BreadcrumbItemProps = {
name: string
- index: number
- handleClick: (index: number) => void
- disabled?: boolean
- isActive?: boolean
- showSeparator?: boolean
+ onClick: () => void
+ current?: boolean
+ title?: string
}
-const BreadcrumbItem = ({
+export default function BreadcrumbItem({
name,
- index,
- handleClick,
- disabled = false,
- isActive = false,
- showSeparator = true,
-}: BreadcrumbItemProps) => {
- const handleClickItem = useCallback(() => {
- if (!disabled) handleClick(index)
- }, [disabled, handleClick, index])
-
+ onClick,
+ current = false,
+ title,
+}: BreadcrumbItemProps) {
return (
<>
-
- {name}
-
- {showSeparator &&
/}
+
+
+ {name}
+
+
+ {!current &&
}
>
)
}
-
-BreadcrumbItem.displayName = 'BreadcrumbItem'
-
-export default React.memo(BreadcrumbItem)
diff --git a/web/app/components/plugins/marketplace/creator-profile/view.tsx b/web/app/components/plugins/marketplace/creator-profile/view.tsx
index e93f490f187..1df52782886 100644
--- a/web/app/components/plugins/marketplace/creator-profile/view.tsx
+++ b/web/app/components/plugins/marketplace/creator-profile/view.tsx
@@ -9,7 +9,16 @@ import type {
CreatorProfileViewModel,
} from './model'
import type { Plugin } from '@/app/components/plugins/types'
+import {
+ Breadcrumb,
+ BreadcrumbItem,
+ BreadcrumbLink,
+ BreadcrumbList,
+ BreadcrumbPage,
+ BreadcrumbSeparator,
+} from '@langgenius/dify-ui/breadcrumb'
import { cn } from '@langgenius/dify-ui/cn'
+import { iconButtonVariants } from '@langgenius/dify-ui/icon-button'
import { useTranslation } from '#i18n'
import Link from '@/next/link'
import DefaultCreatorBackground from './assets/default-background.png'
@@ -51,24 +60,28 @@ export default function CreatorProfileView({
isMarketplacePlatform ? 'md:px-6' : 'md:px-9',
)}
>
-
+
+
+ }
+ aria-label={t(($) => $['marketplace.creatorProfile.home'], { ns: 'plugin' })}
+ className={iconButtonVariants({ size: 'md' })}
+ >
+
+
+
+
+
+
+ {t(($) => $['marketplace.creatorProfile.title'], { ns: 'plugin' })}
+
+
+
+
{
expect(screen.getByRole('link', { name: 'common.menus.apps' })).toHaveAttribute('href', '/apps')
expect(screen.getByRole('heading', { name: 'workflow.tabs.snippets' })).toBeInTheDocument()
+ const path = within(screen.getByRole('navigation', { name: 'workflow.tabs.snippets' }))
+ expect(path.getByRole('link', { name: 'common.menus.apps' })).toHaveAttribute('href', '/apps')
+ expect(path.getAllByRole('listitem')).toHaveLength(2)
+ expect(path.getByText('workflow.tabs.snippets')).toHaveAttribute('aria-current', 'page')
expect(screen.getByText('app.studio.filters.creators')).toBeInTheDocument()
expect(
screen.getByRole('button', { name: /workflow\.common\.published \/ snippet\.draft/i }),
diff --git a/web/app/components/snippet-list/index.tsx b/web/app/components/snippet-list/index.tsx
index b5b0a4ddc85..3525e97f5d6 100644
--- a/web/app/components/snippet-list/index.tsx
+++ b/web/app/components/snippet-list/index.tsx
@@ -2,6 +2,14 @@
import type { SnippetPublishStatus } from './components/snippet-publish-status-filter'
import type { SnippetListItem } from '@/types/snippet'
+import {
+ Breadcrumb,
+ BreadcrumbItem,
+ BreadcrumbLink,
+ BreadcrumbList,
+ BreadcrumbPage,
+ BreadcrumbSeparator,
+} from '@langgenius/dify-ui/breadcrumb'
import { Button } from '@langgenius/dify-ui/button'
import { cn } from '@langgenius/dify-ui/cn'
import { useDebounce } from 'ahooks'
@@ -180,18 +188,23 @@ const SnippetList = () => {
>
-
- {t(($) => $['menus.apps'], { ns: 'common' })}
-
- /
-
- {t(($) => $['tabs.snippets'], { ns: 'workflow' })}
-
- >
+ $['tabs.snippets'], { ns: 'workflow' })}>
+
+
+ } className="block truncate">
+ {t(($) => $['menus.apps'], { ns: 'common' })}
+
+
+
+
+
+
+ {t(($) => $['tabs.snippets'], { ns: 'workflow' })}
+
+
+
+
+
}
>
diff --git a/web/app/components/snippets/components/__tests__/snippet-detail-top.spec.tsx b/web/app/components/snippets/components/__tests__/snippet-detail-top.spec.tsx
new file mode 100644
index 00000000000..200ae07fe34
--- /dev/null
+++ b/web/app/components/snippets/components/__tests__/snippet-detail-top.spec.tsx
@@ -0,0 +1,38 @@
+import { render, screen, within } from '@testing-library/react'
+import userEvent from '@testing-library/user-event'
+import { SnippetDetailTop } from '../snippet-detail-top'
+
+const back = vi.fn()
+vi.mock('@/next/navigation', () => ({
+ useRouter: () => ({ back }),
+}))
+
+beforeEach(() => {
+ vi.clearAllMocks()
+})
+
+it('keeps browser history separate from the home and snippet collection destinations', async () => {
+ const user = userEvent.setup()
+ render(
)
+ const path = within(screen.getByRole('navigation', { name: 'workflow.tabs.snippets' }))
+ expect(path.getAllByRole('listitem')).toHaveLength(2)
+ expect(path.getByRole('link', { name: 'common.mainNav.home' })).toHaveAttribute('href', '/')
+ const collection = path.getByRole('link', { name: 'workflow.tabs.snippets' })
+ expect(collection).toHaveAttribute('href', '/snippets')
+ expect(collection).not.toHaveAttribute('aria-current')
+
+ const previous = path.getByRole('button', { name: 'common.operation.back' })
+ previous.focus()
+ await user.keyboard('{Enter}')
+ expect(back).toHaveBeenCalledOnce()
+})
+
+it('removes the path when collapsed while retaining the expand control', async () => {
+ const user = userEvent.setup()
+ const onToggle = vi.fn()
+ const { rerender } = render(
)
+ rerender(
)
+ expect(screen.queryByRole('navigation')).not.toBeInTheDocument()
+ await user.click(screen.getByRole('button', { name: 'layout.sidebar.expandSidebar' }))
+ expect(onToggle).toHaveBeenCalledOnce()
+})
diff --git a/web/app/components/snippets/components/snippet-detail-top.tsx b/web/app/components/snippets/components/snippet-detail-top.tsx
index 9efa7f2b393..ac2b11ca18c 100644
--- a/web/app/components/snippets/components/snippet-detail-top.tsx
+++ b/web/app/components/snippets/components/snippet-detail-top.tsx
@@ -1,6 +1,14 @@
'use client'
+import {
+ Breadcrumb,
+ BreadcrumbItem,
+ BreadcrumbLink,
+ BreadcrumbList,
+ BreadcrumbSeparator,
+} from '@langgenius/dify-ui/breadcrumb'
import { DialogTrigger } from '@langgenius/dify-ui/dialog'
+import { IconButton } from '@langgenius/dify-ui/icon-button'
import { Kbd, KbdGroup } from '@langgenius/dify-ui/kbd'
import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip'
import { formatForDisplay } from '@tanstack/react-hotkeys'
@@ -37,32 +45,35 @@ export function SnippetDetailTop({ expand = true, onToggle }: SnippetDetailTopPr
return (
-
-
- $['operation.back'], { ns: 'common' })}
- className="flex size-4 items-center justify-center text-text-tertiary hover:text-text-secondary"
- onClick={() => router.back()}
- >
-
-
- $['mainNav.home'], { ns: 'common' })}
- className="flex size-4 items-center justify-center text-text-tertiary hover:text-text-secondary"
- >
-
-
-
-
/
-
- {t(($) => $['tabs.snippets'], { ns: 'workflow' })}
-
-
+
$['tabs.snippets'], { ns: 'workflow' })} className="flex-1">
+
+
+ $['operation.back'], { ns: 'common' })}
+ onClick={() => router.back()}
+ >
+
+
+ }
+ aria-label={t(($) => $['mainNav.home'], { ns: 'common' })}
+ className="size-4 justify-center"
+ >
+
+
+
+
+
+ }
+ className="rounded-lg px-1.5 py-2 system-sm-semibold-uppercase text-text-secondary hover:bg-background-default-hover hover:text-text-primary"
+ >
+ {t(($) => $['tabs.snippets'], { ns: 'workflow' })}
+
+
+
+
{
+ const { createReactI18nextMock } = await import('@/test/i18n-mock')
+ return createReactI18nextMock({ 'workflow.nodes.humanInput.singleRun.back': 'Back' })
+})
+
+it('keeps the full node name inside the form panel', async () => {
+ const name = 'Research and development platform engineering operations team'
+ const screen = await render(
+
+ {}}
+ data={{
+ form_id: 'form',
+ node_id: 'node',
+ node_title: name,
+ form_content: '',
+ inputs: [],
+ actions: [],
+ form_token: 'token',
+ resolved_default_values: {},
+ display_in_ui: true,
+ expiration_time: 0,
+ }}
+ />
+
,
+ )
+ const navigation = screen.getByRole('navigation', { name }).element()
+ const bounds = navigation.getBoundingClientRect()
+ const text = document.createRange()
+ text.selectNodeContents(screen.getByText(name, { exact: true }).element())
+ for (const line of text.getClientRects()) {
+ expect(line.right).toBeLessThanOrEqual(bounds.right)
+ expect(line.bottom).toBeLessThanOrEqual(bounds.bottom)
+ }
+ expect(navigation.scrollWidth).toBeLessThanOrEqual(navigation.clientWidth)
+})
diff --git a/web/app/components/workflow/nodes/human-input/components/single-run-form.tsx b/web/app/components/workflow/nodes/human-input/components/single-run-form.tsx
index 6579ec1df1f..3700a8765d6 100644
--- a/web/app/components/workflow/nodes/human-input/components/single-run-form.tsx
+++ b/web/app/components/workflow/nodes/human-input/components/single-run-form.tsx
@@ -2,8 +2,14 @@
import type { HumanInputFieldValue } from '@/app/components/base/chat/chat/answer/human-input-content/field-renderer'
import type { UserAction } from '@/app/components/workflow/nodes/human-input/types'
import type { HumanInputFormData } from '@/types/workflow'
+import {
+ Breadcrumb,
+ BreadcrumbItem,
+ BreadcrumbList,
+ BreadcrumbPage,
+ BreadcrumbSeparator,
+} from '@langgenius/dify-ui/breadcrumb'
import { Button } from '@langgenius/dify-ui/button'
-import { RiArrowLeftLine } from '@remixicon/react'
import * as React from 'react'
import { useState } from 'react'
import { useTranslation } from 'react-i18next'
@@ -56,18 +62,29 @@ const FormContent = ({ nodeName, data, showBackButton, handleBack, onSubmit }: P
return (
<>
{showBackButton && (
-
-
-
- {t(($) => $['nodes.humanInput.singleRun.back'], { ns: 'workflow' })}
-
-
/
-
{nodeName}
-
+
+
+
+
+
+ {t(($) => $['nodes.humanInput.singleRun.back'], { ns: 'workflow' })}
+
+
+
+
+
+ {nodeName}
+
+
+
+
)}
{contentList.map((content, index) => (
diff --git a/web/app/components/workflow/run/agent-log/__tests__/agent-log-nav.browser.spec.tsx b/web/app/components/workflow/run/agent-log/__tests__/agent-log-nav.browser.spec.tsx
new file mode 100644
index 00000000000..e7751c1a2a5
--- /dev/null
+++ b/web/app/components/workflow/run/agent-log/__tests__/agent-log-nav.browser.spec.tsx
@@ -0,0 +1,39 @@
+import type { AgentLogItemWithChildren } from '@/types/workflow'
+import { render } from 'vitest-browser-react'
+import { AgentLogNav } from '../agent-log-nav'
+
+vi.mock('react-i18next', async () => {
+ const { createReactI18nextMock } = await import('@/test/i18n-mock')
+ return createReactI18nextMock({ 'workflow.nodes.agent.strategy.label': 'Strategy' })
+})
+
+it('keeps a long current log name readable inside the result panel', async () => {
+ const label = 'Research and development platform engineering operations team'
+ const item: AgentLogItemWithChildren = {
+ message_id: 'tool',
+ label,
+ children: [],
+ status: 'succeeded',
+ node_execution_id: 'exec',
+ node_id: 'node',
+ data: {},
+ }
+ const screen = await render(
+
,
+ )
+ const navigation = screen.getByRole('navigation').element()
+ const current = screen.getByText(label).element()
+ const text = document.createRange()
+ text.selectNodeContents(current)
+ const bounds = navigation.getBoundingClientRect()
+ for (const line of text.getClientRects()) {
+ expect(line.right).toBeLessThanOrEqual(bounds.right)
+ expect(line.bottom).toBeLessThanOrEqual(bounds.bottom)
+ }
+ expect(navigation.scrollWidth).toBeLessThanOrEqual(navigation.clientWidth)
+})
diff --git a/web/app/components/workflow/run/agent-log/agent-log-nav.tsx b/web/app/components/workflow/run/agent-log/agent-log-nav.tsx
index 5237356f9e6..b86f3561dc3 100644
--- a/web/app/components/workflow/run/agent-log/agent-log-nav.tsx
+++ b/web/app/components/workflow/run/agent-log/agent-log-nav.tsx
@@ -1,4 +1,11 @@
import type { AgentLogItemWithChildren } from '@/types/workflow'
+import {
+ Breadcrumb,
+ BreadcrumbItem,
+ BreadcrumbList,
+ BreadcrumbPage,
+ BreadcrumbSeparator,
+} from '@langgenius/dify-ui/breadcrumb'
import { Button } from '@langgenius/dify-ui/button'
import { useTranslation } from 'react-i18next'
import AgentLogNavMore from './agent-log-nav-more'
@@ -15,47 +22,68 @@ export function AgentLogNav({ agentOrToolLogItemStack, onShowAgentOrToolLog }: A
const end = agentOrToolLogItemStack.at(-1)
return (
-
-
{
- onShowAgentOrToolLog()
- }}
- >
-
- AGENT
-
-
/
- {agentOrToolLogItemStackLength > 1 ? (
-
onShowAgentOrToolLog(first)}
- >
- {t(($) => $['nodes.agent.strategy.label'], { ns: 'workflow' })}
-
- ) : (
-
- {t(($) => $['nodes.agent.strategy.label'], { ns: 'workflow' })}
-
- )}
- {!!mid.length && (
- <>
-
/
-
- >
- )}
- {!!end && agentOrToolLogItemStackLength > 1 && (
- <>
-
/
-
- {end.label}
-
- >
- )}
-
+
$['nodes.agent.strategy.label'], { ns: 'workflow' })}
+ className="flex min-h-8 items-center bg-components-panel-bg p-1 pr-3"
+ >
+
+
+ {
+ onShowAgentOrToolLog()
+ }}
+ >
+
+ AGENT
+
+
+
+ {agentOrToolLogItemStackLength > 1 ? (
+
+ onShowAgentOrToolLog(first)}
+ >
+ {t(($) => $['nodes.agent.strategy.label'], { ns: 'workflow' })}
+
+
+ ) : (
+
+
+ {t(($) => $['nodes.agent.strategy.label'], { ns: 'workflow' })}
+
+
+ )}
+ {!!mid.length && (
+ <>
+
+
+
+
+ >
+ )}
+ {!!end && agentOrToolLogItemStackLength > 1 && (
+ <>
+
+
+
+ {end.label}
+
+
+ >
+ )}
+
+
)
}
diff --git a/web/features/agent-v2/agent-detail/configure/components/preview/__tests__/working-directory-breadcrumb.spec.tsx b/web/features/agent-v2/agent-detail/configure/components/preview/__tests__/working-directory-breadcrumb.spec.tsx
index cf327f5687e..8e17c335b5b 100644
--- a/web/features/agent-v2/agent-detail/configure/components/preview/__tests__/working-directory-breadcrumb.spec.tsx
+++ b/web/features/agent-v2/agent-detail/configure/components/preview/__tests__/working-directory-breadcrumb.spec.tsx
@@ -16,13 +16,13 @@ describe('AgentWorkingDirectoryBreadcrumb', () => {
name: 'agentV2.agentDetail.configure.workingDirectory.breadcrumbLabel',
}),
).toBeInTheDocument()
- expect(screen.getByRole('button', { name: '.' })).toHaveAttribute('aria-current', 'page')
+ expect(screen.getByRole('button', { name: '.' })).toHaveAttribute('aria-current', 'location')
})
it('should render the saved-files root path', () => {
render(
)
- expect(screen.getByRole('button', { name: '~' })).toHaveAttribute('aria-current', 'page')
+ expect(screen.getByRole('button', { name: '~' })).toHaveAttribute('aria-current', 'location')
})
it('should render the saved-files prefix before its path segments', () => {
@@ -33,17 +33,21 @@ describe('AgentWorkingDirectoryBreadcrumb', () => {
screen.getByRole('button', {
name: 'web-game',
}),
- ).toHaveAttribute('aria-current', 'page')
+ ).toHaveAttribute('aria-current', 'location')
})
it('should collapse middle breadcrumb layers when path is deeper than three layers', () => {
render(
)
+ expect(screen.getAllByRole('listitem')).toHaveLength(4)
expect(screen.getByRole('button', { name: '~' })).toBeInTheDocument()
- expect(screen.getByRole('button', { name: '...' })).toBeInTheDocument()
+ expect(screen.getByRole('button', { name: 'common.operation.more' })).toBeInTheDocument()
expect(screen.queryByRole('button', { name: 'web-game' })).not.toBeInTheDocument()
expect(screen.getByRole('button', { name: 'src' })).toBeInTheDocument()
- expect(screen.getByRole('button', { name: 'app' })).toHaveAttribute('aria-current', 'page')
+ expect(screen.getByRole('button', { name: 'app' })).toHaveAttribute(
+ 'aria-current',
+ 'location',
+ )
})
})
@@ -80,7 +84,7 @@ describe('AgentWorkingDirectoryBreadcrumb', () => {
/>,
)
- await user.click(screen.getByRole('button', { name: '...' }))
+ await user.click(screen.getByRole('button', { name: 'common.operation.more' }))
await user.click(
screen.getByRole('menuitem', {
name: 'web-game',
diff --git a/web/features/agent-v2/agent-detail/configure/components/preview/working-directory-breadcrumb.tsx b/web/features/agent-v2/agent-detail/configure/components/preview/working-directory-breadcrumb.tsx
index 786147eed09..325be1f4519 100644
--- a/web/features/agent-v2/agent-detail/configure/components/preview/working-directory-breadcrumb.tsx
+++ b/web/features/agent-v2/agent-detail/configure/components/preview/working-directory-breadcrumb.tsx
@@ -1,5 +1,11 @@
'use client'
+import {
+ Breadcrumb,
+ BreadcrumbItem,
+ BreadcrumbList,
+ BreadcrumbSeparator,
+} from '@langgenius/dify-ui/breadcrumb'
import { cn } from '@langgenius/dify-ui/cn'
import {
DropdownMenu,
@@ -7,6 +13,8 @@ import {
DropdownMenuItem,
DropdownMenuTrigger,
} from '@langgenius/dify-ui/dropdown-menu'
+import { IconButton } from '@langgenius/dify-ui/icon-button'
+import { Fragment } from 'react'
import { useTranslation } from 'react-i18next'
export const AGENT_SAVED_FILES_ROOT_PATH = '~'
@@ -101,7 +109,7 @@ function AgentWorkingDirectoryBreadcrumbItem({
(
-
- /
-
- )
-
return (
-
+ {hiddenItems.map((hiddenItem) => (
+
onPathChange(hiddenItem.path)}
+ >
+
+
+ {hiddenItem.label}
+
+
+ ))}
+
+
+
+
+ >
+ )}
+
+ onPathChange(item.path)}
+ />
+
+
+ )
+ })}
+
+
)
}
diff --git a/web/features/agent-v2/agent-detail/navigation.tsx b/web/features/agent-v2/agent-detail/navigation.tsx
index dce91202121..22b345c48c5 100644
--- a/web/features/agent-v2/agent-detail/navigation.tsx
+++ b/web/features/agent-v2/agent-detail/navigation.tsx
@@ -4,6 +4,13 @@ import type { AgentIconType } from '@dify/contracts/api/console/agent/types.gen'
import type { ComponentProps } from 'react'
import type { AgentDetailSectionKey } from './section'
import type { NavIcon } from '@/app/components/app-sidebar/nav-link'
+import {
+ Breadcrumb,
+ BreadcrumbItem,
+ BreadcrumbLink,
+ BreadcrumbList,
+ BreadcrumbSeparator,
+} from '@langgenius/dify-ui/breadcrumb'
import { cn } from '@langgenius/dify-ui/cn'
import { DialogTrigger } from '@langgenius/dify-ui/dialog'
import { Kbd, KbdGroup } from '@langgenius/dify-ui/kbd'
@@ -110,23 +117,32 @@ export function AgentDetailTop({ expand = true, onToggle }: AgentDetailTopProps)
return (
-
- $['mainNav.home'])}
- className="flex shrink-0 items-center rounded-lg py-2 pr-1.5 pl-0.5 text-text-tertiary transition-colors hover:bg-background-default-hover hover:text-text-secondary focus-visible:ring-2 focus-visible:ring-state-accent-solid focus-visible:outline-hidden"
- >
-
-
-
- /
-
- Agents
-
-
+
$['roster.title'], { ns: 'agentV2' })}
+ className="flex-1"
+ >
+
+
+ }
+ aria-label={tCommon(($) => $['mainNav.home'])}
+ className="gap-0 rounded-lg py-2 pr-1.5 pl-0.5 hover:bg-background-default-hover"
+ >
+
+
+
+
+
+
+ }
+ className="rounded-lg px-1.5 py-2 system-sm-semibold-uppercase text-text-secondary hover:bg-background-default-hover hover:text-text-primary"
+ >
+ Agents
+
+
+
+