feat: show scanning icon for parent and subfolder nodes along scan path

This commit is contained in:
2026-10-08 19:02:06 +07:00
parent 66de0c35b1
commit bfda4b4b9e
5 changed files with 16 additions and 7 deletions
+8 -4
View File
@@ -1091,7 +1091,9 @@ function Catalogue() {
}
const markOf = (folderName: string, rel: string, at: string): Mark => {
const root = normPath(folderName);
const here = normPath(at || rel);
const cleanRel = (rel || '').replace(/\\/g, '/').replace(/^\/+/, '').replace(/\/$/, '');
const cleanAt = (at || '').replace(/\\/g, '/').replace(/^\/+/, '').replace(/\/$/, '');
const here = normPath(cleanAt || cleanRel);
return { root, own: here ? `${root}/${here}` : root };
};
const liveMark = live ? markOf(live.folder, live.progress.from, live.progress.at) : null;
@@ -1099,11 +1101,13 @@ function Catalogue() {
// so it marks the folder it was asked of.
const askedMarks = scanQueue().map((j) => markOf(j.folder, j.rel, ''));
const wearsMark = (n: Node, m: Mark): boolean => {
const nKey = normPath(n.key);
const nKey = normPath(n.key).toLowerCase();
const mRoot = normPath(m.root).toLowerCase();
const mOwn = normPath(m.own).toLowerCase();
// Another roll's rows are neither the reading's nor the request's news.
if (nKey !== m.root && !nKey.startsWith(`${m.root}/`)) return false;
if (nKey !== mRoot && !nKey.startsWith(`${mRoot}/`)) return false;
// The active scanning row itself, and every parent/ancestor row up to root.
return nKey === m.own || m.own.startsWith(`${nKey}/`);
return nKey === mOwn || mOwn.startsWith(`${nKey}/`);
};
// A remembered subfolder that no longer holds a frame falls back to the folder