refactor(document): move MissionControlStrip to document domain

MissionControlStrip is a document-processing pipeline visualiser — it
imports document-domain components (SegmentationColumn, TranscriptionColumn,
ReadyColumn) and belongs in the document domain. It was placed in
shared/dashboard, creating a shared → document coupling that the upcoming
boundaries rule would block.

Refs #410
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-05-05 17:37:36 +02:00
committed by marcel
parent 0f613e49ce
commit 832a8dfe2f
3 changed files with 1 additions and 1 deletions

View File

@@ -0,0 +1,33 @@
<script lang="ts">
import * as m from '$lib/paraglide/messages.js';
import type { components } from '$lib/generated/api';
import SegmentationColumn from '$lib/document/SegmentationColumn.svelte';
import TranscriptionColumn from '$lib/document/transcription/TranscriptionColumn.svelte';
import ReadyColumn from '$lib/document/ReadyColumn.svelte';
type TranscriptionQueueItemDTO = components['schemas']['TranscriptionQueueItemDTO'];
type TranscriptionWeeklyStatsDTO = components['schemas']['TranscriptionWeeklyStatsDTO'];
interface Props {
segmentationDocs: TranscriptionQueueItemDTO[];
transcriptionDocs: TranscriptionQueueItemDTO[];
readyDocs: TranscriptionQueueItemDTO[];
weeklyStats: TranscriptionWeeklyStatsDTO | null;
}
let { segmentationDocs, transcriptionDocs, readyDocs, weeklyStats }: Props = $props();
</script>
<section class="mt-4 rounded-sm border border-line bg-surface p-6">
<h2 class="mb-4 font-sans text-xs font-bold tracking-widest text-ink-3 uppercase">
{m.mission_control_heading()}
</h2>
<div class="grid grid-cols-1 gap-4 sm:grid-cols-3">
<SegmentationColumn docs={segmentationDocs} weeklyCount={weeklyStats?.segmentationCount ?? 0} />
<TranscriptionColumn
docs={transcriptionDocs}
weeklyCount={weeklyStats?.transcriptionCount ?? 0}
/>
<ReadyColumn docs={readyDocs} />
</div>
</section>

View File

@@ -0,0 +1,107 @@
import { describe, it, expect, afterEach } from 'vitest';
import { cleanup, render } from 'vitest-browser-svelte';
import { page } from 'vitest/browser';
import MissionControlStrip from './MissionControlStrip.svelte';
import type { components } from '$lib/generated/api';
type TranscriptionQueueItemDTO = components['schemas']['TranscriptionQueueItemDTO'];
type TranscriptionWeeklyStatsDTO = components['schemas']['TranscriptionWeeklyStatsDTO'];
afterEach(cleanup);
function makeDoc(
id: string,
title: string,
overrides: Partial<TranscriptionQueueItemDTO> = {}
): TranscriptionQueueItemDTO {
return {
id,
title,
annotationCount: 0,
textedBlockCount: 0,
reviewedBlockCount: 0,
contributors: [],
hasMoreContributors: false,
...overrides
};
}
const emptyStats: TranscriptionWeeklyStatsDTO = {
segmentationCount: 0,
transcriptionCount: 0,
readyCount: 0
};
describe('MissionControlStrip', () => {
it('renders section heading always', async () => {
render(MissionControlStrip, {
props: {
segmentationDocs: [],
transcriptionDocs: [],
readyDocs: [],
weeklyStats: null
}
});
await expect.element(page.getByText('Was braucht Aufmerksamkeit?')).toBeInTheDocument();
});
it('renders all three column headings', async () => {
render(MissionControlStrip, {
props: {
segmentationDocs: [makeDoc('s1', 'Seg Dok')],
transcriptionDocs: [makeDoc('t1', 'Trans Dok')],
readyDocs: [makeDoc('r1', 'Ready Dok')],
weeklyStats: emptyStats
}
});
await expect.element(page.getByText('Text markieren')).toBeInTheDocument();
await expect.element(page.getByText('Text transkribieren')).toBeInTheDocument();
await expect.element(page.getByText(/Lesefertig/)).toBeInTheDocument();
});
it('renders document titles in correct columns', async () => {
const segDoc = makeDoc('seg-1', 'Segmentierungs Brief');
const transDoc = makeDoc('trans-1', 'Transkriptions Postkarte');
const readyDoc = makeDoc('ready-1', 'Fertiger Tagebucheintrag');
render(MissionControlStrip, {
props: {
segmentationDocs: [segDoc],
transcriptionDocs: [transDoc],
readyDocs: [readyDoc],
weeklyStats: emptyStats
}
});
await expect.element(page.getByText('Segmentierungs Brief')).toBeInTheDocument();
await expect.element(page.getByText('Transkriptions Postkarte')).toBeInTheDocument();
await expect.element(page.getByText('Fertiger Tagebucheintrag')).toBeInTheDocument();
});
it('renders section heading even when all arrays are empty and weeklyStats is null', async () => {
render(MissionControlStrip, {
props: {
segmentationDocs: [],
transcriptionDocs: [],
readyDocs: [],
weeklyStats: null
}
});
// Heading always visible
await expect.element(page.getByText('Was braucht Aufmerksamkeit?')).toBeInTheDocument();
// All three empty states should also be visible
await expect
.element(page.getByText('Alle Dokumente haben bereits Segmentierungsblöcke.'))
.toBeInTheDocument();
await expect
.element(page.getByText('Keine Dokumente warten auf Transkription.'))
.toBeInTheDocument();
await expect
.element(page.getByText('Noch keine Dokumente vollständig transkribiert.'))
.toBeInTheDocument();
});
});