feat(themen): cap ThemenWidget at 6 tags — link to /themen for full list
Some checks failed
CI / Unit & Component Tests (pull_request) Has been cancelled
CI / OCR Service Tests (pull_request) Has been cancelled
CI / Backend Unit Tests (pull_request) Has been cancelled
CI / fail2ban Regex (pull_request) Has been cancelled
CI / Semgrep Security Scan (pull_request) Has been cancelled
CI / Compose Bucket Idempotency (pull_request) Has been cancelled

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-05-25 19:06:56 +02:00
parent e6a0c2f6d6
commit 264d60c855

View File

@@ -10,9 +10,12 @@ interface Props {
compact?: boolean; compact?: boolean;
} }
const MAX_VISIBLE_TAGS = 6;
const { tags, compact = false }: Props = $props(); const { tags, compact = false }: Props = $props();
const visibleTags = $derived.by(() => tags.filter(hasAnyDocuments)); const visibleTags = $derived.by(() => tags.filter(hasAnyDocuments));
const shownTags = $derived(visibleTags.slice(0, MAX_VISIBLE_TAGS));
</script> </script>
<section class="rounded-sm border border-line bg-surface p-5 shadow-sm"> <section class="rounded-sm border border-line bg-surface p-5 shadow-sm">
@@ -35,7 +38,7 @@ const visibleTags = $derived.by(() => tags.filter(hasAnyDocuments));
class="grid gap-2 {compact ? 'grid-cols-1' : 'grid-cols-1 sm:grid-cols-2'}" class="grid gap-2 {compact ? 'grid-cols-1' : 'grid-cols-1 sm:grid-cols-2'}"
data-compact={compact} data-compact={compact}
> >
{#each visibleTags as tag (tag.id)} {#each shownTags as tag (tag.id)}
<a <a
href="/?tag={encodeURIComponent(tag.name)}" href="/?tag={encodeURIComponent(tag.name)}"
aria-label="{tag.name}{tag.documentCount > 0 aria-label="{tag.name}{tag.documentCount > 0