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: move __deep_research__ handler to top of if-chain to prevent fuzzy match interception

nash_suf950416952f1
diff --git a/src/components/review/review-view.tsx b/src/components/review/review-view.tsx
index 8f38eeb1..6b808525 100644
--- a/src/components/review/review-view.tsx
+++ b/src/components/review/review-view.tsx
@@ -34,6 +34,25 @@ export function ReviewView() {
const setFileTree = useWikiStore((s) => s.setFileTree)
const handleResolve = useCallback(async (id: string, action: string) => {
+ // Deep Research — must be checked FIRST before any fuzzy matching
+ if (action === "__deep_research__" && project) {
+ const searchConfig = useWikiStore.getState().searchApiConfig
+ if (searchConfig.provider === "none" || !searchConfig.apiKey) {
+ window.alert("Web Search not configured. Go to Settings → Web Search to add a Tavily API key first.")
+ return
+ }
+ const item = items.find((i) => i.id === id)
+ if (item) {
+ const llmConfig = useWikiStore.getState().llmConfig
+ const topic = item.title.replace(/^(Save to Wiki|Create|Research)[:\s]*/i, "").trim() || item.description.split("\n")[0]
+ queueResearch(project.path, topic, llmConfig, searchConfig)
+ resolveItem(id, "Queued for research")
+ } else {
+ resolveItem(id, action)
+ }
+ return
+ }
+
if (action.startsWith("save:") && project) {
// Decode and save the content to wiki
try {
@@ -190,23 +209,6 @@ export function ReviewView() {
} else {
resolveItem(id, action)
}
- } else if (action === "__deep_research__" && project) {
- // Check if search API is configured
- const searchConfig = useWikiStore.getState().searchApiConfig
- if (searchConfig.provider === "none" || !searchConfig.apiKey) {
- window.alert("Web Search not configured. Go to Settings → Web Search to add a Tavily API key first.")
- return
- }
- // Queue deep research task
- const item = items.find((i) => i.id === id)
- if (item) {
- const llmConfig = useWikiStore.getState().llmConfig
- const topic = item.title.replace(/^(Save to Wiki|Create|Research)[:\s]*/i, "").trim() || item.description.split("\n")[0]
- queueResearch(project.path, topic, llmConfig, searchConfig)
- resolveItem(id, "Queued for research")
- } else {
- resolveItem(id, action)
- }
} else {
resolveItem(id, action)
}