diff --git a/docker/frontend/src/Library.tsx b/docker/frontend/src/Library.tsx index 7ff4fa3..a9f36e3 100644 --- a/docker/frontend/src/Library.tsx +++ b/docker/frontend/src/Library.tsx @@ -1869,9 +1869,14 @@ function Catalogue({ admin, user }: { admin: boolean; user: User | null }) { const isImmich = rootFolder.source === 'immich'; const normRoot = normPath(rootName).toLowerCase(); const normNode = normPath(node ?? '').toLowerCase(); - const dir = normNode === normRoot + // A node's key is the path the column gave it, and a local root's is + // absolute — the disk's `/2012`, where the cloud's is `IMMICH2194` — while a + // frame's own `dir` is never absolute. The key sheds the slash it leads with + // before the two are set against each other, or every frame under a local + // folder counts in the row above it and stands in no pane at all. + const dir = (normNode === normRoot ? '' - : (normRoot ? (normNode.startsWith(`${normRoot}/`) ? normNode.slice(normRoot.length + 1) : normNode) : normNode); + : (normRoot ? (normNode.startsWith(`${normRoot}/`) ? normNode.slice(normRoot.length + 1) : normNode) : normNode)).replace(/^\/+/, ''); const below = dir === '' ? (p: LibraryPhoto) => normPath(p.dir ?? '') !== '' : (p: LibraryPhoto) => normPath(p.dir ?? '').toLowerCase().startsWith(`${dir}/`);