refactor(documents): drop duplicate sender/receiver in list rows
Some checks failed
CI / Unit & Component Tests (push) Failing after 2m49s
CI / OCR Service Tests (push) Successful in 35s
CI / Backend Unit Tests (push) Failing after 2m52s

The desktop document-list row showed sender/receiver twice — once
side-by-side in the middle column and again stacked in the right
column. Stack the middle-column block vertically (the side-by-side
grid wasted horizontal space and competed with the larger thumbnail)
and remove the now-redundant copy from the right column.

The middle-column block keeps the search-match highlighting, which the
right-column copy never had.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-23 08:19:46 +02:00
parent 6aae159698
commit fc0fc57409
2 changed files with 26 additions and 22 deletions

View File

@@ -77,8 +77,8 @@ function safeTagColor(color: string | null | undefined): string {
</p>
{/if}
<!-- Sender / receivers — desktop only -->
<div class="mt-2 mb-2 hidden gap-4 font-sans text-xs text-ink-2 sm:grid sm:grid-cols-2">
<!-- Sender / receivers — desktop only, stacked -->
<div class="mt-2 mb-2 hidden flex-col gap-1 font-sans text-xs text-ink-2 sm:flex">
<div>
<span class="font-bold tracking-wide text-ink-3 uppercase">{m.docs_list_from()}</span>
<span class="ml-1">
@@ -158,26 +158,6 @@ function safeTagColor(color: string | null | undefined): string {
<div>
{doc.documentDate ? formatDate(doc.documentDate) : '—'}
</div>
<div>
<span class="font-bold tracking-wide text-ink-3 uppercase">{m.docs_list_from()}</span>
<span class="ml-1">
{#if doc.sender}
{doc.sender.displayName}
{:else}
<span class="text-ink-3 italic">{m.docs_list_unknown()}</span>
{/if}
</span>
</div>
<div>
<span class="font-bold tracking-wide text-ink-3 uppercase">{m.docs_list_to()}</span>
<span class="ml-1">
{#if doc.receivers && doc.receivers.length > 0}
{doc.receivers.map((r) => r.displayName).join(', ')}
{:else}
<span class="text-ink-3 italic">{m.docs_list_unknown()}</span>
{/if}
</span>
</div>
<div class="flex items-start gap-2">
<ProgressRing percentage={item.completionPercentage} />
<div class="flex h-9 items-center">

View File

@@ -117,6 +117,30 @@ describe('DocumentRow sender', () => {
const unknownElements = page.getByText('Unbekannt');
await expect.element(unknownElements.first()).toBeInTheDocument();
});
it('renders the sender display name only once across the row', async () => {
const item = makeItem({
document: {
...makeItem().document,
sender: { id: 's1', displayName: 'Großmutter Maria' }
}
});
render(DocumentRow, { item });
const matches = await page.getByText('Großmutter Maria').all();
expect(matches.length).toBe(1);
});
it('renders each receiver display name only once across the row', async () => {
const item = makeItem({
document: {
...makeItem().document,
receivers: [{ id: 'r1', displayName: 'Onkel Karl' }]
}
});
render(DocumentRow, { item });
const matches = await page.getByText('Onkel Karl').all();
expect(matches.length).toBe(1);
});
});
// ─── Tags ─────────────────────────────────────────────────────────────────────