fix(ocr): remove redundant page counter from progress display

The progress message already says "Seite 3 von 7 wird analysiert…"
so the separate "3 / 7" counter was redundant. Remove the
OcrProgressBar from the page and inline only the skipped-pages
warning.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-13 10:50:05 +02:00
parent b868da07cd
commit 6b94882409

View File

@@ -9,7 +9,6 @@ import TranscriptionPanelHeader from '$lib/components/TranscriptionPanelHeader.s
import type { TranscriptionBlockData } from '$lib/types';
import { getErrorMessage } from '$lib/errors';
import { translateOcrProgress } from '$lib/ocr/translateOcrProgress';
import OcrProgressBar from '$lib/components/OcrProgressBar.svelte';
let { data } = $props();
@@ -134,8 +133,6 @@ let ocrRunning = $state(false);
let ocrProgressMessage = $state('');
let ocrErrorMessage = $state('');
let ocrPollTimer = $state<ReturnType<typeof setInterval> | null>(null);
let ocrCurrentPage = $state(0);
let ocrTotalPages = $state(0);
let ocrSkippedPages = $state(0);
async function triggerOcr(scriptType: string) {
@@ -173,18 +170,13 @@ function pollOcrJob(jobId: string) {
const rawCode = job.progressMessage ?? '';
const progress = translateOcrProgress(rawCode);
ocrProgressMessage = progress.message;
if (progress.currentPage !== undefined) ocrCurrentPage = progress.currentPage;
if (progress.totalPages !== undefined) ocrTotalPages = progress.totalPages;
if (progress.skippedPages !== undefined) ocrSkippedPages = progress.skippedPages;
if (job.status === 'DONE' || job.status === 'FAILED') {
ocrCurrentPage = ocrTotalPages;
if (ocrPollTimer) clearInterval(ocrPollTimer);
ocrPollTimer = null;
setTimeout(() => {
ocrRunning = false;
ocrProgressMessage = '';
ocrCurrentPage = 0;
ocrTotalPages = 0;
ocrSkippedPages = 0;
}, 1000);
if (job.status === 'FAILED') {
@@ -436,11 +428,11 @@ onMount(() => {
<p class="mt-2 text-sm text-ink-2">
{ocrProgressMessage}
</p>
<OcrProgressBar
currentPage={ocrCurrentPage}
totalPages={ocrTotalPages}
skippedPages={ocrSkippedPages}
/>
{#if ocrSkippedPages > 0}
<p class="mt-1 text-xs text-amber-600">
{ocrSkippedPages} Seiten übersprungen
</p>
{/if}
</div>
{:else if panelMode === 'read'}
<TranscriptionReadView