feat: flag books for metadata review and mark barcode-scanned books #88

Merged
jfro merged 1 commit from feat/review-and-scan-flags into main 2026-10-25 22:39:52 +00:00
Owner

Closes #78
Closes #80

One migration (20261025220000_add_review_and_scan_flags_to_books) adds three columns to books: needs_metadata_review (bool, default false), metadata_review_note (text, max 2000 chars) and scanned_via_barcode (bool, default false), plus a partial index on flagged books. Migrations run on app start, so deploys need no extra step.

#78 Metadata review

  • Edit page: a new "Metadata Review" section with a checkbox and an optional note.
  • Book page: a warning alert with the note while the flag is set.
  • Library: a "Needs review" toggle next to the book count (/books?needs_review=true), kept across search and the grid/list switch.

#80 Scanned via barcode

  • Set on books created by the barcode scanner tab (POST /books/scan), the batch scanner (POST /books/batch-add) and the camera scan (the JS adds scanned=true to the ISBN lookup, and the single-result add form carries book[scanned_via_barcode]).
  • A scan that matches an existing book by ISBN marks that book too, since the scan confirms the ISBN fits a real copy. A batch match by title+author only doesn't.
  • Not set for typed ISBNs, title/UPC searches or manual entry.
  • Book page shows a "Scanned via barcode" badge.

Tests: book_review_and_scan_flags_test.exs (12 cases covering each scan path, the negative paths, the edit → show round trip, the list filter and the note limit). mix precommit is green. Browser check (desktop + phone width): flag + note on the edit page, alert on the book page, list filter on/off, unflag.

Not covered by a browser check: the real camera scan (needs a camera); its server side is under test.

Closes #78 Closes #80 One migration (`20261025220000_add_review_and_scan_flags_to_books`) adds three columns to `books`: `needs_metadata_review` (bool, default false), `metadata_review_note` (text, max 2000 chars) and `scanned_via_barcode` (bool, default false), plus a partial index on flagged books. Migrations run on app start, so deploys need no extra step. **#78 Metadata review** - Edit page: a new "Metadata Review" section with a checkbox and an optional note. - Book page: a warning alert with the note while the flag is set. - Library: a "Needs review" toggle next to the book count (`/books?needs_review=true`), kept across search and the grid/list switch. **#80 Scanned via barcode** - Set on books created by the barcode scanner tab (`POST /books/scan`), the batch scanner (`POST /books/batch-add`) and the camera scan (the JS adds `scanned=true` to the ISBN lookup, and the single-result add form carries `book[scanned_via_barcode]`). - A scan that matches an existing book **by ISBN** marks that book too, since the scan confirms the ISBN fits a real copy. A batch match by title+author only doesn't. - Not set for typed ISBNs, title/UPC searches or manual entry. - Book page shows a "Scanned via barcode" badge. Tests: `book_review_and_scan_flags_test.exs` (12 cases covering each scan path, the negative paths, the edit → show round trip, the list filter and the note limit). `mix precommit` is green. Browser check (desktop + phone width): flag + note on the edit page, alert on the book page, list filter on/off, unflag. Not covered by a browser check: the real camera scan (needs a camera); its server side is under test.
jfro added this to the v0.9.0 milestone 2026-10-25 21:12:22 +00:00
feat: flag books for metadata review and mark barcode-scanned books
All checks were successful
CI / test (pull_request) Successful in 48s
5f0d90b3b9
One migration adds needs_metadata_review, metadata_review_note and
scanned_via_barcode to books.

The edit page gets a Needs metadata review checkbox and an optional note;
the book page shows the flag and note, and the library list can be
filtered to flagged books.

Books added through the barcode scanner tab, the batch scanner or the
camera scan are marked as scanned, as are existing books a scan matches
by ISBN. The book page shows a Scanned via barcode badge.

Closes #78
Closes #80
jfro merged commit 9be1ad9857 into main 2026-10-25 22:39:52 +00:00
jfro deleted branch feat/review-and-scan-flags 2026-10-25 22:39:52 +00:00
Sign in to join this conversation.
No reviewers
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
jfro/fuzzy_catalog!88
No description provided.