Skip to content

fix: clarify PaddleOCR OCR configuration UX#153

Merged
webup merged 2 commits into
developfrom
fix/ocr-config-ux-152
May 13, 2026
Merged

fix: clarify PaddleOCR OCR configuration UX#153
webup merged 2 commits into
developfrom
fix/ocr-config-ux-152

Conversation

@webup
Copy link
Copy Markdown
Contributor

@webup webup commented May 13, 2026

What

  • default the OCR page to the hosted PaddleOCR endpoint instead of an empty field plus a misleading placeholder
  • stop reusing the Models-page AI Studio key in the OCR form, and add inline guidance that PaddleOCR needs its own token
  • clear stale test-status messages when users edit or save the OCR form, and map OCR failures to actionable token/endpoint/network/service guidance
  • add regression tests for the default endpoint, stale-error cleanup, and OCR error-message mapping

Why

How

  • introduced a hosted PaddleOCR default endpoint constant and used it to seed the OCR form
  • removed the shared-model-token prefill path and tightened saved-config detection to require a real OCR token
  • extracted OCR error translation into a small helper so the page can consistently convert raw transport/upstream failures into user-facing messages
  • updated the OCR page to reset stale connection status on edits and saves, then added focused Vitest coverage

Verification

  • npx vitest run src/modules/ocr/__tests__/OcrPage.test.tsx src/modules/ocr/__tests__/errorMessages.test.ts
  • npm run build
  • dev-browser verification against the real PaddleOCR service provided in the issue follow-up: live connection test succeeded and a real sample parse rendered markdown in the patched OCR page

Screenshots

  • UI was verified locally against the patched OCR page and the real PaddleOCR service.
  • I could capture the page locally during verification, but this CLI environment could not upload the image into the GitHub PR body automatically, so this PR is left as draft until a screenshot is attached in GitHub.

Closes #152

@webup webup marked this pull request as ready for review May 13, 2026 06:02
@webup webup merged commit 1000ebc into develop May 13, 2026
10 checks passed
@webup webup deleted the fix/ocr-config-ux-152 branch May 13, 2026 07:44
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.

OCR 配置页面多项 UX 问题:endpoint 提示误导、token 自动填充错误、错误提示混淆、错误信息模糊

1 participant