Skip to content

Theorem v1.5.4

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 14 Sep 10:14
· 29 commits to main since this release

Added

  • Pitch-Preserving Audio Time-Stretching (WSOLA) — Integrated high-fidelity Waveform Similarity Overlap-Add (WSOLA) time-domain algorithm into native Rust playback (src-tauri/src/audio_player.rs) with normalized cross-correlation phase alignment and Hann window crossfading. Enables smooth narration playback speed control (0.5×–3.0×) without pitch shifting or robotic frequency distortion across both mono and stereo channels.
  • Native Audio Volume & Speed Controls — Exposed Tauri commands tts_audio_set_speed, tts_audio_get_speed, tts_audio_set_volume, and tts_audio_get_volume controlling the native Rodio sink and WSOLA buffer stretching directly in Rust, wired dynamically through ImmersionPlayer.ts.
  • Native PDF In-Book Search Engine — Implemented a streaming, zero-allocation PDF content search engine in native Rust (src-tauri/src/book_search.rs). Parses indirect PDF object streams, decompresses Flate/Deflate content streams, parses PDF text operators (Tj, TJ, ', ", hex strings, and glyph kerning offsets), and runs Rayon parallel page searches with UTF-8 byte-slice context snippet extraction.
  • Instant Native PDF Search Fast-Path — Integrated the native PDF search engine directly into the reader viewport (src/features/reader/engines/pdfjs-engine.tsx). In Tauri desktop/mobile environments, queries execute in parallel in Rust (~15ms) and stream directly into the search panel with instant pdf:page:N jump coordinates, falling back cleanly to the JS worker in pure web browsers.
  • Native Readability Article Extractor — Added extract_article_from_html_native in src-tauri/src/article_extractor.rs, executing fast HTML cleaning, article candidate scoring, and metadata extraction via quick-xml directly in Rust.
  • Dynamic Frontend Readability Code-Splitting — Code-split @mozilla/readability and dompurify in ArticleExtractorService.ts, dynamically loading them only when parsing web articles in browser environments. This sheds over 120KB of minified parser code from the initial frontend chunk.
  • Direct In-Rust SQLite P2P Sync Merging — Added sqlite_merge_sync_entries in src-tauri/src/database.rs, merging incoming Iroh-gossip documents directly inside an atomic SQLite transaction. Directly updates book_metadata, book_annotations, books_fts, and kv_store while cascading deletion_tombstones, eliminating double-hop IPC serialization and preventing Last-Write-Wins collisions.
  • Relational SQLite Vocabulary Storage Subsystem — Added a dedicated normalized vocabulary table in src-tauri/src/database.rs with indexed lookup by (normalized_term, language) and created_at. Automatic idempotent zero-data-loss database migration (run_v154_database_migrations) unpacks existing terms from zustand:theorem-vocabulary into the relational store inside an atomic transaction while preserving the original kv_store blob as an immutable backup.
  • Native EPUB Table of Contents (TOC) Pre-Parsing — Implemented zero-copy streaming pre-parsing for both EPUB 3 Navigation documents (<nav epub:type="toc"> / <nav role="doc-toc">) and EPUB 2 NCX files (<navMap><navPoint>...) in src-tauri/src/epub_parser.rs using quick-xml. Parses nested chapter hierarchies, resolves intra-book relative hrefs with URL fragments, unescapes entities, and packages the result into compact Box<str> / Option<Box<[TocItemDto]>> Cloudflare data layouts inside prefetch_zip_metadata.
  • Instant Foliate Reader Table of Contents Display — Wired the pre-parsed TOC directly into the EPUB bridge (src/core/lib/tauri-epub-bridge.ts) and reader runtime (src/features/reader/foliate-js-runtime/view.js and epub.js), allowing the webview reader to immediately populate chapters and landmarks without blocking on DOMParser XML parsing on the main thread.
  • Direct Library Annotation Navigation — Added interactive "Open in book" navigation directly from cards and context menus in src/features/library/Annotations.tsx, instantly opening the book and jumping to the precise highlight or note location.
  • SQLite Vocabulary Persistence & Sync Integration — Connected saveVocabularyTerm, deleteVocabularyTerm, and onRehydrateStorage in vocabularyStore.ts and sync-orchestrator.ts to SQLite relational CRUD operations (sqlite_get_vocabulary_terms, sqlite_save_vocabulary_term, sqlite_delete_vocabulary_term). Automatically reconciles relational SQLite terms on app startup and synchronizes mutations.

Fixed

  • Reader Page Turn Component Thrashing — Eliminated full 2,800-line React component tree re-renders on every page turn in src/features/reader/Reader.tsx. Decoupled the stats subscription from the active component tree and deferred visible word count extraction to requestIdleCallback after a 1,000ms reading dwell timeout, ensuring buttery 60fps page turns.
  • Instant Intra-Section Navigation & Deadlocks — Removed artificial await wait(100) delay during intra-section page turns in src/features/reader/foliate-js-runtime/paginator.js. Ensured the #locked flag is released in a finally block so failed or aborted section loads can never wedge the page turning pipeline.
  • Bounded Section Navigation & Spine Error Suppression — Added #canGoToIndex() boundary checks prior to #goTo calls in paginator.js, preventing spurious Failed to load section warnings and blank screen states when swiping past the boundaries of the book.
  • Event Listener Leak in Reader Iframe — Guarded iframe selection listener attachments with (doc).__theorem_selection_attached idempotency flag in src/features/reader/engines/foliate-engine.ts, eliminating runaway event listener accumulation and duplicated tap triggers across chapter transitions.
  • Controls Tap-to-Toggle Latency — Removed the artificial 120ms tap-suppression delay in foliate-engine.ts and accelerated chrome toggle transitions from 300ms to 150ms ease-out, restoring instant responsive chrome toggling.
  • Mobile Swipe Sensitivity & Axis Disambiguation — Calibrated mobile touch swipe thresholds in paginator.js (20% width displacement, 0.2 px/ms velocity) and removed the 180ms hold timer lock, allowing diagonal and hesitant thumb swipes to complete naturally without false-positive selection locks.
  • PDF Continuous Scroll Blanks & Height Collapse — Expanded PAGE_PROXY_KEEP_WINDOW to 50 in src/features/reader/engines/pdfjs-engine.tsx (retaining up to 80 loaded page proxies), keeping page placeholders sized accurately and preventing DOM collapse, scroll jumping, and blank renders during rapid scrolling.
  • Cross-Device Goal & Reminder Duplication — Synchronized lastGoalNotifiedDate and lastDailyReminderDate in src/core/store/settingsStore.ts and src/core/lib/sync-import.ts. Flushes reading stats silently on book close and suppresses foreground OS notifications when the application window is focused.
  • Paginator Uncollapse Non-Object Anchor Error — Fixed an unhandled promise rejection in paginator.js where ('collapsed' in range) was evaluated on numeric anchors (1, 0, fractions) during settings re-renders and column layout updates.
  • Highlight Recovery via Text Walker — Added findRangeByText fallback in src/features/reader/foliate-js-runtime/view.js to reliably render highlights even when DOM restructuring invalidates serialized CFI character offsets.

Improved & Performance

  • Complete Elimination of fuse.js — Removed the fuse.js runtime dependency from package.json and replaced it in src/core/lib/search/fuzzy.ts with a lightweight, zero-dependency fuzzy matching engine. Provides exact prefix, word-boundary, substring, and subsequence compactness scoring while reducing bundle overhead to 2KB.
  • High-Velocity PDF Edge Prefetching — Increased PDF continuous scroll edge prefetch lookahead to $2.0 \times \text{viewport}$ and expanded concurrent batch loading to 8 pages for seamless continuous scrolling.
  • Testing Integrity & Boundary Hardening — Expanded tests/reading-time-adaptive.test.ts and tests/paginator-navigation.test.ts with rigorous edge-case and outlier suites (0 words, negative words, 100,000 words, exact 5.0s/180.0s dwell boundaries, corrupt fractions, lock safety, and gesture classification). All 348 Vitest tests and Rust unit tests pass cleanly.

Download & install

Platform Download
Windows (x64) Theorem_v1.5.4_x64-setup.exe
macOS (Apple Silicon) Theorem_v1.5.4_aarch64.dmg
macOS (Intel) Theorem_v1.5.4_x64.dmg
Linux (Debian/Ubuntu) Theorem_v1.5.4_amd64.deb
Linux (any) Theorem_v1.5.4_amd64.AppImage
Android (arm64) app-arm64-release.apk

Linux one-liner: curl -fsSL https://raw.githubusercontent.com/Fundaments-Work/Theorem/main/scripts/install-linux.sh | bash

Desktop builds auto-update in place (Settings → About → Check for Updates). Android updates are manual unless installed via F-Droid.