feat(briefwechsel): thumbnail rows with summary quote and bilateral distribution bar (#305) #311

Merged
marcel merged 30 commits from feat/issue-305-briefwechsel-thumbnail-rows into main 2026-04-23 21:38:57 +02:00
3 changed files with 9 additions and 2 deletions
Showing only changes of commit fba685e7a4 - Show all commits

View File

@@ -1,7 +1,7 @@
<script lang="ts">
type Tag = { id: string; name: string };
let { tags, max }: { tags: Tag[]; max: number } = $props();
let { tags, max = 3 }: { tags: Tag[]; max?: number } = $props();
const displayedTags = $derived(tags.slice(0, max));
const hiddenTagCount = $derived(Math.max(0, tags.length - max));

View File

@@ -31,4 +31,11 @@ describe('TagChipList', () => {
expect(chips).toHaveLength(0);
expect(document.body.textContent).not.toMatch(/\+/);
});
it('defaults max to 3 when the prop is omitted', () => {
render(TagChipList, { tags: makeTags(5) });
const chips = document.querySelectorAll('[data-testid="thumb-row-tag"]');
expect(chips).toHaveLength(3);
expect(document.body.textContent).toMatch(/\+2/);
});
});

View File

@@ -91,6 +91,6 @@ const ariaLabel = $derived(
{/if}
</div>
<TagChipList tags={doc.tags ?? []} max={3} />
<TagChipList tags={doc.tags ?? []} />
</div>
</a>