Skip to content

LLM Wiki is a cross-platform desktop application that turns your documents into an organized, interlinked knowledge base — automatically. Instead of traditional RAG (retrieve-and-answer from scratch every time), the LLM incrementally builds and maintains a persistent wiki from your sources。

TypeScript

release: v0.5.2 graph preview fix

nash_su69e874489cb3
diff --git a/package-lock.json b/package-lock.json
index 2b08865e..aa3ec55a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "llm-wiki",
- "version": "0.5.1",
+ "version": "0.5.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "llm-wiki",
- "version": "0.5.1",
+ "version": "0.5.2",
"dependencies": {
"@base-ui/react": "^1.3.0",
"@fontsource-variable/geist": "^5.2.8",
diff --git a/package.json b/package.json
index a16fa681..15fdc482 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "llm-wiki",
"private": true,
- "version": "0.5.1",
+ "version": "0.5.2",
"type": "module",
"scripts": {
"dev": "vite",
diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock
index 92d61a65..1a271889 100644
--- a/src-tauri/Cargo.lock
+++ b/src-tauri/Cargo.lock
@@ -4461,7 +4461,7 @@ checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092"
[[package]]
name = "llm-wiki"
-version = "0.5.1"
+version = "0.5.2"
dependencies = [
"arrow-array",
"arrow-schema",
diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml
index 8b3a2f1f..4a1e14d8 100644
--- a/src-tauri/Cargo.toml
+++ b/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "llm-wiki"
-version = "0.5.1"
+version = "0.5.2"
description = "LLM Wiki - A personal knowledge base for LLM concepts"
authors = []
edition = "2021"
diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json
index e084607c..2cc66a59 100644
--- a/src-tauri/tauri.conf.json
+++ b/src-tauri/tauri.conf.json
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "LLM Wiki",
- "version": "0.5.1",
+ "version": "0.5.2",
"identifier": "com.llmwiki.app",
"build": {
"beforeDevCommand": "npm run dev",
diff --git a/src/components/graph/graph-view.tsx b/src/components/graph/graph-view.tsx
index e60408ac..3ff23700 100644
--- a/src/components/graph/graph-view.tsx
+++ b/src/components/graph/graph-view.tsx
@@ -9,12 +9,15 @@ import { ErrorBoundary } from "@/components/error-boundary"
import { useResearchStore } from "@/stores/research-store"
import { Button } from "@/components/ui/button"
import { useWikiStore } from "@/stores/wiki-store"
-import { readFile } from "@/commands/fs"
+import { readFile, writeFile } from "@/commands/fs"
+import { WikiEditor } from "@/components/editor/wiki-editor"
+import { FilePreview } from "@/components/editor/file-preview"
import { buildWikiGraph, type GraphNode, type GraphEdge, type CommunityInfo } from "@/lib/wiki-graph"
import { findSurprisingConnections, detectKnowledgeGaps, type SurprisingConnection, type KnowledgeGap } from "@/lib/graph-insights"
import { queueResearch } from "@/lib/deep-research"
import { optimizeResearchTopic } from "@/lib/optimize-research-topic"
-import { normalizePath } from "@/lib/path-utils"
+import { getFileName, normalizePath } from "@/lib/path-utils"
+import { getFileCategory } from "@/lib/file-types"
import { applyGraphFilters, DEFAULT_GRAPH_FILTERS, hasActiveGraphFilters, type GraphFilterState } from "@/lib/graph-filters"
import { applyGraphSearch } from "@/lib/graph-search"
import { wikiTypeLabel } from "@/lib/wiki-page-types"
@@ -77,6 +80,11 @@ const GRAPH_SPACING_DEBOUNCE_MS = 180
const WORKER_LAYOUT_NODE_THRESHOLD = 220
type HoverState = { node: string; neighbors: Set<string> } | null
+type GraphPreview = {
+ path: string
+ title: string
+ content: string
+}
function graphThemePalette(isDark: boolean): GraphThemePalette {
return isDark
@@ -538,7 +546,6 @@ export function GraphView() {
const { t } = useTranslation()
const project = useWikiStore((s) => s.project)
const dataVersion = useWikiStore((s) => s.dataVersion)
- const openFileInPreview = useWikiStore((s) => s.openFileInPreview)
const isDarkMode = useResolvedDarkMode()
const graphPalette = useMemo(() => graphThemePalette(isDarkMode), [isDarkMode])
@@ -564,6 +571,7 @@ export function GraphView() {
const [nodeScale, setNodeScale] = useState(DEFAULT_NODE_SCALE)
const [graphSpacingDraft, setGraphSpacingDraft] = useState(DEFAULT_GRAPH_SPACING)
const [graphSpacing, setGraphSpacing] = useState(DEFAULT_GRAPH_SPACING)
+ const [graphPreview, setGraphPreview] = useState<GraphPreview | null>(null)
const [filters, setFilters] = useState<GraphFilterState>(() => ({
...DEFAULT_GRAPH_FILTERS,
hiddenTypes: new Set(),
@@ -647,12 +655,16 @@ export function GraphView() {
if (!node) return
try {
const content = await readFile(node.path)
- openFileInPreview(node.path, content)
+ setGraphPreview({
+ path: node.path,
+ title: node.label || getFileName(node.path),
+ content,
+ })
} catch (err) {
console.error("Failed to open wiki page:", err)
}
},
- [nodes, openFileInPreview],
+ [nodes],
)
const handleNodeContextMenu = useCallback((nodeId: string, x: number, y: number) => {
@@ -752,10 +764,9 @@ export function GraphView() {
// Sigma crashes with "could not find suitable program for node type circle"
// when its canvas is resized by external layout changes.
- // 1. Detect panel open/close (selectedFile, researchPanel, insights)
- const selectedFileForLayout = useWikiStore((s) => s.selectedFile)
+ // 1. Detect panel open/close (local graph preview, researchPanel, insights)
const researchPanelForLayout = useResearchStore((s) => s.panelOpen)
- const layoutKey = `${!!selectedFileForLayout}-${researchPanelForLayout}-${showInsights}`
+ const layoutKey = `${!!graphPreview}-${researchPanelForLayout}-${showInsights}`
const prevLayoutKey = useRef(layoutKey)
useEffect(() => {
@@ -1465,6 +1476,13 @@ export function GraphView() {
</div>
</div>
)}
+ {graphPreview && (
+ <GraphPreviewPanel
+ preview={graphPreview}
+ onClose={() => setGraphPreview(null)}
+ onContentChange={(content) => setGraphPreview((prev) => prev ? { ...prev, content } : prev)}
+ />
+ )}
</div>
{/* Research Topic Confirmation Dialog */}
@@ -1558,3 +1576,82 @@ export function GraphView() {
</div>
)
}
+
+function GraphPreviewPanel({
+ preview,
+ onClose,
+ onContentChange,
+}: {
+ preview: GraphPreview
+ onClose: () => void
+ onContentChange: (content: string) => void
+}) {
+ const saveTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null)
+ const lastSavedRef = useRef(preview.content)
+ const category = getFileCategory(preview.path)
+
+ useEffect(() => {
+ lastSavedRef.current = preview.content
+ }, [preview.path, preview.content])
+
+ useEffect(() => {
+ return () => {
+ if (saveTimerRef.current) clearTimeout(saveTimerRef.current)
+ }
+ }, [])
+
+ const writeNow = useCallback((markdown: string) => {
+ writeFile(preview.path, markdown)
+ .then(() => {
+ lastSavedRef.current = markdown
+ onContentChange(markdown)
+ })
+ .catch((err) => console.error("Failed to save graph preview:", err))
+ }, [onContentChange, preview.path])
+
+ const handleSave = useCallback((markdown: string, options?: { immediate?: boolean }) => {
+ if (markdown === lastSavedRef.current) return
+ if (saveTimerRef.current) clearTimeout(saveTimerRef.current)
+ if (options?.immediate) {
+ onContentChange(markdown)
+ writeNow(markdown)
+ return
+ }
+ saveTimerRef.current = setTimeout(() => {
+ writeNow(markdown)
+ }, 1000)
+ }, [onContentChange, writeNow])
+
+ return (
+ <div className="flex w-[420px] min-w-[320px] max-w-[50vw] shrink-0 flex-col border-l bg-background">
+ <div className="flex items-center justify-between border-b px-3 py-1.5">
+ <span className="truncate text-xs text-muted-foreground" title={preview.path}>
+ {preview.title}
+ </span>
+ <button
+ type="button"
+ onClick={onClose}
+ className="shrink-0 rounded p-1 text-muted-foreground hover:bg-accent"
+ >
+ <X className="h-3.5 w-3.5" />
+ </button>
+ </div>
+ <div className="min-w-0 flex-1 overflow-auto">
+ {category === "markdown" ? (
+ <WikiEditor
+ key={preview.path}
+ content={preview.content}
+ onSave={handleSave}
+ filePath={preview.path}
+ />
+ ) : (
+ <FilePreview
+ key={preview.path}
+ filePath={preview.path}
+ textContent={preview.content}
+ />
+ )}
+ </div>
+ </div>
+ )
+}
diff --git a/src/lib/changelog.ts b/src/lib/changelog.ts
index 231ae7f8..58258b35 100644
--- a/src/lib/changelog.ts
+++ b/src/lib/changelog.ts
@@ -25,6 +25,18 @@ export interface ChangelogEntry {
}
export const CHANGELOG: ChangelogEntry[] = [
+ {
+ version: "0.5.2",
+ date: "2026-06-25",
+ highlights: {
+ en: [
+ "Fixed knowledge graph node previews so clicked pages open in the graph-side preview panel instead of switching to the Wiki page.",
+ ],
+ zh: [
+ "修复知识图谱节点预览:点击页面节点时会在图谱右侧预览栏打开,不再跳转到 Wiki 页面。",
+ ],
+ },
+ },
{
version: "0.5.1",
date: "2026-06-24",