Skip to content

AI media harness for planning, generating, and editing locally

TypeScript

Strip the verbatim prefix everywhere a path leaves the backend

Bittid5494c6b589c
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index 5464057..174cdbc 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -1015,7 +1015,9 @@ fn choose_initial_reference_images(app: AppHandle) -> Result<Vec<PendingReferenc
.unwrap_or("Image reference")
.to_string();
Ok(PendingReferenceImage {
- source_path: source.to_string_lossy().into_owned(),
+ // Never a verbatim path: this one is shown in the composer
+ // beside the file's name before the project even exists.
+ source_path: display_path(&source),
name,
})
})
@@ -1516,7 +1518,7 @@ fn choose_engine_path(
let path = selected
.into_path()
.map_err(|error| format!("Could not access the selected path: {error}"))?;
- Ok(Some(path.to_string_lossy().into_owned()))
+ Ok(Some(display_path(&path)))
}
/// What is installed on this computer: the two agent CLIs and the video engine.
diff --git a/src/lib/persistence.ts b/src/lib/persistence.ts
index 74749df..d700059 100644
--- a/src/lib/persistence.ts
+++ b/src/lib/persistence.ts
@@ -127,6 +127,16 @@ export async function listRecentProjects(): Promise<RecentProjects> {
}
}),
);
+ // Heal the stored list from what the backend just resolved. Paths remembered
+ // by an earlier build carry the Windows verbatim prefix (`\\?\D:\…`), which
+ // is an OS escape hatch nobody should be shown; every record comes back with
+ // the ordinary form, so write that back and the list converges on it. A row
+ // that failed to load keeps its stored path — that string is the one the
+ // library is actually holding, and the error line has to name it.
+ const healed = rows.map((row, index) => (row.ok ? row.record.folderPath : paths[index]));
+ if (healed.some((path, index) => path !== paths[index])) {
+ localStorage.setItem(RECENTS_KEY, JSON.stringify(healed));
+ }
return {
projects: rows.flatMap((row) => (row.ok ? [row.record] : [])),
unreadable: rows.flatMap((row) => (row.ok ? [] : [row.failure])),