feat(themen): show the subtree rollup count on reader surfaces (#698)
The /themen page (box header, child rows, aria-labels) and the dashboard ThemenWidget now display subtreeDocumentCount instead of the direct documentCount, so a topic's number reflects its whole sub-topic tree and matches what /documents?tag=X actually returns. A parent with 0 direct documents but documents under its children now shows a non-zero total. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -41,8 +41,8 @@ const shownTags = $derived(visibleTags.slice(0, MAX_VISIBLE_TAGS));
|
||||
{#each shownTags as tag (tag.id)}
|
||||
<a
|
||||
href="/documents?tag={encodeURIComponent(tag.name)}"
|
||||
aria-label="{tag.name}{tag.documentCount > 0
|
||||
? ', ' + m.themen_dokumente({ count: tag.documentCount })
|
||||
aria-label="{tag.name}{tag.subtreeDocumentCount > 0
|
||||
? ', ' + m.themen_dokumente({ count: tag.subtreeDocumentCount })
|
||||
: ''}"
|
||||
class="flex cursor-pointer items-stretch overflow-hidden rounded-sm border border-line bg-canvas hover:bg-surface focus-visible:ring-2 focus-visible:ring-brand-navy focus-visible:outline-none"
|
||||
style="min-height: 56px"
|
||||
@@ -54,9 +54,9 @@ const shownTags = $derived(visibleTags.slice(0, MAX_VISIBLE_TAGS));
|
||||
></span>
|
||||
<span class="flex min-w-0 flex-1 flex-col justify-center gap-0.5 px-3 py-3">
|
||||
<span class="truncate font-serif text-sm font-semibold text-ink">{tag.name}</span>
|
||||
{#if tag.documentCount > 0}
|
||||
{#if tag.subtreeDocumentCount > 0}
|
||||
<span class="font-sans text-xs text-ink-3 tabular-nums">
|
||||
{m.themen_dokumente({ count: tag.documentCount })}
|
||||
{m.themen_dokumente({ count: tag.subtreeDocumentCount })}
|
||||
</span>
|
||||
{/if}
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user