Skip to content

Commit 2adadd0

Browse files
deltafunctionclaude
andcommitted
fix(files): show 'N tag(s)' instead of 'N folder(s)' in systemtags view
Tags are represented as Folder nodes with an 'is-tag' attribute set by the systemtags app. getSummaryFor now detects these and uses the 'systemtags' translation domain for the count, so the footer reads '1 tag' rather than '1 folder'. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 5a197a7 commit 2adadd0

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

apps/files/src/utils/fileUtils.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,18 @@ export function extractFilePaths(path: string): [string, string] {
3030
*/
3131
export function getSummaryFor(nodes: Node[], hidden = 0): string {
3232
const fileCount = nodes.filter((node) => node.type === FileType.File).length
33-
const folderCount = nodes.filter((node) => node.type === FileType.Folder).length
33+
const tagCount = nodes.filter((node) => node.type === FileType.Folder && node.attributes?.['is-tag']).length
34+
const folderCount = nodes.filter((node) => node.type === FileType.Folder && !node.attributes?.['is-tag']).length
3435

3536
const summary: string[] = []
36-
if (fileCount > 0 || folderCount === 0) {
37+
if (fileCount > 0 || (folderCount === 0 && tagCount === 0)) {
3738
const fileSummary = n('files', '%n file', '%n files', fileCount)
3839
summary.push(fileSummary)
3940
}
41+
if (tagCount > 0) {
42+
const tagSummary = n('systemtags', '%n tag', '%n tags', tagCount)
43+
summary.push(tagSummary)
44+
}
4045
if (folderCount > 0) {
4146
const folderSummary = n('files', '%n folder', '%n folders', folderCount)
4247
summary.push(folderSummary)

build/frontend-legacy/webpack.modules.cjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
const path = require('path')
66

77
module.exports = {
8+
user_group_admin: {
9+
main: path.join(__dirname, 'apps/user_group_admin/src', 'main.js'),
10+
'files-navigation': path.join(__dirname, 'apps/user_group_admin/src', 'files-navigation.js'),
11+
},
812
core: {
913
'ajax-cron': path.join(__dirname, 'core/src', 'ajax-cron.ts'),
1014
install: path.join(__dirname, 'core/src', 'install.ts'),

0 commit comments

Comments
 (0)