WIP: feat: issues #40, #46, #47 — PDF viewer, books_dir default, import UX #48

Closed
mik-tf wants to merge 0 commits from development_issues_40_46_47 into development
Owner

Changes

#46 — Default books_dir to ~/hero/var/hero_books/books/

  • books_dir is now Option<PathBuf> with env HERO_BOOKS_DIR
  • Falls back to HERO_BOOKS_DATA/books/ then ~/hero/var/hero_books/books/
  • Auto-creates the directory on startup if missing
  • make run/serve/demo still pass explicit --books-dir for local dev
  • After import pipeline completes, re-exports books and refreshes the in-memory cache so new libraries appear on homepage immediately
  • Re-discovers namespaces after import
  • Shows "View Libraries" and "Import Another" buttons on completion

#40 — Internal PDF viewer

  • New /book/{name}/pdf/viewer and /book/{name}/page/{page}/pdf/viewer routes
  • Renders full-screen HTML page with embedded PDF iframe
  • Toolbar with breadcrumbs, Back, Download, and New Tab buttons
  • Book template "View PDF" buttons now open the viewer instead of raw PDF
  • Raw PDF still accessible via /pdf/view endpoint and New Tab button

Testing

  • cargo clippy -- -D warnings — clean
  • cargo test --lib --bins --tests — 136 passed
  • cargo build --release — success
  • Smoke tests — 31 passed, 0 failed

Closes #40, closes #46, closes #47

## Changes ### #46 — Default books_dir to ~/hero/var/hero_books/books/ - `books_dir` is now `Option<PathBuf>` with env `HERO_BOOKS_DIR` - Falls back to `HERO_BOOKS_DATA/books/` then `~/hero/var/hero_books/books/` - Auto-creates the directory on startup if missing - `make run/serve/demo` still pass explicit `--books-dir` for local dev ### #47 — Import UX: auto-refresh + navigation link - After import pipeline completes, re-exports books and refreshes the in-memory cache so new libraries appear on homepage immediately - Re-discovers namespaces after import - Shows "View Libraries" and "Import Another" buttons on completion ### #40 — Internal PDF viewer - New `/book/{name}/pdf/viewer` and `/book/{name}/page/{page}/pdf/viewer` routes - Renders full-screen HTML page with embedded PDF iframe - Toolbar with breadcrumbs, Back, Download, and New Tab buttons - Book template "View PDF" buttons now open the viewer instead of raw PDF - Raw PDF still accessible via `/pdf/view` endpoint and New Tab button ## Testing - `cargo clippy -- -D warnings` — clean - `cargo test --lib --bins --tests` — 136 passed - `cargo build --release` — success - Smoke tests — 31 passed, 0 failed Closes #40, closes #46, closes #47
feat: issues #40, #46, #47 — PDF viewer, books_dir default, import UX
All checks were successful
Test / test (pull_request) Successful in 3m3s
Test / integration (pull_request) Successful in 8m30s
078b52543c
#46 — Default books_dir to ~/hero/var/hero_books/books/
- books_dir is now Option<PathBuf> with env HERO_BOOKS_DIR
- Falls back to HERO_BOOKS_DATA/books/ then ~/hero/var/hero_books/books/
- Auto-creates the directory on startup if missing
- make run/serve/demo still pass explicit --books-dir for local dev

#47 — Import UX: auto-refresh + navigation link
- After import pipeline completes, re-exports books and refreshes
  the in-memory cache so new libraries appear on homepage immediately
- Re-discovers namespaces after import
- Shows 'View Libraries' and 'Import Another' buttons on completion

#40 — Internal PDF viewer
- New /book/{name}/pdf/viewer and /book/{name}/page/{page}/pdf/viewer routes
- Renders full-screen HTML page with embedded PDF iframe
- Toolbar with breadcrumbs, Back, Download, and New Tab buttons
- Book template 'View PDF' buttons now open the viewer instead of raw PDF
- Raw PDF still accessible via /pdf/view endpoint and New Tab button

Closes #40, closes #46, closes #47
refactor: PDF viewer uses base.html template for uniform UI
All checks were successful
Test / test (pull_request) Successful in 3m35s
Test / integration (pull_request) Successful in 6m7s
6a7b416109
- Created templates/pdf_viewer.html extending base.html — same navbar,
  breadcrumbs, theme toggle, and footer as all other pages
- Replaced standalone HTML render_pdf_viewer with Askama PdfViewerTemplate
- Updated books.html: eye icon on book cards opens viewer (not raw PDF)
- Updated page.html: Book PDF / Page PDF buttons open viewer
- Breadcrumbs now consistent: Libraries > Library > Book > PDF
- PDF iframe fills remaining viewport height below toolbar
fix: library page View PDF button uses internal viewer
All checks were successful
Test / test (pull_request) Successful in 3m37s
Test / integration (pull_request) Successful in 6m6s
0657af473d
Update library.html eye icon to use /pdf/viewer route instead of
/pdf/view with target=_blank. Now all PDF links across the app
(book, page, books list, library) consistently use the internal
PDF viewer.
mik-tf changed title from feat: issues #40, #46, #47 — PDF viewer, books_dir default, import UX to WIP: feat: issues #40, #46, #47 — PDF viewer, books_dir default, import UX 2026-02-13 13:35:51 +00:00
mik-tf closed this pull request 2026-02-13 13:46:55 +00:00
All checks were successful
Test / test (pull_request) Successful in 3m37s
Test / integration (pull_request) Successful in 6m6s

Pull request closed

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
lhumina_code/hero_books!48
No description provided.