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