Skip to content

PDF translation progress UI + lower retries (v0.6.12) - #26

Merged
hikariming merged 2 commits into
mainfrom
codex/pdf-sidecar-packaging-fix
Jun 17, 2026
Merged

PDF translation progress UI + lower retries (v0.6.12)#26
hikariming merged 2 commits into
mainfrom
codex/pdf-sidecar-packaging-fix

Conversation

@hikariming

Copy link
Copy Markdown
Owner

Changes

  • Live progress: PDF translation now streams progress instead of blocking silently.
    • Python sidecar emits per-page OPENKOTO_PROGRESS {json} on stdout + readable logs on stderr.
    • Rust translate_pdf_document spawns with piped stdio, parses progress into a pdf-translation-progress event, and logs all sidecar output to the console live.
    • BookReader shows "翻译中 N%" on the translate button.
  • Resilience: cap RateLimitError retries 100 → 8 so a rate-limited run fails fast.
  • Bump desktop to v0.6.12.

Verified: py_compile, cargo check, tsc, BookReader vitest (4/4) all pass.

🤖 Generated with Claude Code

hikariming and others added 2 commits June 17, 2026 09:03
PDF translation ran via a blocking Command::output(), so the app showed no
feedback for the whole (often minutes-long) run and looked frozen on Windows.

- Python sidecar: emit a per-page `OPENKOTO_PROGRESS {json}` line on stdout
  (current/total/percent) via the existing translate_patch callback, plus a
  readable log line on stderr.
- Rust translate_pdf_document: spawn the sidecar with piped stdio and stream
  it live — parse progress markers into a `pdf-translation-progress` Tauri
  event, print all sidecar output to the console as it arrives, and settle at
  100% on success. Replaces the blocking .output() call.
- Frontend BookReader: listen for progress events and show "翻译中 N%" on the
  translate button; reset on completion. Mock the event API in tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A 100-attempt retry on RateLimitError could keep a translation stuck for a
very long time with little feedback. Cap it at 8 attempts so a persistently
rate-limited run fails fast with a clear error.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@hikariming
hikariming merged commit 8aef6a2 into main Jun 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant