Skip to content

A reader has a card and an origin has a label - #722

Merged
WaylandYang merged 1 commit into
devfrom
feat/a-reader-has-a-card
Sep 15, 2026
Merged

WaylandYang merged 1 commit into
devfrom
feat/a-reader-has-a-card

Conversation

@WaylandYang

Copy link
Copy Markdown
Contributor

This is the interface cut for decision record 0040. The Models page gets cards for the two readers added in #720 and #721, and evidence and document sections now say when their words were read by a model rather than written in the file.

What changes

  • Administration → Models: a new "Reading scans and recordings" section below the chat and embedding cards, with two cards.
    • Document reading (OCR): service URL, backend (optional), API key. Saves to PUT …/settings/ocr.
    • Transcription: base URL, model, API key. Saves to PUT …/settings/transcribe.
    • Both follow the existing card rules (Models settings: unclear save and connection-test feedback #698):
      • an edit makes the card dirty and disables Test;
      • "Testing…" only lights on the card that was pressed;
      • a fresh result replaces the saved state;
      • the key field says when a key is configured.
    • After a save that re-queued waiting files, the card says so, e.g. "Saved. 1 waiting file is being read."
    • Test results: OCR shows "Reachable (MinerU 2.5.4)", transcription shows "Reachable and authenticated", and errors appear in the danger tone.
  • Origin labels (web/src/origin.ts, with vitest):
    • Words the file itself holds carry no label.
    • The other origins read OCR · p. 2, Transcribed · 1:04–1:37 · A, B and Described by a model.
    • Hovering a label says what to watch for (a misread digit, a misheard name, nobody said this) and which model read it.
    • Where labels appear:
      • the fact evidence card on the graph page, next to the file and section link;
      • each section header in the document viewer.
  • Alert copy: document.needs_reader no longer says "neither is configured" (one reader may be), and points to Administration → Models.
  • API types: settings view, test results, the two save calls, and origin fields on Evidence. ChunkFull already had them.
  • en and zh strings are included.

Verification

  • pnpm build passes (style guard, tsc, vite) and pnpm test passes 63 tests, 6 of them new.
  • Looked at in a browser against a real server: this branch's web/dist, cut 3's binary, a copied database, and fake MinerU and transcription services.
    • Models page: the two new cards sit under their own heading and match the existing cards.
      • Filling the OCR URL showed "Unsaved changes…" with Test disabled.
      • Save showed "Saved. 1 waiting file is being read.", and the scan uploaded before the service existed was then read.
      • Test showed "Reachable (MinerU 2.5.4)".
    • Document viewer for that scan: "Section 1 · OCR · p. 1" and "Section 2 · OCR · p. 2", with the rent table as a Markdown table.
    • Graph → entity → evidence: chunks marked in the copied database show "OCR · p. 2" and "Transcribed · 1:04–1:37 · A, B" next to the source link.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: WaylandYang <wayland0916@gmail.com>
@WaylandYang
WaylandYang merged commit bb56469 into dev Sep 15, 2026
4 checks passed
@WaylandYang
WaylandYang deleted the feat/a-reader-has-a-card branch September 15, 2026 16:46
@WaylandYang WaylandYang mentioned this pull request Sep 19, 2026
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