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

View File

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