Commit graph

11 commits

Author SHA1 Message Date
42f6b63715 Merge pull request 'Join OCR line breaks into flowing text' (#1) from feature/ocr-remove-newlines into main 2026-11-06 14:24:52 +00:00
b1a79435ef Join OCR line breaks into flowing text
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>
2026-11-06 15:05:02 +01:00
868be4bdda Support running behind a TLS-terminating reverse proxy
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>
2026-11-02 17:10:50 +01:00
7107846624 Fix OCR dropping German umlauts by loading the German model
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>
2026-11-02 17:00:01 +01:00
be421d83cb Rename Book to Topic throughout the app
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
2026-08-27 18:55:51 +02:00
3da4dec452 Let the user crop the scanned photo before OCR
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
2026-08-27 18:43:47 +02:00
88d965a364 Add camera scan-to-text for notes via on-device OCR
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
2026-08-27 18:19:25 +02:00
39f7eb8804 Add a real PWA icon (notes glyph) instead of a flat color placeholder
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
2026-08-27 17:54:17 +02:00
47d9113f3c Make book/topic a required select instead of datalist input
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
2026-08-27 17:43:11 +02:00
73ed2e2cf1 Scaffold Reading Notes app: React/Vite PWA client, Express server with Nextcloud Collectives integration
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
2026-08-26 20:07:40 +02:00
61901071f7 Initial commit 2026-08-26 15:20:01 +00:00