feat(transcription): add sticky review progress counter to TranscriptionEditView

Shows 'X / Y geprüft' with a brand-mint progress bar at the top of the
transcription panel. Derived from the blocks prop — no extra state.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-13 13:59:35 +02:00
parent 33dc4654e5
commit 73229077be
2 changed files with 109 additions and 68 deletions

View File

@@ -13,7 +13,9 @@ const block1 = {
text: 'Block eins',
label: null,
sortOrder: 0,
version: 0
version: 0,
source: 'MANUAL' as const,
reviewed: false
};
const block2 = {
id: 'b2',
@@ -22,7 +24,9 @@ const block2 = {
text: 'Block zwei',
label: null,
sortOrder: 1,
version: 0
version: 0,
source: 'OCR' as const,
reviewed: true
};
function renderView(overrides: Record<string, unknown> = {}, service = createConfirmService()) {
@@ -232,3 +236,23 @@ describe('TranscriptionEditView — delete block', () => {
expect(onDeleteBlock).not.toHaveBeenCalled();
});
});
// ─── Review progress counter ──────────────────────────────────────────────────
describe('TranscriptionEditView — review progress counter', () => {
it('shows reviewed count and total when blocks exist', async () => {
// block1: reviewed=false, block2: reviewed=true → "1 / 2 geprüft"
renderView();
await expect.element(page.getByText(/1 \/ 2 geprüft/)).toBeInTheDocument();
});
it('shows 0 reviewed when no blocks are reviewed', async () => {
renderView({ blocks: [block1] }); // block1.reviewed = false
await expect.element(page.getByText(/0 \/ 1 geprüft/)).toBeInTheDocument();
});
it('does not show progress counter when there are no blocks', async () => {
renderView({ blocks: [] });
await expect.element(page.getByText(/geprüft/)).not.toBeInTheDocument();
});
});