feat(themen): count documents across the whole sub-topic tree (#698) #701

Merged
marcel merged 8 commits from worktree-feat+issue-698-themen-subtree-count into main 2026-05-31 12:58:10 +02:00
2 changed files with 24 additions and 2 deletions
Showing only changes of commit 1fc74f8892 - Show all commits

View File

@@ -22,6 +22,7 @@ const leafNode = (overrides: Record<string, unknown> = {}) => ({
name: 'Personen',
color: 'sage',
documentCount: 5,
subtreeDocumentCount: 5,
parentId: null,
children: [],
...overrides
@@ -32,8 +33,18 @@ const parentNode = (overrides: Record<string, unknown> = {}) => ({
name: 'Orte',
color: 'sienna',
documentCount: 0,
subtreeDocumentCount: 2,
parentId: null,
children: [{ id: 'tc1', name: 'Berlin', color: null, documentCount: 2, children: [] }],
children: [
{
id: 'tc1',
name: 'Berlin',
color: null,
documentCount: 2,
subtreeDocumentCount: 2,
children: []
}
],
...overrides
});

View File

@@ -15,9 +15,18 @@ const tree = [
name: 'Familie',
color: undefined,
documentCount: 3,
subtreeDocumentCount: 5,
parentId: undefined,
children: [
{ id: 't2', name: 'Eltern', color: undefined, documentCount: 2, parentId: 't1', children: [] }
{
id: 't2',
name: 'Eltern',
color: undefined,
documentCount: 2,
subtreeDocumentCount: 2,
parentId: 't1',
children: []
}
]
},
{
@@ -25,6 +34,7 @@ const tree = [
name: 'Urlaub',
color: 'teal',
documentCount: 0,
subtreeDocumentCount: 0,
parentId: undefined,
children: []
}
@@ -128,6 +138,7 @@ describe('TagsListPanel — color dot', () => {
id: 't1',
name: 'Familie',
documentCount: 0,
subtreeDocumentCount: 0,
parentId: undefined,
children: [],
color: undefined