Commit graph

245 commits

Author SHA1 Message Date
Richard Roberson
071d967f8f feat(pdf): modernize text highlighting and parsing for fluidity
- Offload computationally intensive text matching for real-time highlighting to a dedicated Web Worker, ensuring the main thread remains responsive during playback.
- Implement a new overlay-based highlighting system that renders independently of the PDF's text layer, providing smoother and more reliable visual feedback without interfering with document rendering.
- Introduce a new setting allowing users to enable or disable real-time text highlighting in PDFs, offering personalized control over the reading interface.
- Upgrade the underlying text comparison algorithm to Dice similarity for more accurate and context-aware matching of spoken words to on-screen text, improving synchronization precision.
- Improve sentence boundary detection, especially for quoted dialogue and complex structures, by enhancing the NLP processing logic, leading to a more natural audio-text flow.
2025-11-15 14:06:44 -07:00
Richard Roberson
2f39e8f014 perf(test): optimize test execution and error handling
- Reduce Playwright worker allocation from 75% to 50% for better resource management
- Disable parallel test execution temporarily to isolate flaky test behavior
- Enhance audio utility to fail fast on user cancellation, preventing unnecessary retries
- Consolidate test-specific utilities within individual test suites for better isolation
- Introduce export functionality test coverage with new export.spec.ts suite
2025-11-14 18:52:49 -07:00
Richard Roberson
5316596a1b refactor(db): migrate to Dexie with reactive queries and simplify data layer
Replaces custom IndexedDB implementation with Dexie ORM, eliminating 850+ lines of
boilerplate code and introducing reactive live queries across all document types.
Transforms document management from imperative refresh patterns to automatic
reactive updates using dexie-react-hooks.

Simplifies TTS backend by removing concurrency semaphore while maintaining
request de-duplication through in-flight tracking. Streamlines document hooks
by removing manual state management and refresh methods.

Updates package dependencies and type definitions to support new database
architecture while maintaining full backward compatibility for existing
documents and settings.

BREAKING CHANGE: Document hooks no longer expose refresh() methods as updates
are now reactive through live queries.
2025-11-14 16:14:00 -07:00
Richard Roberson
e3799e40aa feat(tts): add smart sentence continuation
introduce configurable smart sentence splitting with persisted state,
UI toggle, and EPUB/PDF contexts that send continuation metadata.
enhance TTS pipeline to merge cross-page sentences, manage carryover,
and trigger visual page changes during playback for smoother narration.

update README with kokoro quick-start guidance, remove the legacy
issues mapping doc, and add deterministic TTS mocks plus sample audio
for Playwright tests.
2025-11-14 12:00:03 -07:00
Richard Roberson
d7ef0fa8bb feat(api): implement concurrency control and request de-duplication for TTS audio processing 2025-11-13 00:27:04 -07:00
Richard Roberson
70723f4c1d perf(api): add LRU cache for TTS audio responses
Introduce an in-memory LRU cache for TTS audio with configurable
size and TTL via TTS_CACHE_MAX_SIZE_BYTES and TTS_CACHE_TTL_MS.
Return X-Cache headers (HIT/MISS) and set route runtime to nodejs.
Cache key includes provider, model, voice, speed, format, text,
and optional instructions.

Normalize non-Kokoro multi-voice input to the first token while
preserving full voice string in the cache key. Default Deepinfra
model to hexgrad/Kokoro-82M when none is provided.

Fix Deepinfra Kokoro behavior by enforcing single-voice selection:
- ui: only enable multi-select when provider supports >1 voices
- voice utils: Deepinfra max voices set to 1
- tests: gate provider selection and multi-voice tests by CI and
  increase timeout for stability
2025-11-12 23:28:05 -07:00
Richard Roberson
1dcffc82d8 feat(tts,ui,api): add Kokoro multi-voice selection and SDK support
- Introduce voice utils (model detection, voice parsing/weights, limits)
- Enable Kokoro multi-voice strings across OpenAI/Deepinfra/custom providers
- Normalize non-Kokoro voices to single token for SDK calls
- Expose full Kokoro voice list for custom-openai Kokoro models
- Update TTS API to return audio as ArrayBuffer and improve logging
- Add multi-select UI for Kokoro voices with provider-based clamping
- Preserve Kokoro voice strings in TTSContext and coalesce restarts
- Merge multi-sentence quoted dialogue in NLP sentence splitter
- Update tests for single and multi-voice selection flows
2025-11-12 20:46:45 -07:00
Richard Roberson
21870ed576 fix(api): stabilize DOCX to PDF conversion and cleanup
- Isolate concurrent LibreOffice runs with per-job profile directories
  (soffice -env:UserInstallation) and per-job temp folders
- Poll for generated PDF and verify stable file size before reading
- Consolidate temp artifacts under docstore/tmp and clean up via rm -r
- Add headless/nologo flags and improve error handling

ui(accessibility):
- ConfirmDialog exposes proper dialog roles
- DocumentFolder toggle adds type, aria-expanded, aria-controls, and title;
  associate content panel with an id
- HTMLViewer wraps content in .html-container for HTML/TXT views

test: add comprehensive Playwright specs and helpers
- Accessibility, API health, deletion flows, folders, navigation, playback,
  and upload scenarios
- Add sample.md and unsupported.xyz; update sample.pdf; extend helpers

ci: run Playwright workflow on version1.0.0 branch
2025-11-12 16:21:11 -07:00
Richard Roberson
42665884d7 feat(audiobook): add chapter-based export with UI and API
Introduce end-to-end chapterized audiobook generation with persistent
storage, resumable workflows, and MP3/M4B support.

API:
- add /api/audio/convert/chapter (GET/DELETE) for per-chapter ops
- add /api/audio/convert/chapters (GET/DELETE) for listing/reset
- enhance /api/audio/convert:
  - accept mp3|m4b, stream combined file, cache complete output
  - robust chapter indexing, docstore persistence, list concat
  - AbortSignal-aware ffmpeg/ffprobe, 499 on cancel

UI/UX:
- add AudiobookExportModal with progress, resume, regenerate, download
- add ProgressCard, enhance ProgressPopup (click-to-focus, richer info)
- add Header, ZoomControl; move TTSPlayer to sticky bottom bar
- redesign EPUB/HTML/PDF pages for full-height layout and controls
- add HomeContent; compact uploader variant; document list polish

TTS/Contexts:
- EPUB/PDF contexts now generate per-chapter to disk, return bookId
- support chapter regeneration; progress/cancel propagation
- pass provider/model/instructions; standardize MP3 TTS output
- HTML context updates for model/instructions

Styling:
- globals: overlay-dim, scrollbar styles, prism gradient utilities
- theme vars: secondary-accent, prism-gradient; tailwind color addition

Misc:
- fix PDF scale calc to use container height
- EPUB theme reader area fills height
- time estimation update cadence stab
- audio util passes format to combine endpoint
2025-11-11 13:32:30 -07:00
Richard Roberson
e7ce1a34ce Update docs 2025-11-10 15:30:23 -07:00
Richard Roberson
452bc2adfe feat: Add issue triage and mapping documentation for OpenReader v1
- Created `issues-to-components.md` to summarize open issues and their mappings to components for v1 development.
- Documented key features, bugs, and proposed solutions for issues #59, #48, #47, #44, and #40.
- Outlined global guardrails and cross-cutting improvements for the v1 architecture.

chore: Establish v1 todo and planning framework

- Created `todo.md` to capture the 1.0 rewrite plan, including scope, architecture overview, phased milestones, and a master checklist.
- Defined action items, dependency ordering, and issue mapping alignment for efficient development.

chore: Update pnpm workspace configuration

- Added `ignoredBuiltDependencies` for `canvas` in `pnpm-workspace.yaml` to prevent build issues.
2025-11-10 13:19:45 -07:00
Richard Roberson
77c955bfae fix(settings): restrict model selection for Deepinfra in production without API key 2025-11-09 17:19:37 -07:00
Richard Roberson
4d3c2cf3cf fix(settings): adjust Deepinfra options and placeholder text based on prod or not 2025-11-09 17:16:12 -07:00
Richard Roberson
4050170160 fix(footer): update Deepinfra link in footer component 2025-11-09 17:09:50 -07:00
Richard Roberson
a54d83eda5 fix(settings): set default TTS provider to Deepinfra in production 2025-11-09 17:05:23 -07:00
Richard Roberson
1614bf46bc fix(tts): add missing ttsProvider dependency to useCallback hooks
Some checks failed
Build and Publish Docker Image / build (push) Has been cancelled
2025-11-09 16:43:13 -07:00
Richard Roberson
dad1dfd26f chore(ci): update Playwright workflow to use pnpm and remove .npmrc 2025-11-09 15:56:09 -07:00
Richard Roberson
1d57004e59 fix(docs): readme 2025-11-09 15:54:36 -07:00
Richard Roberson
b21bdb3a21 feat(tts): add multi-provider TTS support with Deepinfra and custom OpenAI-compatible endpoints
Add comprehensive multi-provider TTS support enabling users to choose between OpenAI, Deepinfra, and custom OpenAI-compatible endpoints. Implement provider-specific voice management with automatic voice restoration per provider-model combination, and migrate package manager to pnpm for improved dependency handling.

Key changes:
- Add TTS provider selection (OpenAI, Deepinfra, custom-openai) in settings UI
- Implement provider-specific model and voice lists with dynamic fetching
- Add voice persistence per provider-model combination in savedVoices
- Support Deepinfra models: Kokoro-82M, Orpheus-3B, Sesame-1B with their voice libraries
- Migrate to pnpm with frozen lockfile for reproducible builds
- Update Docker configuration to use pnpm and Deepinfra API defaults
- Add migration logic for existing users to infer provider from stored baseUrl
- Update test helpers and Playwright configuration for Deepinfra API
- Add example docker-compose.yml with Kokoro-FastAPI integration

BREAKING CHANGE: Voice selection is now provider-model specific. Previously saved voices will be migrated to the new savedVoices structure, but users may need to reselect voices if switching providers.
2025-11-09 15:47:17 -07:00
Richard Roberson
e56736fda8 Update README.md 2025-11-09 11:22:30 -07:00
Richard Roberson
d2477dc9d8
Merge pull request #58 from RobbyV2/feat/SaveLoadProgress
Some checks failed
Build and Publish Docker Image / build (push) Has been cancelled
2025-07-20 12:13:07 -06:00
RobbyV2
7b703f015f Add cancelText parameter 2025-07-19 21:19:12 -07:00
RobbyV2
32f5cdc494 Saving and Loading Progress Bar 2025-07-19 20:22:50 -07:00
Richard Roberson
f5776e5494
Merge pull request #56 from RobbyV2/DocSelectLoad 2025-07-19 21:16:41 -06:00
Richard Roberson
ba461b20c0
Merge pull request #57 from RobbyV2/feat/MultiUpload 2025-07-19 21:16:29 -06:00
RobbyV2
772aa83f6a Upload multiple files 2025-07-19 19:22:21 -07:00
RobbyV2
0bcae0dee7 Add document selection loading icon 2025-07-19 18:58:08 -07:00
Richard Roberson
593dd7d1a1
Merge pull request #55 from RobbyV2/AutoSelect
Auto select page number when navigating
2025-07-19 13:53:45 -06:00
Richard Roberson
4f633c1359
Merge pull request #54 from RobbyV2/PDF-Click
Allow clicking of internal links
2025-07-19 13:53:25 -06:00
RobbyV2
12e30f4ecf Allow clicking of internal links 2025-07-19 12:46:05 -07:00
RobbyV2
41ea2cdc52 Auto select navigation 2025-07-19 12:40:01 -07:00
Richard Roberson
6b03d9c946
Merge pull request #53 from RobbyV2/main
Some checks failed
Build and Publish Docker Image / build (push) Has been cancelled
2025-07-17 19:00:32 -06:00
RobbyV2
0aac3f4816 Move button closure higher in SettingsModal 2025-07-17 16:49:52 -07:00
Richard Roberson
b56584cbed Change go to page + add Vercel Analytics integration 2025-06-30 12:10:56 -06:00
Richard Roberson
08480f07ed
Merge pull request #52 from thepycoder/feature/better-speed-control 2025-06-29 15:09:05 -06:00
Richard Roberson
b4e538ca3b
Merge pull request #51 from thepycoder/feature/remember-last-location 2025-06-29 15:08:14 -06:00
Victor Sonck
89833d596b Allow for player speed changes as well as native voice speed changes. Kokoro for example swallows parts of words when asked to go faster than maybe 1.3x. This fixes that, by simply speeding up the player instead. Since we're already using the html5 version of howler, by default it will pitch-correct the audio and it sounds quite good! 2025-06-23 14:09:51 +02:00
Victor Sonck
ece8bcd35a Added saving and restoring last location in PDFs 2025-06-23 13:57:27 +02:00
Richard Roberson
e6cd1d0264 Bump version + fix build error
Some checks failed
Build and Publish Docker Image / build (push) Has been cancelled
2025-06-22 13:47:23 -06:00
Richard Roberson
ee27330569 Merge branch 'thepycoder-feature/merge_nlp_implementations' 2025-06-22 13:41:40 -06:00
Richard Roberson
c9f8a05137 Merge branch 'feature/merge_nlp_implementations' of https://github.com/thepycoder/OpenReader-WebUI into thepycoder-feature/merge_nlp_implementations 2025-06-22 13:25:10 -06:00
Richard Roberson
8cf685633d Merge branch 'feature/merge_nlp_implementations' of https://github.com/thepycoder/OpenReader-WebUI into thepycoder-feature/merge_nlp_implementations 2025-06-22 13:23:46 -06:00
Richard Roberson
967ffcf074 Merge branch 'thepycoder-feature/editable_pagenumber' 2025-06-22 13:19:33 -06:00
Richard Roberson
8d17c69374 Change width and text color 2025-06-22 13:17:26 -06:00
Richard Roberson
d933ca93c7 Merge branch 'feature/editable_pagenumber' of https://github.com/thepycoder/OpenReader-WebUI into thepycoder-feature/editable_pagenumber 2025-06-22 13:01:18 -06:00
Richard Roberson
555a8c8a9d Merge branch 'main' of https://github.com/richardr1126/OpenReader-WebUI 2025-06-22 12:58:16 -06:00
Richard Roberson
b9ce1d6a8f Change tts url for tests 2025-06-22 12:58:11 -06:00
Victor Sonck
4c92b9875c Remove the NLP route, since it is no longer used. 2025-06-22 15:48:33 +02:00
Victor Sonck
740c5e17d3 Add editable page number in PDF navigator view, to make it much easier to jump to specific pages 2025-06-20 08:32:53 +02:00
Victor Sonck
f594ca836b Refactored NLP into a single, shared function for splitting to sentences.
now both handleClick and global sentences are the exact same, so the sentenceIndex will always be correct.
2025-06-20 08:25:29 +02:00