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

fix: SourceFilesBar now reloads source file list when file tree changes

nash_su58dc3c74ff79
diff --git a/src/components/chat/chat-message.tsx b/src/components/chat/chat-message.tsx
index 398cd582..1d6713b6 100644
--- a/src/components/chat/chat-message.tsx
+++ b/src/components/chat/chat-message.tsx
@@ -187,7 +187,18 @@ function SaveToWikiButton({ content, visible }: { content: string; visible: bool
}
function SourceFilesBar({ content }: { content: string }) {
- const cited = useMemo(() => extractCitedSources(content), [content])
+ // Ensure source files are loaded
+ const project = useWikiStore((s) => s.project)
+ const fileTree = useWikiStore((s) => s.fileTree)
+
+ useEffect(() => {
+ if (!project) return
+ listDirectory(`${project.path}/raw/sources`)
+ .then((tree) => { cachedSourceFiles = flattenNames(tree) })
+ .catch(() => {})
+ }, [project, fileTree])
+
+ const cited = useMemo(() => extractCitedSources(content), [content, fileTree])
if (cited.length === 0) return null