Login button, sorted and de-duplicated pages, page-by-page editor with uncertain-word review #3

Merged
reudy merged 3 commits from feat/page-editor into main 2026-11-04 17:16:33 +01:00
Member

What changes

Login

  • A Přihlásit / Odhlásit button in the top bar. + Přidat hru and the Upravit buttons only show once you're logged in.
  • An eye button in the password field shows or hides the password.
  • Wrong password: the dialog says "Heslo nesouhlasí", selects the text so you can retype it, and keeps the "stay logged in" box as you set it. Nothing is stored until the server accepts the password. A remembered password that no longer works (e.g. it was changed on the server) is dropped when a page loads.

Page order and duplicates

  • Upload order no longer matters: after transcription, pages are sorted by the page number the model reads off each photo. A photo with no readable number stays after the photo uploaded before it.
  • When the same file is picked twice, the upload page skips the copy and says so.
  • If two different photos of the same page are uploaded (e.g. a retake), only one is used: the one with fewer uncertain words, then more text. The editor offers "Použít místo ní přepis z fotky N" to switch to the other one.

Editor, page by page

  • A page list on the left; badges show how many uncertain words a page has, and failed pages are marked. Missing pages have a dashed outline.
  • Each page shows its photo (click to zoom) next to that page's text, with fields for the page number and "v originále chybí". The text grows with its content and the marked words are highlighted.
  • Per page: Přepsat znovu z fotky, Smazat stranu, and choosing which photo belongs to the page.
  • + Z fotky uploads one more photo and transcribes it. The result fills the !7 "missing" marker, and splits a range such as !5-8 around the new page. This is the way to add page 7 of the 1931 play.
  • Alt+← / Alt+→ move between pages, Ctrl+S saves.

Uncertain words

  • The prompt asks the model to wrap words it isn't sure of in {word}, or {word|other reading}. The reader shows only the first reading. Old word[?] marks are converted.
  • Projít nejistá slova steps through them. For each one you see the line around it, and the photo zoomed to roughly that line. Enter accepts the word as typed; a click picks the alternative. Přeskočit leaves the mark in place. The changes are saved when the dialog closes.

API

  • POST /api/plays/:id/images/:n/transcribe reads a single photo (counts toward the daily cap) and returns {num, body} without touching the text.
  • PATCH now also accepts photos and duplicates.
  • Fix: adding a photo to a seeded play failed with ENOENT, because the folder wasn't created.

Testing

  • npm test: 24 pass. New tests cover sorting, duplicates, guessing page numbers, [?] conversion, braces in the reader, single-photo transcription, and photos for the seeded play.
  • Playwright end to end, with a stub model:
    • wrong then correct password, the eye toggle, "stay logged in";
    • an identical file skipped on upload;
    • pages uploaded as 10, 2, 1, plus a second photo of page 2, sorted into 1, 2, (3 missing), 4, with the duplicate offered;
    • the uncertain-word review saves its changes, and the reader shows no braces;
    • + Z fotky fills !3, and !7 in the 1931 play;
    • photos stay with their pages after a reload. No console errors.
  • Not tested: how well a real model marks uncertain words. That needs an OpenRouter key with credit.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HA82gVRDXpoukzgMFumoJt

## What changes **Login** - A *Přihlásit* / *Odhlásit* button in the top bar. *+ Přidat hru* and the *Upravit* buttons only show once you're logged in. - An eye button in the password field shows or hides the password. - Wrong password: the dialog says "Heslo nesouhlasí", selects the text so you can retype it, and keeps the "stay logged in" box as you set it. Nothing is stored until the server accepts the password. A remembered password that no longer works (e.g. it was changed on the server) is dropped when a page loads. **Page order and duplicates** - Upload order no longer matters: after transcription, pages are sorted by the page number the model reads off each photo. A photo with no readable number stays after the photo uploaded before it. - When the same file is picked twice, the upload page skips the copy and says so. - If two different photos of the same page are uploaded (e.g. a retake), only one is used: the one with fewer uncertain words, then more text. The editor offers "Použít místo ní přepis z fotky N" to switch to the other one. **Editor, page by page** - A page list on the left; badges show how many uncertain words a page has, and failed pages are marked. Missing pages have a dashed outline. - Each page shows its photo (click to zoom) next to that page's text, with fields for the page number and "v originále chybí". The text grows with its content and the marked words are highlighted. - Per page: *Přepsat znovu z fotky*, *Smazat stranu*, and choosing which photo belongs to the page. - *+ Z fotky* uploads one more photo and transcribes it. The result fills the `!7` "missing" marker, and splits a range such as `!5-8` around the new page. This is the way to add page 7 of the 1931 play. - Alt+← / Alt+→ move between pages, Ctrl+S saves. **Uncertain words** - The prompt asks the model to wrap words it isn't sure of in `{word}`, or `{word|other reading}`. The reader shows only the first reading. Old `word[?]` marks are converted. - *Projít nejistá slova* steps through them. For each one you see the line around it, and the photo zoomed to roughly that line. Enter accepts the word as typed; a click picks the alternative. *Přeskočit* leaves the mark in place. The changes are saved when the dialog closes. **API** - `POST /api/plays/:id/images/:n/transcribe` reads a single photo (counts toward the daily cap) and returns `{num, body}` without touching the text. - `PATCH` now also accepts `photos` and `duplicates`. - Fix: adding a photo to a seeded play failed with ENOENT, because the folder wasn't created. ## Testing - `npm test`: 24 pass. New tests cover sorting, duplicates, guessing page numbers, `[?]` conversion, braces in the reader, single-photo transcription, and photos for the seeded play. - Playwright end to end, with a stub model: - wrong then correct password, the eye toggle, "stay logged in"; - an identical file skipped on upload; - pages uploaded as 10, 2, 1, plus a second photo of page 2, sorted into 1, 2, (3 missing), 4, with the duplicate offered; - the uncertain-word review saves its changes, and the reader shows no braces; - *+ Z fotky* fills `!3`, and `!7` in the 1931 play; - photos stay with their pages after a reload. No console errors. - **Not tested:** how well a real model marks uncertain words. That needs an OpenRouter key with credit. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01HA82gVRDXpoukzgMFumoJt
agent added 3 commits 2026-11-04 17:15:45 +01:00
The model now wraps words it isn't sure of in {word} or {word|other}; the
reader shows the first reading. Pages are ordered by the number on each
photo and a page photographed twice is kept once (fewer uncertain words,
then more text). meta.photos records which photo goes with which page.
New POST /images/:n/transcribe re-reads a single photo for the editor.
Seeded plays get an img/ folder on their first photo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HA82gVRDXpoukzgMFumoJt
A Přihlásit/Odhlásit button in the top bar replaces logging in via
Přidat hru. The dialog has an eye toggle, says when it is checking,
and keeps the remember box as it was after a wrong password; nothing is
stored until the server accepts it. A remembered password that no
longer works is dropped on load.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HA82gVRDXpoukzgMFumoJt
The editor shows one original page next to its photo, with a page list,
page number and missing toggle, and highlights {uncertain} words. The
review dialog steps through them with the photo zoomed to about the
right line. Pages can be re-read from their photo or added from a new
photo, which fills a !N missing marker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HA82gVRDXpoukzgMFumoJt
reudy merged commit 39e1e1043b into main 2026-11-04 17:16:33 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: reudy-net/theater-reader#3
No description provided.