Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix: By default, the wiki page does not display the wiki content on the right. (#19388)

balibabudbba3ba00d04
diff --git a/web/src/locales/en.ts b/web/src/locales/en.ts
index 5e8723a06b..e16c2a5890 100644
--- a/web/src/locales/en.ts
+++ b/web/src/locales/en.ts
@@ -2396,7 +2396,6 @@ Example: Virtual Hosted Style`,
noStructureTimeline: 'No timeline yet',
contents: 'Navigation',
topics: 'Topics',
- selectArtifact: 'Select an item from the contents to view details',
searchEntity: 'Search entity',
graphEntityCount: '{{returned}} / {{total}} entities',
sourceDocuments: 'Source documents',
diff --git a/web/src/locales/zh.ts b/web/src/locales/zh.ts
index 1211703c3d..b322fbaed1 100644
--- a/web/src/locales/zh.ts
+++ b/web/src/locales/zh.ts
@@ -2016,7 +2016,6 @@ NER:使用 spaCy NER 和基于规则的关键词提取来抽取 Entities 和 R
noStructureTimeline: '暂无 Timeline',
contents: '导航',
topics: 'Topic',
- selectArtifact: '从目录中选择一个条目以查看详情',
searchEntity: '搜索 Entity',
graphEntityCount: '实体 {{returned}} / {{total}}',
sourceDocuments: '来源文档',
diff --git a/web/src/pages/dataset/compilation/hooks/use-wiki-detail-content.ts b/web/src/pages/dataset/compilation/hooks/use-wiki-detail-content.ts
index d09b59db00..3f79098f00 100644
--- a/web/src/pages/dataset/compilation/hooks/use-wiki-detail-content.ts
+++ b/web/src/pages/dataset/compilation/hooks/use-wiki-detail-content.ts
@@ -14,7 +14,7 @@ import { useWikiEditor } from './use-wiki-editor';
import { useWikiLinkNavigation } from './use-wiki-link-navigation';
type UseWikiDetailContentOptions = {
- selectedArtifact: IArtifact | null;
+ selectedArtifact: IArtifact;
selectedVersion: IWikiCommit | null;
onSelectVersion: (version: IWikiCommit | null) => void;
onSelectArtifact: (artifact: IArtifact) => void;
@@ -58,7 +58,7 @@ export function useWikiDetailContent({
// before onSelectArtifact(), so currentEntry.slug already matches by the
// time this effect runs and we bail out.
useEffect(() => {
- if (isVersionView || !selectedArtifact) return;
+ if (isVersionView) return;
if (currentEntry?.slug === selectedArtifact.slug) return;
reset({
@@ -69,9 +69,9 @@ export function useWikiDetailContent({
// oxlint-disable-next-line react/exhaustive-deps
}, [
isVersionView,
- selectedArtifact?.slug,
- selectedArtifact?.title,
- selectedArtifact?.page_type,
+ selectedArtifact.slug,
+ selectedArtifact.title,
+ selectedArtifact.page_type,
currentEntry?.slug,
reset,
]);
@@ -83,7 +83,7 @@ export function useWikiDetailContent({
const title =
currentEntry?.title ||
pageData?.title ||
- selectedArtifact?.title ||
+ selectedArtifact.title ||
currentEntry?.slug ||
'';
@@ -98,8 +98,8 @@ export function useWikiDetailContent({
const previousEntryTitle = previousEntry?.title || previousEntry?.slug;
const editorKey = isVersionView
- ? `${selectedArtifact?.slug}@${selectedVersion?.id}`
- : (selectedArtifact?.slug ?? '');
+ ? `${selectedArtifact.slug}@${selectedVersion?.id}`
+ : selectedArtifact.slug;
const handleMarkdownLinkClick = useCallback(
(pageType: WikiPageType, slug: string) => {
@@ -121,13 +121,7 @@ export function useWikiDetailContent({
push({ slug, title: '', pageType });
onSelectArtifact({ slug, page_type: pageType, title: '' });
},
- [
- push,
- onSelectArtifact,
- currentEntry,
- pageData,
- updateCurrentTitle,
- ],
+ [push, onSelectArtifact, currentEntry, pageData, updateCurrentTitle],
);
const handleBack = useCallback(() => {
@@ -161,8 +155,8 @@ export function useWikiDetailContent({
const { isOpen, open, setIsOpen, form, handleConfirm, isUpdating } =
useCommitArtifact({
editedContent,
- pageType: currentEntry?.pageType ?? selectedArtifact?.page_type ?? '',
- slug: currentEntry?.slug ?? selectedArtifact?.slug ?? '',
+ pageType: currentEntry?.pageType ?? selectedArtifact.page_type ?? '',
+ slug: currentEntry?.slug ?? selectedArtifact.slug,
onSuccess: handleCommitSuccess,
});
diff --git a/web/src/pages/dataset/compilation/llm-wiki-view.tsx b/web/src/pages/dataset/compilation/llm-wiki-view.tsx
index d9ce278fe0..784fcf6715 100644
--- a/web/src/pages/dataset/compilation/llm-wiki-view.tsx
+++ b/web/src/pages/dataset/compilation/llm-wiki-view.tsx
@@ -85,7 +85,7 @@ export function LlmWikiView() {
return (
<Card className="flex-1 min-h-0 overflow-hidden flex border-border-button rounded-xl flex-col">
<ResizablePanelGroup direction="horizontal" className="flex-1">
- <ResizablePanel defaultSize={33} minSize={20} maxSize={50}>
+ <ResizablePanel id="wiki-left" order={1} defaultSize={50}>
<WikiLeftPanel
tab={leftTab}
onTabChange={handleLeftTabChange}
@@ -98,15 +98,19 @@ export function LlmWikiView() {
traceData={artifactRunData}
/>
</ResizablePanel>
- <ResizableHandle withHandle />
- <ResizablePanel>
- <WikiDetailContent
- selectedArtifact={selectedArtifact}
- selectedVersion={selectedVersion}
- onSelectVersion={selectVersion}
- onSelectArtifact={handleSelectArtifact}
- />
- </ResizablePanel>
+ {selectedArtifact && (
+ <>
+ <ResizableHandle withHandle />
+ <ResizablePanel id="wiki-detail" order={2}>
+ <WikiDetailContent
+ selectedArtifact={selectedArtifact}
+ selectedVersion={selectedVersion}
+ onSelectVersion={selectVersion}
+ onSelectArtifact={handleSelectArtifact}
+ />
+ </ResizablePanel>
+ </>
+ )}
</ResizablePanelGroup>
</Card>
);
diff --git a/web/src/pages/dataset/compilation/wiki-detail-content.tsx b/web/src/pages/dataset/compilation/wiki-detail-content.tsx
index 9a25c5ad75..479bd60f70 100644
--- a/web/src/pages/dataset/compilation/wiki-detail-content.tsx
+++ b/web/src/pages/dataset/compilation/wiki-detail-content.tsx
@@ -1,6 +1,3 @@
-import { useTranslation } from 'react-i18next';
-
-import Empty from '@/components/empty/empty';
import { IArtifact, IWikiCommit } from '@/interfaces/database/dataset';
import { useWikiDetailContent } from './hooks/use-wiki-detail-content';
@@ -10,7 +7,7 @@ import { WikiDetailHeader } from './wiki-detail-header';
import { WikiDetailToolbar } from './wiki-detail-toolbar';
type WikiDetailContentProps = {
- selectedArtifact: IArtifact | null;
+ selectedArtifact: IArtifact;
selectedVersion: IWikiCommit | null;
onSelectVersion: (version: IWikiCommit | null) => void;
onSelectArtifact: (artifact: IArtifact) => void;
@@ -22,7 +19,6 @@ export function WikiDetailContent({
onSelectVersion,
onSelectArtifact,
}: WikiDetailContentProps) {
- const { t } = useTranslation();
const {
isVersionView,
title,
@@ -68,47 +64,36 @@ export function WikiDetailContent({
return (
<section className="size-full min-w-0 flex flex-col">
- {selectedArtifact ? (
- <>
- <WikiDetailHeader
- title={title}
- displayedArtifact={displayedArtifact}
- commitDetail={commitDetail}
- isVersionView={isVersionView}
- toolbar={toolbar}
- canGoBack={canGoBack}
- previousEntryTitle={previousEntryTitle}
- linkNavLoading={linkNavLoading}
- onBack={handleBack}
- />
+ <WikiDetailHeader
+ title={title}
+ displayedArtifact={displayedArtifact}
+ commitDetail={commitDetail}
+ isVersionView={isVersionView}
+ toolbar={toolbar}
+ canGoBack={canGoBack}
+ previousEntryTitle={previousEntryTitle}
+ linkNavLoading={linkNavLoading}
+ onBack={handleBack}
+ />
- <WikiDetailEditorPanel
- loading={loading}
- editedContent={editedContent}
- displayedContent={displayedContent}
- referenceDocuments={referenceDocuments}
- isVersionView={isVersionView}
- commitDetail={commitDetail}
- onContentChange={handleContentChange}
- onWikiLinkClick={handleMarkdownLinkClick}
- />
+ <WikiDetailEditorPanel
+ loading={loading}
+ editedContent={editedContent}
+ displayedContent={displayedContent}
+ referenceDocuments={referenceDocuments}
+ isVersionView={isVersionView}
+ commitDetail={commitDetail}
+ onContentChange={handleContentChange}
+ onWikiLinkClick={handleMarkdownLinkClick}
+ />
- <WikiCommitModal
- open={isOpen}
- onOpenChange={setIsOpen}
- form={form}
- onConfirm={handleConfirm}
- loading={isUpdating}
- />
- </>
- ) : (
- <div className="flex-1 overflow-y-auto p-8">
- <Empty
- className="h-full"
- text={t('knowledgeCompilation.selectArtifact')}
- />
- </div>
- )}
+ <WikiCommitModal
+ open={isOpen}
+ onOpenChange={setIsOpen}
+ form={form}
+ onConfirm={handleConfirm}
+ loading={isUpdating}
+ />
</section>
);
}