Redesign the interface around Scan and Library, classify uncatalogued books from similar ones

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-18 11:01:50 -07:00
1 parent 308c0e1ed3
commit 6cec404e21
71 files changed
+8634 -1502

No files matched your search

+8 -25
View File
@@ -13,27 +13,20 @@ npm start
Requires a recent Node (the server runs TypeScript directly).
## Scanning
## Using it
Use the **Scan** tab. Every way of adding a book ends up in the same session list, where a row goes from "Looking up" to "Ready" (a call number was found) or "Needs attention".
The header has **Scan**, **Library (N)** and a gear for settings.
- **Camera**: click *Start camera*, allow access, and hold the barcode (the one with 978 or 979 under it, usually on the back cover) steady in view. A beep means it was read. Reading the same book twice is recognised and not added again.
- **Typed ISBN**: the ISBN box is always focused. Type or paste 10 or 13 digits and press Enter. A USB barcode scanner works the same way, since it types the digits and presses Enter.
- **Search by title and author**: for books with no barcode. Pick the matching result.
- **Enter LCCN**: if the book's copyright page prints a Library of Congress Control Number.
- **Enter by hand**: title, authors, and optionally a call number you already know.
**Scan** is the home screen. On the left are the camera, the last book handled, and one entry box. Hold a barcode in the box on the video (a beep and a green flash mean it was read), press **Capture** or Space for one careful picture, or type an ISBN and press Enter (a USB barcode scanner does the same). The same box takes an LCCN (from the copyright page) or a title: type `Dune by Frank Herbert`, pick a result, or choose *Not listed? Enter it by hand*. On the right, **Cards to print** lists every queued book, books needing attention first. Use **Fix** on a book that needs attention, or the x to remove it (with 6 seconds to undo). A book already printed is only taken off the list, never deleted.
Books marked *Needs attention* appear on the **Print queue** tab, where you can retry the lookup, edit the details (including typing a call number), or delete them. Call numbers marked approximate were derived from a Dewey number rather than found in the Library of Congress catalog; check those.
**Print** opens a small panel: pick where the first card goes on the sheet (handy for a partly used sheet), then **Make PDF**. Cards are printed in shelf order on Avery 5388 sheets (three 3 x 5 inch cards).
## Printing on Avery 5388
1. Open the PDF and print at **Actual size / 100%** (never "Fit to page"), **single-sided**, through the **manual feed slot**.
2. When the cards came out correctly, answer **Yes, clear them** so they are not printed twice.
On the **Print queue** tab, choose which of the three positions on the sheet the first card should use (handy for a partly used sheet) and click *Make PDF*. Cards are printed in shelf order.
**Library** shows every book in shelf order, grouped by main class, with search and a *Needs attention* filter. Click a book to edit it, print another card, look it up again, or delete it. A number marked `~` was borrowed from another edition or from similar books; check those.
1. Open the PDF in your PDF viewer and print at **Actual size / 100%** (never "Fit to page").
2. Print **single-sided**, loading the sheet through the **manual feed slot**.
3. When the cards came out correctly, click *Yes, clear these from the queue* so they are not printed twice.
If the text sits off-centre on the cards, print the **calibration page** (*Printer alignment*, then *Print calibration page*) on plain paper, hold it against a real sheet up to the light, and enter the X and Y offsets in millimetres (limit 10) that bring it into line. Offsets are saved and applied to every later PDF.
**Settings** (the gear) holds the camera picker and printer alignment. If the text sits off-centre on the cards, print the calibration page on plain paper, hold it against a real sheet up to the light, and enter the X and Y offsets in millimetres (limit 10). They are saved and applied to every later PDF.
## Where the data lives
@@ -45,13 +38,3 @@ In `data/booksorter.db` (SQLite) in this folder, created on first run. Back it u
npm test # unit and server tests
npm run typecheck
```
The browser check drives Firefox through the real app. It needs a running server, and it adds, removes and re-adds the test book (ISBN 9781593278281 unless `ISBN` is set), so point the server at a scratch database (`BOOKSORTER_DB=/tmp/scratch.db npm start`) rather than your real one. The first run looks the book up live, which can take a minute:
```
npx playwright install firefox # once
npm start # in another terminal
npm run browser-check # or: node scripts/browser-check.ts [url]
```
Set `SHOTS=/some/dir` to save screenshots, and `ISBN=<isbn13>` to use a different already-resolved book. It checks that the page loads cleanly and calls only localhost, the tabs render, a typed ISBN is resolved, a generated EAN-13 barcode is decoded by the same wasm detector the camera uses, Firefox's fake camera starts and stops, and the print queue produces a PDF. It uses a fake camera, so it cannot prove that your own webcam reads real barcodes well.