fix(library): guarantee trailing slash in rollWalk relative paths so active scan spinner highlights all ancestor folders

This commit is contained in:
2026-10-08 18:14:48 +07:00
parent 2ea0475d24
commit 21aa026319
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -97,14 +97,15 @@ export async function walkPass(
if (walk.walked.has(here.rel)) continue; if (walk.walked.has(here.rel)) continue;
walk.walked.add(here.rel); walk.walked.add(here.rel);
try { try {
const baseRel = here.rel ? (here.rel.endsWith('/') ? here.rel : `${here.rel}/`) : '';
for await (const entry of here.dir.values()) { for await (const entry of here.dir.values()) {
if (SYSTEM_DIR.test(entry.name)) continue; if (SYSTEM_DIR.test(entry.name)) continue;
if (entry.kind === 'directory') { if (entry.kind === 'directory') {
const rel = `${here.rel}${entry.name}/`; const rel = `${baseRel}${entry.name}/`;
walk.pending.push({ dir: entry as FileSystemDirectoryHandle, rel }); walk.pending.push({ dir: entry as FileSystemDirectoryHandle, rel });
seen.push(rel); seen.push(rel);
} else if (keep(entry.name)) { } else if (keep(entry.name)) {
out.push({ handle: entry as FileSystemFileHandle, rel: `${here.rel}${entry.name}` }); out.push({ handle: entry as FileSystemFileHandle, rel: `${baseRel}${entry.name}` });
} }
} }
} catch { } catch {
+1 -1
View File
@@ -1 +1 @@
22618dd3b376178df4c414d7317213af917c936d5195b69d46fe9731356a0da4 recipescam-images.tar.gz 0caf45eeac00f191bcd4abd2567721a569fef928eea0d963fe115641f917c908 recipescam-images.tar.gz