fix(frontend): show person name inline in mobile status cell in TrainingHistory

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-17 20:52:08 +02:00
committed by marcel
parent 5e4f031537
commit 8860f17129
2 changed files with 7 additions and 1 deletions

View File

@@ -117,6 +117,11 @@ function formatCer(cer: number | undefined | null): string {
{m.training_status_running()} {m.training_status_running()}
</span> </span>
{/if} {/if}
{#if run.personId && personNames?.[run.personId]}
<span class="mt-0.5 block text-xs text-ink-3 md:hidden"
>{personNames[run.personId]}</span
>
{/if}
</td> </td>
<td class="hidden py-2 text-left text-ink-2 md:table-cell"> <td class="hidden py-2 text-left text-ink-2 md:table-cell">
{run.personId ? m.training_type_personalized() : m.training_type_base()} {run.personId ? m.training_type_personalized() : m.training_type_base()}

View File

@@ -70,6 +70,7 @@ describe('TrainingHistory — type and person columns', () => {
render(TrainingHistory, { runs: [run], personNames: { 'person-1': 'Karl Müller' } }); render(TrainingHistory, { runs: [run], personNames: { 'person-1': 'Karl Müller' } });
await expect.element(page.getByText(/Personalisiert/i)).toBeInTheDocument(); await expect.element(page.getByText(/Personalisiert/i)).toBeInTheDocument();
await expect.element(page.getByText('Karl Müller')).toBeInTheDocument(); // Name appears in both the mobile inline span and the desktop table cell
await expect.element(page.getByText('Karl Müller').first()).toBeInTheDocument();
}); });
}); });