Theorem v1.5.4
Pre-release
Pre-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, andtts_audio_get_volumecontrolling the native Rodio sink and WSOLA buffer stretching directly in Rust, wired dynamically throughImmersionPlayer.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 instantpdf:page:Njump coordinates, falling back cleanly to the JS worker in pure web browsers. - Native Readability Article Extractor — Added
extract_article_from_html_nativeinsrc-tauri/src/article_extractor.rs, executing fast HTML cleaning, article candidate scoring, and metadata extraction viaquick-xmldirectly in Rust. - Dynamic Frontend Readability Code-Splitting — Code-split
@mozilla/readabilityanddompurifyinArticleExtractorService.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_entriesinsrc-tauri/src/database.rs, merging incoming Iroh-gossip documents directly inside an atomic SQLite transaction. Directly updatesbook_metadata,book_annotations,books_fts, andkv_storewhile cascadingdeletion_tombstones, eliminating double-hop IPC serialization and preventing Last-Write-Wins collisions. - Relational SQLite Vocabulary Storage Subsystem — Added a dedicated normalized
vocabularytable insrc-tauri/src/database.rswith indexed lookup by(normalized_term, language)andcreated_at. Automatic idempotent zero-data-loss database migration (run_v154_database_migrations) unpacks existing terms fromzustand:theorem-vocabularyinto the relational store inside an atomic transaction while preserving the originalkv_storeblob 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>...) insrc-tauri/src/epub_parser.rsusingquick-xml. Parses nested chapter hierarchies, resolves intra-book relative hrefs with URL fragments, unescapes entities, and packages the result into compactBox<str>/Option<Box<[TocItemDto]>>Cloudflare data layouts insideprefetch_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.jsandepub.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, andonRehydrateStorageinvocabularyStore.tsandsync-orchestrator.tsto 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 thestatssubscription from the active component tree and deferred visible word count extraction torequestIdleCallbackafter 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 insrc/features/reader/foliate-js-runtime/paginator.js. Ensured the#lockedflag is released in afinallyblock 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#goTocalls inpaginator.js, preventing spuriousFailed to load sectionwarnings 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_attachedidempotency flag insrc/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.tsand accelerated chrome toggle transitions from 300ms to 150msease-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_WINDOWto 50 insrc/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
lastGoalNotifiedDateandlastDailyReminderDateinsrc/core/store/settingsStore.tsandsrc/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.jswhere('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
findRangeByTextfallback insrc/features/reader/foliate-js-runtime/view.jsto reliably render highlights even when DOM restructuring invalidates serialized CFI character offsets.
Improved & Performance
-
Complete Elimination of
fuse.js— Removed thefuse.jsruntime dependency frompackage.jsonand replaced it insrc/core/lib/search/fuzzy.tswith 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.tsandtests/paginator-navigation.test.tswith 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.