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:
@@ -82,5 +82,8 @@ async function startTraining() {
|
|||||||
<h3 class="mt-6 mb-3 text-xs font-bold tracking-widest text-ink-3 uppercase">
|
<h3 class="mt-6 mb-3 text-xs font-bold tracking-widest text-ink-3 uppercase">
|
||||||
{m.training_history_heading()}
|
{m.training_history_heading()}
|
||||||
</h3>
|
</h3>
|
||||||
<TrainingHistory runs={(trainingInfo?.runs ?? []).filter((r) => r.modelName === 'blla')} />
|
<TrainingHistory
|
||||||
|
runs={(trainingInfo?.runs ?? []).filter((r) => r.modelName === 'blla')}
|
||||||
|
showPersonColumns={false}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,9 +5,10 @@ import type { TrainingRun } from '$lib/types/training.js';
|
|||||||
interface Props {
|
interface Props {
|
||||||
runs: TrainingRun[];
|
runs: TrainingRun[];
|
||||||
personNames?: Record<string, string>;
|
personNames?: Record<string, string>;
|
||||||
|
showPersonColumns?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { runs, personNames }: Props = $props();
|
let { runs, personNames, showPersonColumns = true }: Props = $props();
|
||||||
|
|
||||||
const COLLAPSED_COUNT = 3;
|
const COLLAPSED_COUNT = 3;
|
||||||
let expanded = $state(false);
|
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">
|
<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_date()}</th>
|
||||||
<th class="pb-2 text-left">{m.training_history_col_status()}</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>
|
{#if showPersonColumns}
|
||||||
<th class="hidden pb-2 text-left md:table-cell">{m.training_col_person()}</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}
|
||||||
<th class="pb-2 text-right">{m.training_history_col_blocks()}</th>
|
<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_docs()}</th>
|
||||||
<th class="hidden pb-2 text-right md:table-cell">{m.training_history_col_cer()}</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">
|
<tbody id="training-history-rows">
|
||||||
{#if runs.length === 0}
|
{#if runs.length === 0}
|
||||||
<tr>
|
<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()}
|
{m.training_history_empty()}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -117,18 +120,20 @@ 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]}
|
{#if showPersonColumns && run.personId && personNames?.[run.personId]}
|
||||||
<span class="mt-0.5 block text-xs text-ink-3 md:hidden"
|
<span class="mt-0.5 block text-xs text-ink-3 md:hidden"
|
||||||
>{personNames[run.personId]}</span
|
>{personNames[run.personId]}</span
|
||||||
>
|
>
|
||||||
{/if}
|
{/if}
|
||||||
</td>
|
</td>
|
||||||
<td class="hidden py-2 text-left text-ink-2 md:table-cell">
|
{#if showPersonColumns}
|
||||||
{run.personId ? m.training_type_personalized() : m.training_type_base()}
|
<td class="hidden py-2 text-left text-ink-2 md:table-cell">
|
||||||
</td>
|
{run.personId ? m.training_type_personalized() : m.training_type_base()}
|
||||||
<td class="hidden py-2 text-left text-ink-2 md:table-cell">
|
</td>
|
||||||
{run.personId && personNames?.[run.personId] ? personNames[run.personId] : '—'}
|
<td class="hidden py-2 text-left text-ink-2 md:table-cell">
|
||||||
</td>
|
{run.personId && personNames?.[run.personId] ? personNames[run.personId] : '—'}
|
||||||
|
</td>
|
||||||
|
{/if}
|
||||||
<td class="py-2 text-right text-ink-2">{run.blockCount}</td>
|
<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 text-ink-2 md:table-cell">{run.documentCount}</td>
|
||||||
<td class="hidden py-2 text-right md:table-cell"
|
<td class="hidden py-2 text-right md:table-cell"
|
||||||
|
|||||||
Reference in New Issue
Block a user