* fix(import): pick the declared cover when <meta name="cover"> holds an href
Some EPUB2 producers (FB2 converters among them) write the cover image's
href into `<meta name="cover" content>` instead of its manifest id. Both
parsers only looked the value up as an id, missed, and fell through to
their heuristics: the Rust import parser took the "first" image from a
HashMap (an arbitrary one, so a back-matter illustration became the
cover), and foliate-js took the guide's XHTML cover page and returned it
as the cover blob.
- Resolve the meta content as an href when no manifest id matches, in
the Rust parser and in foliate-js (readest/foliate-js#123).
- Keep the Rust parser's cover manifest in document order so every
heuristic picks the same item as foliate-js's `manifest.find`, and the
same EPUB always gets the same cover.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(import): only accept an image for a <meta name="cover"> href match
The href fallback could match the XHTML cover page (`content="cover.xhtml"`)
and return its bytes as the cover. Restrict it to image items so such
books fall through to the image heuristic as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docs(readme): drop the status column from the features table
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
deepwiki.com now answers non-browser requests with a Vercel bot
challenge (HTTP 429, HTML), so GitHub's camo image proxy gets a 502
and the README shows a broken image. Use a shields.io static badge,
like the rest of the badge row; the link still points to DeepWiki.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* refactor(nix): move nix files out of `ops/`
* feat(nix): package for nix
* docs(nix): add installation guide
* chore(workflows): add workflow to build on nix
* chore(workflows): move flake check to pull requests, and builds to cron
* fix(nix): only add ios shell on darwin
* chore(workflows): add workflow to update flake inputs periodically
* chore(workflows): rename nix.yml to nix-build.yml
* chore(workflows): add cachix to nix-build
* chore: check all systems
* chore: auto-update hashes
* fix: set platform to linux and add warning in docs
* fix: only evaluate android shell if system is not aarch64
* fix: drop soon-to-be-deprecated x86_64-darwin platform
* fix: use more explicit nix build command
* fix: respect .gitignore in src
* chore: only run nix build on push to main
* fix: remove duplicate nix installer action
* chore: fix script formatting
* chore: move build check to flake checks
* chore: remove automatic hash-mismatch fix
* fix: only give read permissions to nix build action
* fix: use more explicit matching
* fix: remove unnecessary passthru references
* fix: pin action versions
* fix: use cachix for nix flake check
* fix: remove unnecessary secret
* fix: do not push flake check builds
* fix: meta.platforms -> platforms
* fix(nix): wire up the public binary cache and drop aarch64-linux
The Cachix cache was populated by CI but unreachable by users: neither the
flake nor the README pointed at it, so every install compiled the Rust/Tauri
stack and webkitgtk from source. Add nixConfig substituters and document the
cachix use / nix.settings opt-ins.
skipPush was passed to install-nix-action, which has no such input, so PR
builds still pushed whenever the token was present. Move it to cachix-action
and drop authToken there: the cache is public, so pulling needs no token, and
PR-triggered builds no longer see the push token at all.
Restrict nix_flake_check to pull_request. It also ran on main pushes, where
nix-build.yml already builds and pushes the same paths.
Drop aarch64-linux from eachSystem. Nothing built or cached it, so ARM Linux
users got a cache miss on everything. That makes the two system != aarch64-linux
guards dead, so fold those attrsets back into their bases.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(nix): refresh the pnpm deps hash after lockfile changes on main
nix flake check builds the pull_request merge ref, so the fixed-output
derivation covers main's pnpm-lock.yaml, not just the branch's. Two lockfile
changes landed on main after the hash was pinned (#5754, #5764), so the FOD
went stale and the check failed with a hash mismatch.
Cargo.lock and the turso plugin are unchanged over the same range, so
cargoHash and tursoPluginDeps still match.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* perf(nix): make the PR flake check evaluation only
nix flake check builds every attribute in `checks`, so `checks.build =
packages.default` turned the PR check into a full release build: cargo vendor,
a production Next.js build, and a cold release compile of the whole Tauri tree.
Nix builds in a pure sandbox, so it cannot use the sccache and rust-cache the
other Rust jobs rely on, and the binary cache is still empty, so nothing
amortized it. Observed over 45 minutes per run.
Drop the attribute. The flake outputs are still evaluated across systems, which
catches eval errors, and nix-build.yml keeps doing the real build on main and
pushing the result to the cache.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore(nix): pin actions/checkout to a commit sha
nix-build.yml used the mutable v5 tag while the other 19 checkout usages in
this repo pin 3d3c42e5aac5ba805825da76410c181273ba90b1 (v7.0.1). A movable tag
lets the action change under us and is what the scorecard pinned-dependencies
check flags.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* docs(nix): compress the README install and fix the dev shell commands
README: five code blocks down to three. The three interchangeable ways to opt
in to the cache collapse to one, and the two configuration.nix snippets merge
into a single block, since a NixOS user edits one file. Note why the cache has
to be repeated there: a flake input's nixConfig does not apply to the importing
system build, so the systemPackages path would otherwise build from source.
CONTRIBUTING: the documented shells pointed at ./ops, which this branch
deleted when it moved the flake to the repository root, so all three commands
failed. The web shell is also named default now, and ios is gated behind
isDarwin.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Huang Xin <chrox.huang@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(tts): play a book's own recorded narration (EPUB 3 Media Overlays)
Read Aloud always synthesized speech, so a professionally narrated read-along
EPUB was read by a robot voice over a book that came with a human one. Play the
recording instead, keeping the entire existing Read Aloud experience: moving
highlight, page-following, sentence/paragraph skip, scrubber and seek, speed,
sleep timer, lock-screen/CarPlay, and background sessions.
This is the Kindle Immersion Reading / Audible Read & Listen experience built on
the open EPUB standard rather than a store-side pairing of two purchases: no
account, no matching entitlements, any narrated EPUB you own or generate.
The stack already had the two seams this needs. `TTSClient` abstracts where audio
comes from; foliate's `TTS` abstracts how text is cut into marks. Recorded
narration is exactly "a different audio source with a different segmentation", so
`src/services/tts/mediaOverlay/` swaps both and leaves the other ~25 files of the
subsystem untouched:
- `parseSmil.ts` parses SMIL clock values and walks <body>/<seq>/<par>.
- `MediaOverlaySection.ts` resolves each par's text fragment to a DOM Range,
groups pars into blocks by nearest block ancestor, and emits the SSML.
- `MediaOverlayTTS.ts` stands in for foliate's TTS with the same navigation
surface, driven by the par list.
- `MediaOverlayClient.ts` plays clips off one HTMLMediaElement, emitting a
boundary as each par becomes audible.
Marks are section-global par ordinals, so marks and audio clips are 1:1 by
construction and there is no text-to-audio matching anywhere in the feature. A
block plays as one continuous span, so a narrated sentence has no seam mid-way.
Selection reuses the Voice picker: the narrator leads the list for books that
carry overlays, and is preselected. `ttsUseNarration` on TTSConfig records the
per-book opt-out, separate from `ttsVoice` because that inherits the global
default. Offline Audio is hidden during narration, since the audio ships inside
the book. Narrated books get a headphones badge in the library, from a
`Book.hasNarration` flag cached at import time.
Highlighting follows the recording exactly rather than interpolating within a
clip, so it cannot drift. Sections the publisher left unnarrated are skipped.
Alignment stays out of scope: a bare MP3 carries no timings and generating them
would mean shipping a speech-recognition model. docs/read-along-narration.md
points at Storyteller for turning an ebook plus its audiobook into a Media
Overlays EPUB, and is honest about the evidence on reading-while-listening: the
comprehension benefit is trivial overall (g=0.18) and only appears when reading
is externally paced, which is why this is a preference and not a prescription.
Two supporting changes:
- `TimelineSentence.duration` carries the exact clip length and outranks the
measured/estimated tiers in SectionTimeline, so a narrated chapter's scrubber
reports the recording's real duration. Deliberately not routed through the
text-keyed cache in ttsDuration.ts, where two identical sentences collide.
- ensureTimeline/supportsPlaybackInfo/getPlaybackInfo now gate on
`TTSCapabilities.mediaClock` instead of comparing against the Edge client.
Verified end to end in a browser against the W3C Moby-Dick MO sample and a
330 MB Storyteller-generated novel: narration selected automatically, unnarrated
front matter skipped, real audio decoded and played at the user's rate with pitch
preserved, boundaries firing per par across block boundaries, the narrated
sentence visibly highlighted, and the scrubber showing the recording's exact
elapsed/remaining time. That pass found four defects no jsdom test could reach:
element-anchored ranges producing a degenerate CFI so the highlight never
painted, typeless container blobs failing to decode, five concurrent loads of the
same audio file revoking each other's URLs, and a WrongDocumentError that killed
the session whenever the first sections were unnarrated. All four are fixed and
covered by regression tests.
It also surfaced a pre-existing hang: WebSpeechClient.init() waited forever for a
'voiceschanged' event on a platform reporting zero speech voices, wedging
TTSController.init() and so blocking every engine, including narration, which
needs no system voice. It now gives up after a timeout.
* fix(tts): let recorded narration play on instead of re-seeking each paragraph
Media Overlay clips are contiguous and in document order, so sequential
narration needs no seeking at all: the element can simply keep rolling while
boundaries are reported as the clock passes each clip.
It was instead seeking to clipBegin at the start of every block, because the
controller drives one speak() per paragraph. Detecting a clip's end by polling
the media clock always lands a few milliseconds PAST clipEnd, so those
milliseconds of the next clip had already been heard; seeking back replayed
them, audible as a stutter on the paragraph's first word ("Me? ... Me?").
Now the playhead only moves for a genuine discontinuity (session start, a
sentence skip, a scrub, a new audio file), decided from the element's own
position rather than from bookkeeping. Measured over a minute of The Player of
Games: one seek, at startup, and none across four paragraph boundaries.
Also stop padding paragraph transitions for a continuous timeline. The new
TTSCapabilities.continuousTimeline says consecutive blocks are one recording,
so the controller's inter-paragraph delay would add silence the narrator never
left and push the highlight behind the voice.
* fix(tts): stop putting a gap between paragraphs of recorded narration
Every paragraph boundary was audible as a hiccup, most obviously on the short
"Me?" that opens a paragraph early in The Player of Games. The recording was
being silenced and restarted at each boundary: the client paused at its block's
last clip, and the controller's pre-speak stop() paused again, ~50ms before the
next block called play(). On Android that also costs a buffer flush.
Silencing the engine between utterances is right for synthesis, where each
utterance is separately rendered audio, and wrong for one continuous recording,
where the next utterance is the same audio playing on. So stop() now takes a
`handover` flag for the stop the controller performs between two utterances of
the same session: a continuous-timeline engine stays rolling through it, and
engines that synthesize per utterance ignore it and stop as before.
The narration client therefore leaves the element playing when a block ends and
lets the next block join it in progress. A watchdog covers the case where no
next block comes (a one-off selection read, or a session torn down without
stopping), so narration can never be left running unattended.
Measured over 80s of The Player of Games, sixteen sentences across five
paragraph boundaries: no seeks, no pauses, and no stall in the media clock.
* fix(tts): read a selection aloud from the recording when a book is narrated
Selecting text and pressing Read Aloud played for about a second and then
stopped the whole session. The selection path builds SSML from the raw selected
text, which is right for a synthesizer but meaningless to the narration client:
its marks are SMIL par ordinals, so raw text matched no clip, the utterance
ended immediately, and the one-shot callback stopped the session.
A recording has no audio for arbitrary text, only the clips the publisher timed,
so reading a selection from one means starting the narration where that passage
is narrated, via the same tts.from(range) used for any other jump. It is an
ordinary session from that point, not a one-shot utterance, so the one-time
callback no longer applies.
* docs(tts): update the narration notes for the playback fixes
The playback fixes changed how the client drives the media element, so the
"how it works" notes described behaviour that no longer exists: it no longer
seeks at the start of every block, and the capability object it reports gained
continuousTimeline. Record both, plus the handover seam on stop(), the two
defects that surfaced only by listening, and the selection-read fix.
* docs(tts): trim the narration notes to what the code needs
Drop two sections that had grown past the point of earning their place in a
feature doc. The reading-while-listening literature review was an argument about
whether the feature is worth having rather than documentation of how it works,
and the defect postmortem duplicated detail the commit messages already carry.
Keeps the paragraph describing the Media Overlays format itself, which is
reference material the rest of the document depends on.
* fix(tts): follow the reading position across a page break inside a sentence
A sentence laid out across a page break left the reader behind: its mark fires
once, on the page it starts on, and a phrase-timed recording reports no words in
between, so the view stayed put while the voice read the tail rendered on the
next page. Measured at 6.5 seconds on one sentence of The Player of Games.
Synthesized engines hide this by following each word.
What a recording does give is how far through the current phrase its audio is,
now exposed as TTSClient.getChunkProgress(). Where the page stops showing the
sentence cannot be assumed — the same sentence breaks at a different word on
another screen, at a larger font size, or in a narrower column — so it is
measured from the live layout: pageBreakFraction bisects the sentence, probing
characters through getTextSubRange, and returns the break as a fraction of the
sentence's text, which is the unit that tracks how long the narrator spends on
it. Bisection is not tidiness — every probe forces a reflow.
The page turns once audio progress passes that fraction, and the fraction is
re-measured after each turn, so a sentence spanning three pages advances one page
at a time. No word position is invented, so the highlight still follows the
recording exactly. Engines without a chunk clock report no progress and keep
their existing behaviour.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(tts): keep the back-to-position prompt down when the view follows the voice
Following the voice onto the next page moves the view past the *start* of the
sentence being read, and that start is what ttsLocation records. Judged on it
alone the reader looks like they navigated away, so the prompt appeared on every
page turn — while they were in fact looking at the words being spoken. Engines
that report words dodge this because their highlight cfi moves with the voice; a
phrase-timed recording has no such cfi.
So ask the layout instead: isSoundingSentenceOnScreen() reports whether any part
of the sentence now sounding is still on the visible page, and the prompt stays
down while it is. Paging away from the sentence entirely still raises it.
Also rename the prompt from "Back to TTS Location" to "Back to Read Aloud",
after the name the feature actually carries in the UI, and drop the "TTS" jargon
from all 33 locales — several of which had been carrying the acronym untranslated.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Sacha Lastow <sacha.lastow@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(search): add progressive library search engine
* feat(library): add tag and subject shelves
* feat(library): add full-text search interface
* chore(search): add library scan benchmark
* fix(library): restore integrated search icon
* fix(search): scan loadable library books
* fix(search): keep nearby settings open
* fix(search): hide completed scan progress
* feat(search): add grouped result navigator
* feat(search): highlight clicked reader sentence
* perf(search): speed up library content scans
* fix(library): normalize tag shelf links
* fix(library): reflect url shelf grouping
* fix(search): scope fuzzy mode to library
* fix(search): preserve decomposed diacritic ranges
* test(search): consolidate core coverage
* fix(library): stabilize search input flow
* fix(search): improve result row spacing
* fix(search): smooth reader result highlight
* fix(library): prioritize search menu dismissal
* fix(library): stabilize result navigation dots
* perf(library): optimize full-text search
* test(library): align open book router mock
* refactor(search): rebuild library search on a per-book search.db index
Replace the in-memory scan pipeline with a persistent per-book Turso
index (search.db beside cover.png): search_meta/search_sections store
extracted, folded section text, search_nodes stores the toc tree for
future retrieval features. First scan populates the index; repeat
searches match cached text via a folded LIKE prefilter plus exact JS
matchers and never reopen book files. Results carry text-offset locators
and CFIs resolve lazily on click. Freshness follows book.updatedAt plus
a nav hash so manual toc edits invalidate. Turso is WAL-only with no
auto-checkpoint, so index writes checkpoint explicitly and all database
close paths checkpoint before closing. Unavailable books skip in
milliseconds via an IDBKeyRange readDir fix and databaseExists probes,
and stale index artifacts self-delete. Per-book results cap at 500 while
the scan continues across books. CJK nearby search falls back to
substring word mapping and counts distances in grapheme clusters.
foliate's text-walker loads lazily so the SSR module graph never touches
NodeFilter. Benchmarks cover real en/zh prose at 10/100/1000-book scale.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(library): redesign the full-text search UI
Results render as cover-thumb cards with sticky book headers replacing
the dot navigator, folded by default with per-book match counts (500+
when capped) and a live unavailable-books footer. Search options move
into a reader-style dropdown attached to the input; the import and
select controls hide in text mode and the mode toggles via the search
icon. The query input debounces 500ms, search history pills show under
the header between the search bar and breadcrumbs, and a completed scan
snapshot restores results and expanded groups when returning from the
reader. Progress reuses the sync bar style; matches emphasize with the
shared search-term-highlight class; everything stays legible under
data-eink with responsive header-aligned padding. Book opening keeps
useAppRouter so route View Transitions (and their engine gating) apply
to search result deep links too.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(reader): search through the shared book index and translate new strings
Reader search now queries the same per-book search.db: repeat searches
skip book parsing, chapter scope maps to a sectionIndex filter that
never restricts index population, and a batch resolver turns locators
into CFIs (per-word for nearby matches) that view.search replays purely
to paint highlights. The legacy per-query JSON cache under Cache/search
is removed and wiped once at startup. Excerpt rows clip their lead-in so
the emphasized match stays inside the three-line clamp, using the shared
search-term-highlight class. All new library search strings are
translated across the 32 locales.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* refactor(metadata): edit tags like other fields
Tags edit through the standard FormField as a comma-separated string,
exactly like Subjects: per-field lock, shared chrome, separator split in
the field pipeline. The custom chip editor with its own Add button and
key handling is removed; the read-only view keeps chips. Empty segments
survive while typing so a just-typed comma is not swallowed, and tags
dedupe on save.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Huang Xin <chrox.huang@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
The license, release, and last-commit badges all query GitHub's API
through shields.io's shared instance, which intermittently fails with
"Unable to select next GitHub token from pool" when shields.io's own
token pool is rate-limited. A README author can't supply a token to the
hosted badges.
- License is fixed at AGPL-3.0, so use a static badge that makes no
GitHub API call and can never hit the token-pool error.
- Switch the release badge from the deprecated `github/release`
endpoint (which 301-redirects) to `github/v/release`.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop the Sponsors subsection and its lone TestMu AI logo from the
Support section.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
donate.readest.com now lists every donation method, so the Support
section links there instead of enumerating GitHub Sponsors, Stripe,
and crypto separately.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a Documentation section to the README pointing to the official docs at https://readest.com/docs, with a matching entry in the top navigation and a reference-style link.
Also bundle accumulated agent memory updates under apps/readest-app/.claude/memory/.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: bump nodejs version to 24
* fix(sidebar): use position fixed and transform for mobile sidebar
Use position: fixed to prevent horizontal scrolling on the mobile
bottom sheet, and replace style.top with transform: translateY() for
smooth drag performance. Cache element refs to avoid
document.querySelector on every drag frame. Apply the same position:
fixed fix to the notebook panel. Closes#3492
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>