From e28918b24da0ca21eb8ec711ced614901e01a529 Mon Sep 17 00:00:00 2001 From: Pietro Campagnano Date: Mon, 20 Apr 2026 22:36:19 +0200 Subject: [PATCH] fix: pluralize folder/file counts correctly in file list summary (#1701) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary * **Goal**: Fix incorrect pluralization in the file manager web UI summary line. * **Changes**: `FilesPage.html` always rendered the plural forms ("folders"/"files") regardless of count. The summary now selects singular or plural based on each count. Example: - Before: `1 folders, 1 files, 12 KB` - After: `1 folder, 1 file, 12 KB` ## Additional Context * Cosmetic-only fix — no behavior, performance, or memory impact. * Change is fully client-side (JavaScript inside a single HTML template). * English-only; web UI localization is out of scope here. --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? _**YES**_ Co-authored-by: Claude Sonnet 4.6 --- src/network/html/FilesPage.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/network/html/FilesPage.html b/src/network/html/FilesPage.html index 91c1967d7..205787d5c 100644 --- a/src/network/html/FilesPage.html +++ b/src/network/html/FilesPage.html @@ -1875,7 +1875,10 @@ totalSize += file.size; }); - document.getElementById('folder-summary').innerHTML = `${folderCount} folders, ${files.length - folderCount} files, ${formatFileSize(totalSize)}`; + const fileCount = files.length - folderCount; + const folderLabel = folderCount === 1 ? 'folder' : 'folders'; + const fileLabel = fileCount === 1 ? 'file' : 'files'; + document.getElementById('folder-summary').innerHTML = `${folderCount} ${folderLabel}, ${fileCount} ${fileLabel}, ${formatFileSize(totalSize)}`; if (files.length === 0) { fileTable.innerHTML = '
This folder is empty
';