After the cropped text is recognized, run a second OCR pass on the full,
uncropped photo (the crop usually cuts off the header/footer) and look
for a printed page number in the outermost lines: a standalone number
("42", "- 17 -"), a labelled one ("Seite 128", "p. 12"), or a number at
either end of a short running header on the first line.
The result fills the Page field only if it is still empty, with a hint
asking the user to check it. Failures are silent; the user can still
type the page.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Scanned text kept a newline wherever the photographed page wrapped.
Lines within a paragraph are now joined with spaces, blank lines are
kept as paragraph breaks, and words hyphenated across a line break are
re-joined.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add TRUST_PROXY so Express honors X-Forwarded-Proto from e.g. Nginx Proxy
Manager. Without it, SECURE_COOKIES=true behind the proxy meant the session
cookie was never set and login didn't stick. Document the NPM setup.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tesseract only loaded the English model, which has no ä/ö/ü/ß, so they were
misread as plain letters. Load deu+eng and normalize output to NFC.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The book/topic field was really always a general-purpose tag, and now
that notes can come from more than just books (camera-scanned pages,
free text), "book" was misleading in the UI as well as the code.
Renames files, functions, variables, the API route (/api/books ->
/api/topics), the note payload field, and the cache TTL env var
(BOOK_CACHE_TTL_MS -> TOPIC_CACHE_TTL_MS) for consistency.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C3DGg1pvmvf81zXs4pk1J7
Whole-page photos carry far more text than the one sentence someone
wants, hurting OCR accuracy and letting stray text leak into notes.
Adds a crop overlay (drag-to-select via Pointer Events, works for
touch and mouse) between capture and OCR, with a "use full photo"
escape hatch for already-tight shots. recognizeText now takes a Blob
so it accepts either the cropped canvas output or the original file.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C3DGg1pvmvf81zXs4pk1J7
Lets a photo of a book page fill in the note text instead of typing
it out. OCR runs entirely client-side (tesseract.js, dynamically
imported so it doesn't bloat the main bundle) - no server changes, no
API keys, and the photo never leaves the device. Recognized text is
appended into the textarea for the user to review/edit before saving.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C3DGg1pvmvf81zXs4pk1J7
The generated icons were solid brand-blue squares with no glyph.
gen-icons.py now procedurally draws a page/notes icon (folded corner,
text lines) with anti-aliasing, kept within the maskable-icon safe
zone so Android's adaptive-icon masks don't clip it. Also adds an
apple-touch-icon and wires favicon/apple-touch-icon links into
index.html, and marks manifest icons purpose "any maskable".
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C3DGg1pvmvf81zXs4pk1J7
Datalist suggestions are unreliably supported on mobile/PWA browsers,
so existing books/topics silently failed to show up when starting the
app on a new device. Replaced with a native <select> (plus an "add
new" option) and made the field mandatory end-to-end.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C3DGg1pvmvf81zXs4pk1J7
Notes are saved as markdown pages in a Nextcloud collective via the Collectives OCS API (page metadata/creation) and WebDAV (content read/append), following the same npm-workspaces + session-auth architecture as CityTracker.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NvmYFQSMqs2N3q2zUDNTVn