From 91c9b1f95b72117c161e7c55b7173130ffca0059 Mon Sep 17 00:00:00 2001 From: 3dtours Date: Thu, 15 Oct 2026 21:37:14 +0700 Subject: [PATCH] fix(library): a local node's frames stand under the key the column files them by MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The column files a local folder as an absolute key — `/2012` — while a frame carries its own `dir` as a path from the root, `2012`. `shown` set the two against each other as they stood, so a frame's dir was never the node's dir, and never under it either: every folder in the disk tree was counted in the row above it and stood in no pane at all — the wall white, the frames nowhere. The key sheds the slash it leads with before the two are set against each other, the way `markOf` already cleans a reading's own path. Measured on the live account's own catalogue — 112761 frames, 6 under `/2012`: the node matched 0 frames before, 6 after; the root's own list is untouched (927). --- docker/frontend/src/Library.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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}/`);