RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
Fix: The alias for a historical version of an agent is too long, pushing the title out of view. (#21653)
balibabu651833b6113f
diff --git a/web/AGENTS.md b/web/AGENTS.mdindex 54be7647b1..5f4959af1c 100644--- a/web/AGENTS.md+++ b/web/AGENTS.md@@ -142,6 +142,17 @@ The folder `src/components/ui/` is the project's **shared UI library** — it co- Exceptions require **explicit user approval** in the same conversation. When in doubt, ask first and propose a wrapper-based alternative.- Adding a new shared component to `src/components/ui/`, or upgrading a shadcn primitive via the official `shadcn` CLI, is allowed only when the user explicitly requests it.+### Prefer Shared Building Blocks++**Do not hand-roll ad-hoc elements when a shared component, hook, util, or constant already covers the need.** Before writing a raw styled element or a local helper, check the shared layers first:++- Interactive elements (buttons, inputs, tooltips, dialogs, pagination, …) → compose `src/components/ui/` primitives via `variant`/`size`/`className` (e.g. an icon-only action is `<Button variant="ghost" size="icon">` or `variant="static" size="auto"`, not a raw `<button className="...">`).+- Reusable logic → existing hooks in `src/hooks/` (or `ahooks`).+- Pure helpers → existing utils in `src/utils/` (or `lodash`/`dayjs`).+- Domain constant lists → the page's `constant/` directory.++Writing your own one-off version of something the shared layer already provides is a defect, not a style choice. Beyond the `ui/` primitives, `src/components/` already covers most recurring needs — empty states, truncation tooltips, confirm/rename dialogs, list-page scaffolding (filter bar, pagination, skeletons), icons, avatars, and layout wrappers — so skim `src/components/`, `src/hooks/`, and `src/utils/` before writing anything new.+### React Patterns and Conventions- **Avoid inline event handlers.** Do not define arrow functions directly on JSX event props like `onClick={() => ...}` or `onChange={(e) => ...}`. Instead, extract the handler and reference it by name (e.g., `onClick={handleClick}`). Inline handlers are recreated on every render, which can break `React.memo` optimizations and make stack traces harder to read.diff --git a/web/src/components/parser-tree-select/index.test.tsx b/web/src/components/parser-tree-select/index.test.tsxindex 23e875ade5..02ae7aa96c 100644--- a/web/src/components/parser-tree-select/index.test.tsx+++ b/web/src/components/parser-tree-select/index.test.tsx@@ -93,6 +93,29 @@ describe('ParserTreeSelect', () => {expect(container.textContent).toContain('jin');});+ it('caps the alias at 30% only in the trigger display, not in the row', () => {+ render(+ <ParserTreeSelect value="pipeline:pipe-1:v1" onChange={jest.fn()} />,+ );+ const leaf = mockTreeProps.data[0].children[0];+ expect(leaf.data).toEqual({ title: 'v1 title', alias: 'jin' });++ // textContent is matched exactly so the title span ('v1 title') and the+ // wrapper ('v1 titlejin') don't collide with the alias span ('jin').+ const findAliasSpan = (container: HTMLElement) =>+ Array.from(container.querySelectorAll('span')).find(+ (el) => el.textContent === 'jin',+ );++ const { container: trigger } = render(+ <>{mockTreeProps.renderSelected(leaf)}</>,+ );+ expect(findAliasSpan(trigger)?.className).toContain('max-w-[30%]');++ const { container: row } = render(<>{leaf.label}</>);+ expect(findAliasSpan(row)?.className).not.toContain('max-w-');+ });+it('auto-expands the branch holding the selection', () => {render(<ParserTreeSelect value="pipeline:pipe-1:v1" onChange={jest.fn()} />,diff --git a/web/src/components/parser-tree-select/index.tsx b/web/src/components/parser-tree-select/index.tsxindex b28a011f4a..06fcde5d18 100644--- a/web/src/components/parser-tree-select/index.tsx+++ b/web/src/components/parser-tree-select/index.tsx@@ -74,13 +74,26 @@ export function ParserTreeSelect({);// Reuse the leaf's rich label (title + secondary alias / builtin tag) for- // the closed-select display. While the option list is still loading the- // node is undefined — fall back to the placeholder instead of a blank.+ // the closed-select display, except for aliased versions: there the trigger+ // caps the alias at 30% of its width with an ellipsis (the dropdown row+ // keeps the full alias). While the option list is still loading the node is+ // undefined — fall back to the placeholder instead of a blank.const renderSelected = useCallback(- (node: TreeSelectNode | undefined) =>- node- ? (node.label ?? node.title)- : (placeholder ?? t('common.pleaseSelect')),+ (node: TreeSelectNode | undefined) => {+ if (!node) return placeholder ?? t('common.pleaseSelect');+ const alias = node.data?.alias;+ if (alias) {+ return (+ <span className="flex w-full min-w-0 items-center gap-1.5">+ <span className="truncate">{node.data?.title}</span>+ <span className="max-w-[30%] shrink-0 truncate text-text-secondary">+ {alias}+ </span>+ </span>+ );+ }+ return node.label ?? node.title;+ },[placeholder, t],);@@ -102,14 +115,23 @@ export function ParserTreeSelect({[t],);- // The outdated icon is pure decoration (no click action); clicks pass- // through to the trigger and open the dropdown as usual. It is hidden while- // the value is already reported as missing — a deleted pin is the stronger- // signal.+ // The outdated icon is a pure hint: the tooltip trigger swallows its own+ // click before it bubbles to the TreeSelect trigger, so clicking the icon+ // neither toggles the dropdown nor triggers the lazy version fetches that+ // follow. It is hidden while the value is already reported as missing — a+ // deleted pin is the stronger signal.+ const stopHintClick = useCallback((e: React.SyntheticEvent) => {+ e.stopPropagation();+ }, []);+const trailingAddon =outdated && (loading || selectedLeafExists) ? (- <RAGFlowTooltip tooltip={t('flow.version.outdated')}>- <AlertCircle className="size-4 text-destructive flex-shrink-0" />+ <RAGFlowTooltip+ tooltip={t('flow.version.outdated')}+ onClick={stopHintClick}+ onPointerDown={stopHintClick}+ >+ <AlertCircle className="size-4 flex-shrink-0" /></RAGFlowTooltip>) : undefined;diff --git a/web/src/components/parser-tree-select/use-parser-tree-data.tsx b/web/src/components/parser-tree-select/use-parser-tree-data.tsxindex 7582040c50..e2ae34f32c 100644--- a/web/src/components/parser-tree-select/use-parser-tree-data.tsx+++ b/web/src/components/parser-tree-select/use-parser-tree-data.tsx@@ -152,6 +152,12 @@ export function useParserTreeData({ value }: { value?: string }) {? `${version.title} ${version.alias}`: version.title,searchKeywords: version.alias ? [version.alias] : undefined,+ // The trigger display needs the alias and the unpolluted title+ // (title above has the alias joined in for search); the dropdown+ // row renders the full alias from `label` uncapped.+ data: version.alias+ ? { title: version.title, alias: version.alias }+ : undefined,label: (<span className="flex items-center gap-1.5 min-w-0"><span className="truncate">{version.title}</span>diff --git a/web/src/components/ui/tooltip.tsx b/web/src/components/ui/tooltip.tsxindex b4383839ba..d30c33ee0c 100644--- a/web/src/components/ui/tooltip.tsx+++ b/web/src/components/ui/tooltip.tsx@@ -57,10 +57,13 @@ export const FormTooltip = ({ tooltip }: { tooltip: React.ReactNode }) => {export function RAGFlowTooltip({children,tooltip,-}: React.PropsWithChildren & { tooltip: React.ReactNode }) {+ ...props+}: React.ComponentPropsWithoutRef<typeof TooltipTrigger> & {+ tooltip: React.ReactNode;+}) {return (<Tooltip>- <TooltipTrigger>{children}</TooltipTrigger>+ <TooltipTrigger {...props}>{children}</TooltipTrigger><TooltipContent>{tooltip}</TooltipContent></Tooltip>);diff --git a/web/src/hooks/__tests__/use-canvas-version-list.test.tsx b/web/src/hooks/__tests__/use-canvas-version-list.test.tsxnew file mode 100644index 0000000000..64477cc41f--- /dev/null+++ b/web/src/hooks/__tests__/use-canvas-version-list.test.tsx@@ -0,0 +1,95 @@+/*+ * Copyright 2026 The InfiniFlow Authors. All Rights Reserved.+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++import { QueryClient, QueryClientProvider } from '@tanstack/react-query';+import { renderHook, waitFor } from '@testing-library/react';+import { MemoryRouter } from 'react-router';+import {+ useFetchCanvasVersionList,+ useFetchCanvasVersions,+} from '../use-agent-request';++jest.mock('@/services/agent-service', () => ({+ __esModule: true,+ default: {+ fetchVersionList: jest.fn(),+ },+}));++// eslint-disable-next-line @typescript-eslint/no-var-requires+const agentService = require('@/services/agent-service').default;++const wrapper = ({ children }: { children: React.ReactNode }) => (+ <MemoryRouter>+ <QueryClientProvider+ client={+ new QueryClient({ defaultOptions: { queries: { retry: false } } })+ }+ >+ {children}+ </QueryClientProvider>+ </MemoryRouter>+);++beforeEach(() => {+ jest.clearAllMocks();+});++// Both version-list hooks share the 'canvasVersionList' query key, and the+// multi-canvas hook's consumers (the parser tree select) key their loading+// verdict off isSuccess. If the single-canvas hook ever seeds initialData+// again, TanStack Query applies it to the still-pending shared query and a+// pinned version briefly looks deleted — this test pins that regression.+describe('useFetchCanvasVersionList', () => {+ it('does not report success on the shared key while the fetch is pending', async () => {+ let resolveFetch: (value: unknown) => void = () => undefined;+ agentService.fetchVersionList.mockImplementation(+ () =>+ new Promise((resolve) => {+ resolveFetch = resolve;+ }),+ );++ const { result } = renderHook(+ () => ({+ single: useFetchCanvasVersionList('canvas-1'),+ multi: useFetchCanvasVersions(['canvas-1']),+ }),+ { wrapper },+ );++ // While the request is in flight there is no version data: an empty list+ // here would mean "loaded and empty", i.e. the pipeline has no versions.+ expect(result.current.single.data).toBeUndefined();+ expect(result.current.multi[0]?.isSuccess).toBe(false);++ resolveFetch({ data: { data: [{ id: 'version-1' }] } });++ await waitFor(() => {+ expect(result.current.multi[0]?.isSuccess).toBe(true);+ });+ expect(result.current.single.data).toEqual([{ id: 'version-1' }]);+ });++ it('stays disabled without a canvas id', () => {+ const { result } = renderHook(() => useFetchCanvasVersionList(undefined), {+ wrapper,+ });++ expect(result.current.data).toBeUndefined();+ expect(agentService.fetchVersionList).not.toHaveBeenCalled();+ });+});diff --git a/web/src/hooks/use-agent-request.ts b/web/src/hooks/use-agent-request.tsindex 560ef2e76d..68cf93b3a5 100644--- a/web/src/hooks/use-agent-request.ts+++ b/web/src/hooks/use-agent-request.ts@@ -830,7 +830,11 @@ const canvasVersionListQuery = (canvasId: string) => ({// useFetchCanvasVersionList lists the published versions of an arbitrary canvas// (dataflow or agent) by id. Unlike useFetchVersionList it takes the canvas id// explicitly (not from route params) so the document pipeline dialog can load-// versions for the currently selected dataflow canvas.+// versions for the currently selected dataflow canvas. It must not set+// initialData: the key is shared with useFetchCanvasVersions, whose consumers+// rely on isSuccess to tell "loaded and empty" from "still loading" — an+// initialData [] would report success while the real fetch is in flight and a+// pinned version would briefly look deleted.export const useFetchCanvasVersionList = (canvasId?: string) => {const {data,@@ -838,7 +842,6 @@ export const useFetchCanvasVersionList = (canvasId?: string) => {isError,} = useQuery({queryKey: ['canvasVersionList', canvasId],- initialData: [],gcTime: 0,enabled: !!canvasId,queryFn: async (): Promise<ICanvasVersionRow[]> => {@@ -853,9 +856,10 @@ export const useFetchCanvasVersionList = (canvasId?: string) => {// useFetchCanvasVersions lazily loads the published versions of several// canvases at once (the parser tree select fetches a canvas's versions only-// when the user expands it). Unlike useFetchCanvasVersionList it sets no-// initialData, so `isSuccess` distinguishes "loaded and empty" from "still-// loading". The returned array aligns index-by-index with `canvasIds`.+// when the user expands it). `isSuccess` distinguishes "loaded and empty" from+// "still loading" — kept truthful by neither version-list hook setting+// initialData (see useFetchCanvasVersionList). The returned array aligns+// index-by-index with `canvasIds`.export const useFetchCanvasVersions = (canvasIds: string[]) => {return useQueries({queries: canvasIds.map((canvasId) => ({diff --git a/web/src/interfaces/database/agent.ts b/web/src/interfaces/database/agent.tsindex facf4a5cc9..08ce2b73e0 100644--- a/web/src/interfaces/database/agent.ts+++ b/web/src/interfaces/database/agent.ts@@ -34,7 +34,6 @@ import { AgentCategory } from '@/constants/agent';import { Edge, Node } from '@xyflow/react';import { IReference, Message } from './chat';import { ICompilationTemplateGroup } from './compilation-template';-import { IDataset } from './dataset';export type DSLComponents = Record<string, IOperator>;@@ -83,7 +82,6 @@ export declare interface IFlow {release?: boolean;release_time?: number;last_publish_time?: number;- datasets?: Pick<IDataset, 'id' | 'name' | 'avatar'>[];tags?: string;}diff --git a/web/src/locales/en.ts b/web/src/locales/en.tsindex 56621ce788..f6d27e0230 100644--- a/web/src/locales/en.ts+++ b/web/src/locales/en.ts@@ -2913,6 +2913,7 @@ Best for: Documents with flowing, contextually connected content — such as boooperation: 'operation',run: 'Run',save: 'Save',+ saveDraft: 'Save draft',title: 'ID:',beginDescription: 'This is where the flow begins.',answerDescription: `A component that serves as the interface between human and bot, receiving user inputs and displaying the agent's responses.`,@@ -3452,6 +3453,8 @@ This delimiter is used to split the input text into several text pieces echo ofdeleteConfirmTitle: 'Delete this version?',deleteConfirmContent:'Deleting a version that a dataset or file is bound to will make that file unparseable. This cannot be undone.',+ deleteAgentConfirmContent:+ 'If this agent is embedded in a website or serving external traffic, deleting its latest published version will roll back or interrupt the live service. Your current canvas is not affected. This cannot be undone.',restore: 'Restore as current',restoreConfirmTitle: 'Restore this version as the current agent?',restoreConfirmContent:@@ -3589,7 +3592,6 @@ This process aggregates variables from multiple branches into a single variablepublishIngestionPipeline:'You are about to publish this Ingestion pipeline.',publishAgent: 'You are about to publish this agent',- linkedDataset: 'Linked dataset:',lastPublished: 'Last published',createFromBlank: 'Create from blank',createFromTemplate: 'Create from template',diff --git a/web/src/locales/zh.ts b/web/src/locales/zh.tsindex 732e41483e..7a03c9463b 100644--- a/web/src/locales/zh.ts+++ b/web/src/locales/zh.ts@@ -2485,6 +2485,8 @@ NER:使用 spaCy NER 和基于规则的关键词提取来抽取 Entities 和 RdeleteConfirmTitle: '删除该版本?',deleteConfirmContent:'若数据集或文件正绑定此版本,删除后将导致对应文件无法解析。此操作不可撤销。',+ deleteAgentConfirmContent:+ '若该智能体已嵌入网站或对外提供服务,删除最新发布版本将导致线上服务回退到更早的版本或中断。删除不影响当前画布内容,但操作不可撤销。',restore: '恢复为当前版本',restoreConfirmTitle: '恢复此版本为当前智能体?',restoreConfirmContent:@@ -2519,6 +2521,7 @@ NER:使用 spaCy NER 和基于规则的关键词提取来抽取 Entities 和 Roperation: '操作',run: '运行',save: '保存',+ saveDraft: '保存草稿',title: 'ID:',beginDescription: '这是流程开始的地方',answerDescription: `该组件用作机器人与人类之间的接口。它接收用户的输入并显示机器人的计算结果。`,@@ -3105,7 +3108,6 @@ NER:使用 spaCy NER 和基于规则的关键词提取来抽取 Entities 和 RconfirmPublish: '确认发布',publishIngestionPipeline: '您即将发布此 Ingestion pipeline。',publishAgent: '您即将发布此智能体',- linkedDataset: '已关联的知识库:',lastPublished: '上次发布时间',createFromBlank: '从空白创建',createFromTemplate: '从模板创建',diff --git a/web/src/pages/agent/components/publish-confirm-dialog.tsx b/web/src/pages/agent/components/publish-confirm-dialog.tsxindex 7b6b92f415..7a4892e54f 100644--- a/web/src/pages/agent/components/publish-confirm-dialog.tsx+++ b/web/src/pages/agent/components/publish-confirm-dialog.tsx@@ -1,7 +1,6 @@import { RAGFlowAvatar } from '@/components/ragflow-avatar';import { ButtonLoading } from '@/components/ui/button';import { IFlow } from '@/interfaces/database/agent';-import { IDataset } from '@/interfaces/database/dataset';import { formatDate } from '@/utils/date';import { BookPlus } from 'lucide-react';import { useCallback, useMemo, useState } from 'react';@@ -15,43 +14,6 @@ interface PublishConfirmDialogProps {onPublish: (alias?: string) => void;}-function AssociatedDataset({- associatedDatasets,-}: {- associatedDatasets: Pick<IDataset, 'id' | 'name' | 'avatar'>[];-}) {- const { t } = useTranslation();-- return (- <div className="space-y-2 pl-10 pt-3">- <div className="text-sm font-medium text-text-secondary">- {t('flow.linkedDataset')}- </div>- {associatedDatasets.length > 0 ? (- <div className="space-y-2 max-h-32 overflow-y-auto">- {associatedDatasets.map((dataset) => (- <div- key={dataset.id}- className="flex items-center gap-2 px-2 py-2 bg-bg-card rounded text-sm text-text-primary"- >- <RAGFlowAvatar- avatar={dataset.avatar}- name={dataset.name}- className="size-4 text-xs"- />- <span className="truncate text-text-secondary">- {dataset.name}- </span>- </div>- ))}- </div>- ) : (- <div className="text-sm text-text-disabled">{t('common.noData')}</div>- )}- </div>- );-}-export function PublishConfirmDialog({agentDetail,loading,@@ -68,11 +30,6 @@ export function PublishConfirmDialog({return '';}, [agentDetail.last_publish_time]);- // Get datasets associated with this pipeline from API response- const associatedDatasets = useMemo(() => {- return agentDetail?.datasets || [];- }, [agentDetail?.datasets]);-const handleTriggerClick = useCallback(() => {setOpen(true);}, []);@@ -106,12 +63,6 @@ export function PublishConfirmDialog({{agentDetail.title}</span></div>-- {isPipeline && (- <AssociatedDataset- associatedDatasets={associatedDatasets}- ></AssociatedDataset>- )}</section>{lastPublished && (diff --git a/web/src/pages/agent/index.tsx b/web/src/pages/agent/index.tsxindex c586738693..8f412778cc 100644--- a/web/src/pages/agent/index.tsx+++ b/web/src/pages/agent/index.tsx@@ -331,7 +331,7 @@ export default function Agent() {onClick={handleSave}loading={loading}>- <LaptopMinimalCheck /> {t('flow.save')}+ <LaptopMinimalCheck /> {t('flow.saveDraft')}</ButtonLoading>{showRunButton &&(runTooltipKey ? (diff --git a/web/src/pages/agent/version-dialog/index.tsx b/web/src/pages/agent/version-dialog/index.tsxindex 781d6f42ae..bd602bc636 100644--- a/web/src/pages/agent/version-dialog/index.tsx+++ b/web/src/pages/agent/version-dialog/index.tsx@@ -22,11 +22,7 @@ import {} from '@/components/ui/alert-dialog';import { RAGFlowPagination } from '@/components/ui/ragflow-pagination';import { Spin } from '@/components/ui/spin';-import {- Tooltip,- TooltipContent,- TooltipTrigger,-} from '@/components/ui/tooltip';+import { RAGFlowTooltip } from '@/components/ui/tooltip';import { useClientPagination } from '@/hooks/logic-hooks/use-pagination';import {useApplyVersion,@@ -58,6 +54,7 @@ import {import { useTranslation } from 'react-i18next';import { useParams } from 'react-router';import { nodeTypes } from '../canvas';+import { useIsPipeline } from '../hooks/use-is-pipeline';import { AliasFormDialog } from '../components/alias-form-dialog';import { downloadDsl } from '../utils/download-dsl';@@ -73,6 +70,7 @@ export function VersionDialog({}: IModalProps<any> & { initialName?: string; title?: ReactNode }) {const { t } = useTranslation();const { id: canvasId } = useParams();+ const isPipeline = useIsPipeline();const { data, loading } = useFetchVersionList();const [selectedId, setSelectedId] = useState<string>('');const {@@ -164,6 +162,22 @@ export function VersionDialog({}}, [agent?.dsl, agent?.title]);+ const requestRestore = useCallback(() => {+ setPending({+ kind: 'restore',+ versionId: selectedId,+ title: agent?.title ?? '',+ });+ }, [selectedId, agent?.title]);++ const requestDelete = useCallback(() => {+ setPending({+ kind: 'delete',+ versionId: selectedId,+ title: agent?.title ?? '',+ });+ }, [selectedId, agent?.title]);+const runPending = useCallback(async () => {if (!pending || !canvasId) return;if (pending.kind === 'delete') {@@ -232,26 +246,27 @@ export function VersionDialog({{/* Alias edit entry (design G2, section 4.4): PATCHesthe version metadata without creating a new version or touching the DSL.Pencil edits an existing alias, SavePlus adds one. */}- <Tooltip>- <TooltipTrigger asChild>- <button- type="button"- className="ml-auto shrink-0 text-text-secondary opacity-0 group-hover:opacity-100 hover:text-text-primary"- onClick={handleEditAlias(x.id, x.alias ?? '')}- >- {x.alias ? (- <Pencil className="size-3.5" />- ) : (- <SavePlus className="size-4" />- )}- </button>- </TooltipTrigger>- <TooltipContent>- {x.alias+ <RAGFlowTooltip+ asChild+ tooltip={+ x.alias? t('flow.version.editAlias')- : t('flow.version.addAlias')}- </TooltipContent>- </Tooltip>+ : t('flow.version.addAlias')+ }+ >+ <Button+ variant="static"+ size="auto"+ className="ml-auto opacity-0 group-hover:opacity-100"+ onClick={handleEditAlias(x.id, x.alias ?? '')}+ >+ {x.alias ? (+ <Pencil className="size-3.5" />+ ) : (+ <SavePlus className="size-4" />+ )}+ </Button>+ </RAGFlowTooltip></div></li>);@@ -274,7 +289,10 @@ export function VersionDialog({<div className="flex min-w-0 items-center"><span className="pb-1 truncate">{agent?.title}</span>{selectedAlias && (- <span className="ml-2 shrink-0 text-accent-primary text-sm">+ <span+ className="ml-2 max-w-[30%] truncate text-accent-primary text-sm"+ title={selectedAlias}+ >{selectedAlias}</span>)}@@ -286,41 +304,42 @@ export function VersionDialog({</div><div className="flex items-center gap-2">- <Button- variant={'ghost'}- onClick={downloadFile}- title={t('flow.version.download')}+ <RAGFlowTooltip+ asChild+ tooltip={t('flow.version.download')}>- <ArrowDownToLine />- </Button>- <Button- variant={'ghost'}- onClick={() =>- setPending({- kind: 'restore',- versionId: selectedId,- title: agent?.title ?? '',- })- }- title={t('flow.version.restore')}- disabled={!selectedId || applyRestoring}+ <Button+ variant={'ghost'}+ onClick={downloadFile}+ disabled={!selectedId}+ >+ <ArrowDownToLine />+ </Button>+ </RAGFlowTooltip>+ <RAGFlowTooltip+ asChild+ tooltip={t('flow.version.restore')}>- <RotateCcw />- </Button>- <Button- variant={'ghost'}- onClick={() =>- setPending({- kind: 'delete',- versionId: selectedId,- title: agent?.title ?? '',- })- }- title={t('flow.version.delete')}- disabled={!selectedId || deleting}+ <Button+ variant={'ghost'}+ onClick={requestRestore}+ disabled={!selectedId || applyRestoring}+ >+ <RotateCcw />+ </Button>+ </RAGFlowTooltip>+ <RAGFlowTooltip+ asChild+ tooltip={t('flow.version.delete')}>- <Trash2 />- </Button>+ <Button+ variant={'ghost'}+ onClick={requestDelete}+ disabled={!selectedId || deleting}+ >+ <Trash2 />+ </Button>+ </RAGFlowTooltip></div></section><section className="relative flex-1">@@ -369,7 +388,17 @@ export function VersionDialog({onOpenChange={handlePendingOpenChange}onOk={runPending}title={t('flow.version.deleteConfirmTitle')}- content={{ node: t('flow.version.deleteConfirmContent') }}+ // Pipeline versions can be pinned by datasets/files, so deleting one+ // breaks parsing; agent (workflow) versions are only historical DSL+ // snapshots, where the real risk is rolling back what embedded sites+ // and external callers are serving.+ content={{+ node: t(+ isPipeline+ ? 'flow.version.deleteConfirmContent'+ : 'flow.version.deleteAgentConfirmContent',+ ),+ }}/><AlertDialogdiff --git a/web/src/pages/dataset/setting/index.tsx b/web/src/pages/dataset/setting/index.tsxindex 222745fcdd..e598b78010 100644--- a/web/src/pages/dataset/setting/index.tsx+++ b/web/src/pages/dataset/setting/index.tsx@@ -143,14 +143,23 @@ export default function DatasetSetting() {// options have loaded, revalidate explicitly — the saved parser or pinned// version may have been deleted, and the error should be visible before// submit. Re-running on selection changes clears the error as soon as a- // valid option is picked. (Same pattern as ModelTreeSelectFormField.)+ // valid option is picked. parserOptionMissing is a dep too: the verdict can+ // flip without a loading/selection transition (e.g. version data arriving+ // for an already-idle tree), and the RHF error is sticky until revalidated.+ // (Same pattern as ModelTreeSelectFormField.)const trigger = form.trigger;const parserFieldName =parseType === ParseType.Pipeline ? 'pipeline_id' : 'parser_id';useEffect(() => {if (parserOptionsLoading || !parserSelectValue) return;trigger(parserFieldName);- }, [trigger, parserOptionsLoading, parserSelectValue, parserFieldName]);+ }, [+ trigger,+ parserOptionsLoading,+ parserSelectValue,+ parserFieldName,+ parserOptionMissing,+ ]);const pipelineParserConfig = knowledgeDetails?.parser_config as| Record<string, any>