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

feat: store scheduled import path as absolute path

skfan135601e3ca8a6fe
diff --git a/src/App.tsx b/src/App.tsx
index 1dc6aa7a..c5f58a07 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -281,12 +281,20 @@ function App() {
try {
const savedScheduledImport = await loadScheduledImportConfig(proj.path)
if (savedScheduledImport) {
- useWikiStore.getState().setScheduledImportConfig(savedScheduledImport)
+ // Migrate relative path to absolute (backward compatibility)
+ let path = savedScheduledImport.path
+ if (path && !path.startsWith("/") && !path.match(/^[a-zA-Z]:\\/)) {
+ path = `${proj.path}/${path}`
+ }
+ useWikiStore.getState().setScheduledImportConfig({
+ ...savedScheduledImport,
+ path,
+ })
} else {
// Reset to default for new projects
useWikiStore.getState().setScheduledImportConfig({
enabled: false,
- path: "raw/sources",
+ path: `${proj.path}/raw/sources`,
interval: 60,
lastScan: null,
})
diff --git a/src/components/settings/settings-view.tsx b/src/components/settings/settings-view.tsx
index f598a00a..7dba7177 100644
--- a/src/components/settings/settings-view.tsx
+++ b/src/components/settings/settings-view.tsx
@@ -81,14 +81,15 @@ function initialDraft(
uiLanguage: string,
projectPath?: string,
): SettingsDraft {
- // Resolve the display path: if path is empty, show default "raw/sources"
- // If path is relative and we have a project path, show absolute path
- // If path is absolute, show as-is
- const rawPath = scheduledImport.path || "raw/sources"
- let displayPath = rawPath
- if (projectPath && !rawPath.startsWith("/") && !rawPath.match(/^[a-zA-Z]:\\/)) {
- // Relative path - prepend project path for display
- displayPath = `${projectPath}/${rawPath}`
+ // Show absolute path: if stored path is empty, show default using project path
+ // If stored path is relative (legacy), prepend project path
+ // If stored path is absolute, show as-is
+ let displayPath = scheduledImport.path || ""
+ if (!displayPath && projectPath) {
+ displayPath = `${projectPath}/raw/sources`
+ } else if (displayPath && projectPath && !displayPath.startsWith("/") && !displayPath.match(/^[a-zA-Z]:\\/)) {
+ // Legacy relative path - prepend project path for display
+ displayPath = `${projectPath}/${displayPath}`
}
return {
@@ -288,14 +289,9 @@ export function SettingsView() {
console.warn("[proxy] live update failed; restart will still apply:", err)
}
- // Strip project path prefix to store relative path
- let savePath = draft.scheduledImportPath
- if (project && savePath.startsWith(project.path + "/")) {
- savePath = savePath.slice(project.path.length + 1)
- }
const newScheduledImport = {
enabled: draft.scheduledImportEnabled,
- path: savePath,
+ path: draft.scheduledImportPath,
interval: draft.scheduledImportInterval,
lastScan: scheduledImportConfig.lastScan,
}