feat(training-history): hide person/type columns for segmentation context

Add showPersonColumns prop (default true) to TrainingHistory.
SegmentationTrainingCard passes false — segmentation is not person-specific.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-18 10:39:18 +02:00
parent 8128769feb
commit 9ff498a194
2 changed files with 20 additions and 12 deletions

View File

@@ -82,5 +82,8 @@ async function startTraining() {
<h3 class="mt-6 mb-3 text-xs font-bold tracking-widest text-ink-3 uppercase">
{m.training_history_heading()}
</h3>
<TrainingHistory runs={(trainingInfo?.runs ?? []).filter((r) => r.modelName === 'blla')} />
<TrainingHistory
runs={(trainingInfo?.runs ?? []).filter((r) => r.modelName === 'blla')}
showPersonColumns={false}
/>
</div>

View File

@@ -5,9 +5,10 @@ import type { TrainingRun } from '$lib/types/training.js';
interface Props {
runs: TrainingRun[];
personNames?: Record<string, string>;
showPersonColumns?: boolean;
}
let { runs, personNames }: Props = $props();
let { runs, personNames, showPersonColumns = true }: Props = $props();
const COLLAPSED_COUNT = 3;
let expanded = $state(false);
@@ -36,8 +37,10 @@ function formatCer(cer: number | undefined | null): string {
<tr class="border-b border-line text-xs font-bold tracking-widest text-ink-3 uppercase">
<th class="pb-2 text-left">{m.training_history_col_date()}</th>
<th class="pb-2 text-left">{m.training_history_col_status()}</th>
<th class="hidden pb-2 text-left md:table-cell">{m.training_col_type()}</th>
<th class="hidden pb-2 text-left md:table-cell">{m.training_col_person()}</th>
{#if showPersonColumns}
<th class="hidden pb-2 text-left md:table-cell">{m.training_col_type()}</th>
<th class="hidden pb-2 text-left md:table-cell">{m.training_col_person()}</th>
{/if}
<th class="pb-2 text-right">{m.training_history_col_blocks()}</th>
<th class="hidden pb-2 text-right md:table-cell">{m.training_history_col_docs()}</th>
<th class="hidden pb-2 text-right md:table-cell">{m.training_history_col_cer()}</th>
@@ -46,7 +49,7 @@ function formatCer(cer: number | undefined | null): string {
<tbody id="training-history-rows">
{#if runs.length === 0}
<tr>
<td colspan="7" class="py-4 text-center text-sm text-ink-2">
<td colspan={showPersonColumns ? 7 : 5} class="py-4 text-center text-sm text-ink-2">
{m.training_history_empty()}
</td>
</tr>
@@ -117,18 +120,20 @@ function formatCer(cer: number | undefined | null): string {
{m.training_status_running()}
</span>
{/if}
{#if run.personId && personNames?.[run.personId]}
{#if showPersonColumns && 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 class="hidden py-2 text-left text-ink-2 md:table-cell">
{run.personId ? m.training_type_personalized() : m.training_type_base()}
</td>
<td class="hidden py-2 text-left text-ink-2 md:table-cell">
{run.personId && personNames?.[run.personId] ? personNames[run.personId] : '—'}
</td>
{#if showPersonColumns}
<td class="hidden py-2 text-left text-ink-2 md:table-cell">
{run.personId ? m.training_type_personalized() : m.training_type_base()}
</td>
<td class="hidden py-2 text-left text-ink-2 md:table-cell">
{run.personId && personNames?.[run.personId] ? personNames[run.personId] : '—'}
</td>
{/if}
<td class="py-2 text-right text-ink-2">{run.blockCount}</td>
<td class="hidden py-2 text-right text-ink-2 md:table-cell">{run.documentCount}</td>
<td class="hidden py-2 text-right md:table-cell"