* fix(build): make pnpm preview serve pages and rewrites again
Two bugs took down the OpenNext/wrangler preview with Next 16.4:
- Every page returned 500 with "Unexpected loadManifest(/.next/server/preview-props.json) call!".
Next 16.4 reads a new server/preview-props.json, and @opennextjs/cloudflare 1.20.11
only copies `*-manifest.json` files into the worker. 1.20.13 copies this file too.
- Rewritten URLs such as /reader/<id> returned 500 with "Error in routingHandler
TypeError: (0 , import_path_to_regexp.parse) is not a function or its return value
is not iterable". The workspace override forced every path-to-regexp to >=8.4.0,
but @opennextjs/aws and wrangler are written for ^6.3.0, and v8's parse()
returns an object instead of a token list. The override is now split by major
version: v6 stays >=6.3.0 (no open advisories) and v8 stays >=8.4.0 (patched
for GHSA-27v5-c462-wpq7 and GHSA-j3q9-mxjg-w52f).
Verified: before the change, `pnpm preview` returned 500 on / and on
/reader/<id>, with the errors above in the wrangler log. After the change,
/, /library, /reader?ids=<id> and /reader/<id> all return 200, the reader
page loads its chunk, and the log has neither error. pnpm test (1198 files,
14239 tests), pnpm lint and pnpm build-web pass. This is a dependency change,
so it has no unit test. The Nix pnpmDeps.hash comes from the PR's fod-hashes
check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(nix): refresh pnpmDeps.hash for the OpenNext and path-to-regexp lockfile change
The value is the got: line from the PR's fod-hashes check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(deps): bump next to 16.4.3 for the open Dependabot alerts
next 16.0.0 through 16.4.0 have two unauthenticated remote code
execution advisories (`use cache` functions returning typed arrays, and
the Image Optimization API with SVG files) and a Server Actions denial
of service. All three are patched in 16.4.1; this takes the latest
16.4 patch, 16.4.3. The lockfile change is next and its @next/env and
@next/swc-* packages only.
Verified: pnpm lint, pnpm build-web and pnpm build (both report
Next.js 16.4.3), and the Cloudflare build (opennextjs-cloudflare build,
webpack). pnpm test: 1185 files passed, 4 skipped, 1 failed with a 5s
timeout in ControlPanelUpdateReset.test.tsx while two Next builds ran
alongside it; it passes alone, and its first test takes ~1.7s alone on
main with next 16.3.8 too. The first Cloudflare build run died with a
JavaScript heap OOM at the default ~4 GB heap; the rerun passed (peak
RSS 7.4 GB), as #7007 saw on 16.3.8. No behavior change, so no new
test. Nix pnpmDeps.hash not updated here: nix is unavailable locally,
the nix-deps-check job prints the new hash.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(deps): pin next to 16.4.2, clear of the release-age cutoff
The Nix fod-hashes job rejected 16.4.3 with
ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION: it was published on
2026-10-23, inside pnpm's one-day minimumReleaseAge, which the Nix
fetcher enforces and local installs don't. 16.4.2 (2026-10-15)
carries the 16.4.1 fixes for all three advisories.
Verified on 16.4.2: pnpm lint, pnpm build-web and pnpm build (report
Next.js 16.4.2) passed. The Cloudflare build (opennextjs-cloudflare
build, webpack) hit the JavaScript heap OOM at the default ~4 GB heap
on its first run (#7034); a rerun was stopped when the machine ran
low on memory, so it has not passed on 16.4.2 here.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(nix): refresh pnpmDeps hash for the next 16.4.2 bump
Taken from the fod-hashes job on the previous head (specified
sha256-tYEHs..., got sha256-4F16c...).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(deps): resolve open Dependabot alerts
Bump vitest, @vitest/browser-playwright and @vitest/coverage-v8 to
4.1.12 and override @vitest/browser and @vitest/mocker 4.x to 4.1.12.
@vitest/browser-webdriverio has no 4.1.12 release, so it stays at
4.1.11 and pulls the patched @vitest/browser through the override; it
reports an unmet vitest 4.1.11 peer.
Raise the vite override and spec to 7.3.7.
Bump @opennextjs/cloudflare to 1.20.11. It is the newest release whose
next peer range (>=16.3.8) still accepts the pinned next 16.3.8;
1.20.12 and later want next >=16.4.1. The fixed advisory only affects
apps with enableCacheInterception, which open-next.config.ts doesn't set.
braces and sprintf-js have no patched release (the sprintf-js advisory
is withdrawn) and are left as they were.
Verified: pnpm test (1175 files passed, 4 skipped), pnpm lint,
pnpm build-web, and the Cloudflare build (opennextjs-cloudflare build,
webpack). The first Cloudflare build run aborted with status 134 while
the machine was under load; the rerun completed. No behavior change, so
no new test. Nix pnpmDeps.hash not updated here: nix is unavailable
locally, the nix-deps-check job prints the new hash.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(nix): refresh pnpmDeps hash for the Dependabot bumps
Taken from the fod-hashes job on the previous head (specified
sha256-eOWra..., got sha256-Fct7A...).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(deps): resolve open Dependabot alerts
Raise the workspace overrides for shell-quote, proxy-addr and
source-map-js to their patched releases, and pull postcss-selector-parser
6.x (pinned by @tailwindcss/typography) up to 7.1.6. The compiled prose
styles are unchanged.
Move katex to 0.18 (with marked-katex-extension 5.1.13 and an override for
the packages still asking for 0.16) and i18next-http-backend to 4.0.2.
v4 only drops the cross-fetch fallback; the backend loads in the browser,
which has fetch.
Update rustls to 0.23.46 in Cargo.lock, Cargo.cef.lock and the koplugin
LocalSend helper.
Blank the Nix pnpmDeps and cargo hashes so the fod-hashes check prints
the new values.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(nix): refresh pnpm and cargo dependency hashes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* chore(agent): remove a merged PR's worktree in the triage loop
Worktrees for the loop's PRs stayed on disk after merge. When a followed
PR is merged, the loop now removes its worktree with `pnpm worktree:rm` and
deletes the local branch, but only for a worktree it made, with no local
changes and HEAD at the merged head; anything else is kept and reported.
Verified: the same checks and removal ran by hand on today's nine merged
worktrees (all clean, all at their merged heads); the main checkout's
shared target/ was untouched.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore(agent): keep the commit-author check under open PRs
The worktree-cleanup sentences made "Then check every commit's author"
read as part of the merged case; it applies to PRs that are still open.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(scripts): declare tsx so worktree:new and worktree:rm run
`worktree:new`, `worktree:rm` and `dictionary:yomitan:convert` run their
TypeScript with tsx, but tsx was never a dependency: it was only in the
lockfile as an optional Vite peer, so `pnpm exec tsx` failed with
"Command tsx not found". Declare it at the version already locked
(4.21.0), so no new package is fetched.
Verified: before, `pnpm worktree:new` failed at once with "Command tsx not
found"; after, it created a worktree end to end (submodules, install,
Android gen, vendor and simplecc copies, clean git status), and
`pnpm worktree:rm` removed it.
Not run: the Nix build locally (no nix here); nix_flake_check in CI checks
the pnpmDeps hash, which shouldn't move since no new package is fetched.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore(agent): keep a merged worktree whose submodules hold local work
The cleanup checked the superproject only (--ignore-submodules=all), so a
submodule commit or edit, such as a foliate-js fix, could be removed with
the worktree. It now also requires no submodule at a different commit
(no '+' in git submodule status) and no submodule changes. Ignored files
are expected and still don't block removal.
Verified: both checks print nothing on two real worktrees, so a clean
worktree is still removed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore(agent): check worktree cleanup with plain git status
--ignore-submodules=all hid a staged submodule pointer, and the extra
submodule status check missed it too. Plain git status --porcelain reports
a submodule at another commit, a staged pointer and edits inside a
submodule, so it replaces the three checks.
Verified on the foliate-js submodule: moved to another commit, plain
status prints ' M packages/foliate-js' while --ignore-submodules=all prints
nothing; staged, plain status prints 'M packages/foliate-js' while both
older checks print nothing. Plain status prints nothing on three clean
worktrees.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore(agent): require the branch itself at the merged head before cleanup
A worktree detached at the merged head could pass the HEAD check while its
branch held later local commits, and git branch -D would drop them. Both
HEAD and the branch ref must be the merged PR's head sha.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Replace the custom MP4 chapter reader introduced in #6327 with chapter data from music-metadata 12.1.0. Preserve chapter normalization, duration clamping, labels, and the single-chapter fallback.
Fixes#6262.
Co-authored-by: Borewit <borewit@users.noreply.github.com>
* feat(hardcover): sign in with OAuth using the device authorization flow
Connect now opens a /hardcover/connect screen with a QR code and code to
approve on Hardcover, replacing the pasted API token field. Existing
pasted tokens keep working. Tokens refresh automatically, are device-local,
and are revoked on disconnect.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* feat(hardcover): add translations for the OAuth connect screen
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* fix(hardcover): reject backslash redirects on the connect screen
Browsers read a backslash as '/', so a redirect like '/\host' would leave
the app. Matches the check navigateBackFromProfile already does.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* fix(nix): update the pnpm dependency hash for the new uqr dependency
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* fix(hardcover): reject control characters in the connect screen redirect
Browsers drop tabs and newlines when parsing a URL, so '/<TAB>/host' is read
as '//host'. Rejects any Unicode control character, and the tests now check
that rejected redirects fall back to the library.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* fix(hardcover): save the connection before publishing it in memory
A failed save no longer leaves unsaved OAuth credentials live in the settings
store, where later syncs in the same session would use them.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* fix(hardcover): treat a session with no refresh token as a dead login
A session that has no refresh token cannot be renewed once its access token
expires, so reconnecting is the only fix. It now raises the same auth error as
a refused refresh instead of surfacing the raw 'no_refresh_token' error.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* fix(hardcover): don't let a stale refresh overwrite a newer login
The token store now receives the tokens a refresh started from and skips the
save if the stored tokens differ. A refresh still in flight when the user
disconnects and reconnects no longer replaces the new session.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* fix(hardcover): retry a failed token save on the next request
The client keeps the tokens it last knew were stored and compares against those
when saving, so a failed save no longer makes every later save look stale. A
failed save is retried on the next request instead of waiting for the next
refresh.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* fix(hardcover): treat a refused refresh grant as a dead login
Hardcover's token endpoint answers an unknown or revoked refresh token with
HTTP 400 `invalid_grant`, so a dead login surfaced the raw "OAuth token refresh
failed with HTTP 400: invalid_grant" error on every sync instead of the
"Reconnect in Settings" message. Map 400 `invalid_grant` to HardcoverAuthError.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Huang Xin <chrox.huang@gmail.com>
* fix(deps): resolve open Dependabot alerts
Bump next to 16.3.8 (next/og ImageResponse RCE, plus the image
optimizer SSRF and cache-poisoning fixes shipped in the same release),
dompurify to 3.4.16, and vitest to 4.1.11.
Move ai, @ai-sdk/react and @ai-sdk/openai-compatible to releases that
share @ai-sdk/provider-utils 4.0.57, and carry the iOS Safari
lookbehind patch over to that version.
Raise the workspace overrides for undici, brace-expansion, sharp,
js-yaml, fast-uri and baseline-browser-mapping to their patched
releases.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(nix): blank pnpmDeps hash to recompute it in CI
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(nix): refresh pnpm dependency hash
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(build): repair the Docker and Nix builds after #6368
Two main-branch builds broke on 8750c310 and both are fallout from that PR.
**Docker** (`pnpm build-web`: "Can't resolve '@pdfjs/pdf.min.mjs'",
"Can't resolve '@simplecc/simplecc_wasm'"). `setup-vendors` runs in the
`dependencies` stage and its output is not in the build context, so every
directory it creates needs an explicit `COPY --from=dependencies`. Splitting
the bundler-imported modules out of `public/vendor` into `vendor/` left the
new directory with no COPY line. The test derives the expected roots from the
`prepare-vendor` script, so adding another one fails until the Dockerfile
copies it.
**Nix** ("no matching package named `sentry-debug-images` found"). The Linux
CEF build vendors from `Cargo.cef.lock`, which `nix/package.nix` copies over
`Cargo.lock`, and that second lock never learned about the two crates the
sentry `debug-images` feature pulls in. Added `findshlibs` and
`sentry-debug-images` there, plus the dependency entry on `sentry`; both need
only packages the lock already had.
This is also why `nix-deps-check` stayed green on #6368: it hashes
`Cargo.cef.lock`, which that PR did not touch, so the stale vendor set only
surfaced when the full Nix build ran on main.
`cargoHash` is updated in a follow-up commit from the hash the deps-check
prints, since the vendor contents change.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* style: format the vendor-root docker test
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(nix): update cargoHash for the new sentry debug-images crates
The vendor set gained findshlibs and sentry-debug-images, so the pinned
hash moved. Value taken from the nix-deps-check run on this PR:
specified: sha256-EPNbiv0YJ79rqBHFCO5gjQwt9Vn1v9HV0ZfH7f2Eo/E=
got: sha256-8MIkn2N65P87tG0RncOQtH01SYfRUM4qB6rOzd+fwwQ=
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* refactor: one vendor dir, with the bundler importing from packages
#6368 split the vendored modules into a second `vendor/` directory to stop
them shipping twice (Tauri embeds every published file, and `public/` is
published whole). Two vendor directories is the wrong shape, and the copies
were never needed: the aliases can resolve straight at the sources, which is
how `jieba-wasm` has always been imported.
@pdfjs/* -> packages/foliate-js/node_modules/pdfjs-dist/legacy/build/*
@simplecc/* -> packages/simplecc-wasm/dist/web/*
`public/vendor/pdfjs` now holds only what the reader fetches by URL at
runtime — the worker, the WASM decoders, cmaps, standard fonts and the layer
CSS — and `vendor/` is gone, along with `copy-pdfjs-lib`, `copy-simplecc`,
`setup-simplecc`, its Dockerfile COPY and its worktree copy.
Two details this turned up:
- The @pdfjs alias needs an explicit `declare module`. TypeScript inferred
types for the minified JS while it sat inside the app, but skips JavaScript
under node_modules, and pdfjs-dist ships `pdf.d.mts`, not the
`pdf.min.d.mts` that would sit beside the minified build. Only the import's
side effect is used, so the declaration is bare.
- `packages/simplecc-wasm` is a submodule the worktree script skips, so the
script now copies its committed `dist/web` into a new worktree instead of a
vendor directory.
A true `import ... from 'simplecc-wasm'`, matching jieba exactly, would need a
change in that submodule: its `exports` map points at `pkg/`, which is build
output and not committed (only `dist/web` is), and the map forbids other
subpaths.
Verified with a real build: modules resolve with no `vendor/` present,
`out/vendor` holds only pdfjs, `pdf.min.mjs` is bundled into a chunk and not
published, and both jieba and simplecc WASM are emitted once each.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* docs: say why the @pdfjs alias points at the package, not public/
The comments still described a vendored copy. Record the constraint
instead: a module the bundler imports must not also be published, or
Tauri embeds it twice.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* test: drop the vendor/docker config assertions
These assert on config files rather than behaviour: the alias-target test,
the Dockerfile vendor-COPY test, and the pdfjs wasm copy-script test.
The SELF_HOSTED default check in docker-image-defaults.test.ts stays; it
predates this work (#6100) and guards runtime behaviour of the published
image rather than a config shape.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* perf(android): cut the arm64 apk from 90MB to 57MB
The Rust library is 95% of the APK, and most of what it carried was not
code. Measured on an aarch64 release build: 89.7MB -> 57.5MB.
- Build `release` with fat LTO and one codegen unit. Cross-crate inlining
cuts .text by 5.2MB and the unwind/exception tables by 2.1MB, at the
cost of a longer final link.
- Strip the packaged library. AGP's own strip step only drops the
.debug_* sections, so 22MB of symbol tables (10MB after LTO) reached
every download. The strip runs on AGP's output, so `target/` keeps the
unstripped copy, which the release and nightly workflows now upload to
Sentry as debug files; Rust frames stay symbolicated. Android builds
also link with a build id, which is how Sentry matches them, and the
`debug-images` feature attaches the loaded modules to each event.
- Stop shipping jieba's WASM twice (2.7MB). The wasm-bindgen glue
defaults to the file the bundler already emits; pointing `init()` at a
public/vendor copy embedded both.
- Keep the browser-only turso WASM out of native builds (3.3MB). The
alias that excluded it still named `@tursodatabase/database-wasm`,
which the web database service stopped importing in #4086.
simplecc is still embedded twice (0.4MB): its glue is imported through
the `@simplecc/*` path alias out of public/vendor, so deduping it means
moving that directory.
Verified: the built APK's library carries no symbol tables and a build
id; `target/` keeps its; the bundle requests exactly the one embedded
jieba asset key and no /vendor/jieba path; the turso WASM is absent from
`out/`. The APK installs and runs on a Xiaomi 2211133C, library and a
Chinese book render, and RSVP runs on it. Whether jieba's WASM is
actually fetched at runtime is NOT verified: release webviews are not
inspectable and the fallback to Intl.Segmenter is silent.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* perf(android): drop fat LTO, codegen-units=1 is the whole win
The previous commit credited the code-size saving to fat LTO. That was
wrong. Measured on aarch64-linux-android with the flags rustc actually
received (`cargo build -v`):
codegen-units=16, lto=false .text 29.66MB .eh_frame 3.69 .except 2.51
codegen-units=1, lto=off .text 24.43MB .eh_frame 2.28 .except 1.84
codegen-units=1, lto=thin .text 24.43MB .eh_frame 2.28 .except 1.84
codegen-units=1, lto=fat .text 24.44MB .eh_frame 2.28 .except 1.84
One codegen unit accounts for all of it; LTO changes nothing once it is
set, so fat LTO was buying only link time and peak memory on every
release target. The rebuilt APK confirms it: 57.49MB without LTO against
57.50MB with it.
What `codegen-units = 1` costs, from a clean aarch64 build on an
M-series: 5m54s against 4m15s, and 3.3GB peak RSS against 2.9GB. That
answers the review's question about the 75-minute Android and 45-minute
desktop step limits in nightly.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* perf: stop shipping vendored modules the bundler already embeds
Tauri embeds every file under `out/`, and `public/` is copied there whole. So
a module imported through a path alias that points into `public/` ships twice:
once bundled into a chunk, once as a published file nobody fetches. jieba cost
2.7MB that way; `@pdfjs/*` and `@simplecc/*` had the same shape.
Split the vendored assets by how they are loaded. What the reader fetches by
URL at runtime stays in `public/vendor/pdfjs` — the worker, the WASM decoders,
cmaps, standard fonts, the layer CSS, all built as runtime URLs in
foliate-js/pdf.js, which is why the bundler never emitted copies of them.
What the bundler imports moves to `vendor/` (outside `public/`):
`pdf.min.mjs` + its types, and the simplecc glue and WASM.
Measured on the embedded frontend, brotli as tauri compresses it: 23.7MB ->
16.96MB across this and the earlier jieba/turso fixes. That comes out of every
Tauri target, not just the APK.
The new test states the invariant that was broken rather than the three
symptoms: no tsconfig path alias may resolve into `public/`. It failed on
`@pdfjs/*` and `@simplecc/*` before this change.
Desktop stripping was measured and deliberately NOT done. On macOS it saves
4.76MB in the binary but only 1.44MB of DMG (36.59 -> 35.15MB), because a DMG
compresses symbol strings while an APK stores the .so uncompressed (verified:
`Stored`, 0%) — which is why Android got the full 22MB. Buying 1.4MB would
mean either a profile-level `strip`, which deletes the unstripped artifact
Sentry symbolicates Rust panics from, or pulling the release job apart from
tauri-action, which builds, bundles, signs and notarizes in one step. deb, rpm
and AppImage are compressed too, and MSVC keeps symbols in the PDB.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix: init simplecc from the emitted WASM, not a URL that no longer exists
Moving the simplecc glue out of `public/` left `initSimpleCC` still asking for
`/vendor/simplecc/simplecc_wasm_bg.wasm`, a URL nothing publishes any more, so
Chinese variant conversion would fail to initialize at runtime. Caught in
review of #6368.
`init()` with no path uses the glue's default
`new URL('simplecc_wasm_bg.wasm', import.meta.url)` — the copy the bundler
emits and Tauri embeds — the same shape as the jieba fix.
The existing WASM-init test covered jieba only, which is why this slipped
through; it now covers both. Verified against a fresh build: the chunk
references `static/media/simplecc_wasm_bg.<hash>.wasm` and no runtime
`/vendor/simplecc` reference remains (the two textual hits left are the
bundled package.json script strings and a source-map path, and maps are
stripped before packaging).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(linux): debug the CEF build over the DevTools protocol
The Linux CEF runtime is Chromium, so the app window is a normal CDP
target — the only way to inspect the running desktop app on Linux, since
WebKitWebDriver (pnpm tauri:dev:test) drives the wry runtime instead.
`READEST_CDP_PORT=9222` passes the port to CEF as `--remote-debugging-port`
through the runtime's command-line args. CEF honours that switch straight
off argv too, but tauri-plugin-cli parses the same argv for open-with paths
and warns about the unknown argument on every launch, so the env var is the
supported way in. It works on any CEF build — a packaged .deb or the
Flatpak, not just `pnpm tauri:dev:cdp`.
scripts/cdp.mjs is the client, dependency-free (node's global fetch and
WebSocket): `pnpm cdp <targets|eval|click|screenshot|logs>`. The endpoint
listens on loopback only.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(desktop): open the first window at 1280x800
macOS has always opened at 1280x800; Windows and Linux opened at 800x600,
which is cramped for the library grid and a two-page spread. Give every
desktop platform the same default, and clamp it to 90% of the monitor's
work area so it cannot open partly off-screen on a 1366x768 laptop — a
window whose title bar lands past the bottom edge can be impossible to
resize back. An unreported or empty work area keeps the default: a window
that is too large stays reachable, one sized from a bogus zero-height
screen does not.
Only the first launch is affected; later ones restore the saved geometry
through tauri_plugin_window_state.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(opds): size the add catalog dialog like the catalog manager
The Add/Edit Catalog form took daisyUI's bare `modal-box` default: 512x889
against the 640x756 manager it opens on top of, so it sat narrower than the
window behind it and ran 89px off the bottom of a 1280x800 window, putting
its Cancel / Add Catalog row out of reach.
Both now size from one exported class string, so they cannot drift apart
again. `sm:max-h-full sm:max-w-full` is what defeats daisyUI's own max-w-lg
and max-height caps; everything is sm:-prefixed, leaving each dialog's
mobile treatment alone.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(library): stop the native scrollbar flashing before OverlayScrollbars
Reloading the library showed the platform scrollbar for ~1.8s and then lost
it, shifting the grid 15px sideways as it went.
Virtuoso owns the scroller inside the OverlayScrollbars root and gives it
`overflow-y: auto` inline, so the native scrollbar paints for as long as
OverlayScrollbars' deferred init takes, then vanishes when OS marks that
same element `data-overlayscrollbars-viewport="scrollbarHidden ..."`.
OverlayScrollbars ships hiding rules for `[data-overlayscrollbars-initialize]`,
but that attribute sits on the root we hand it, never on the child that
actually scrolls.
Extend the same pre-init convention to the scroller child. Keyed on
attributes Virtuoso and OS already set, so it also covers the reader
sidebar's TOC and book-note lists, and `:not([data-overlayscrollbars])`
scopes it to the pre-init window — once OS owns the root, its own viewport
styling takes over. It lives in globals.css so it is there at first paint,
unlike the overlayscrollbars.css import inside the component chunk.
Measured on reload: scroller gutter went 0 -> 15 -> 0 before, and stays 0
throughout after.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(cdp): clear the request timeout so the client exits when it is done
Every send() armed a 30s timer and nothing cleared it when the reply
arrived. A pending timer keeps node's event loop alive, so `pnpm cdp eval`
printed its answer and then sat there until the timer fired — 30.1s for a
command whose work took 0.1s. Clear it on reply, and drop the pending entry
when it does fire.
Measured against a stub CDP endpoint: `eval` went from 30.143s to 0.124s,
and a server that never answers still rejects with "timed out" at 30.1s.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore: bump tauri to version 2.11.5
* chore: update agent memories
* chore(nix): bump cargoHash for the tauri 2.11.5 lockfile
The fod-hashes check failed on the stale cargo vendor hash after
Cargo.lock was regenerated for the tauri fork bump. Take the hash from
the check's `got:` line. Also pass `--keep-going` to that nix build so a
single run reports every stale fixed-output hash instead of stopping at
the first one.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* fix(epub): decode UTF-16 BOM bodies with as_chunks
CI's stable clippy rejects `chunks_exact(2)` with a constant chunk size
(`clippy::chunks_exact_to_as_chunks`) now that the crate's MSRV is 1.90
and `slice::as_chunks` is available. Same behaviour: the trailing odd
byte of a malformed UTF-16 stream lands in the ignored remainder, which
the new test pins down.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* chore(nix): bump pnpmDeps hash for the tauri plugin package bumps
pnpm-lock.yaml changed with the @tauri-apps/plugin-* JS package bumps,
so the pnpm dependency fixed-output hash went stale. Value taken from
the fod-hashes check's `got:` line.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
* feat(linux): build and ship Readest on the tauri CEF runtime
Linux now builds against upstream tauri `feat/cef` (git) and the plugins on
plugins-workspace `feat/cef`, while macOS/Windows/mobile keep the readest
fork untouched:
- `pnpm tauri:cef dev|build` (scripts/tauri-cef.mjs) runs @tauri-apps/cli-cef
with `--features cef`, cargo `--no-default-features` and the Linux-only
`[patch.crates-io]` in src-tauri/.cargo/cef.toml, swapping the committed
Cargo.cef.lock in for the run so Cargo.lock stays in the fork state.
- The fork crates are no longer workspace members (a member clashes on
`links` with the git copy); the tauri-plugins fork carried no changes and
is removed, tauri-plugin-fs comes from crates.io at 2.5.1.
- App: `cef = ["tauri/cef"]` (the fork gets a no-op stub), explicit runtime
type, `cef_entry_point`, `--no-first-run` for CEF, commands generic over
the runtime, xdg-portal dialogs on Linux (rfd's GTK thread crashes CEF),
rangefile reads and pointer-driven move/resize on the Linux CEF runtime,
Chromium reported in the About dialog, deb/rpm depend on libwebkit2gtk
while plugins still pull the wry runtime.
- Build-generated permission files are untracked; turso registers `batch`.
- CI Linux legs use `pnpm tauri:cef`.
Submodules: packages/tauri -> feat/cef-feature-stub, tauri-plugin-turso ->
fix/register-batch-command (both need pushing).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* feat(linux): let the CEF wrapper run an unpacked tauri CLI for offline builds
Flatpak builds have no network, so `TAURI_CEF_CLI` points scripts/tauri-cef.mjs
at an unpacked copy of @tauri-apps/cli-cef instead of `pnpm dlx`.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* chore(linux): take the CEF stack from the readest forks
- src-tauri/.cargo/cef.toml: tauri and the plugins now come from the readest
forks' feat/cef branches (upstream feat/cef plus the DevTools-close fix in
tauri-runtime-cef); Cargo.cef.lock re-resolved against them.
- tauri-plugin-turso: point at main, which merged the batch command fix.
- CI: STRACE_MODE=0 for the Linux legs so the CEF AppImage bundler
(quick-sharun) does not launch the app under Xvfb and hang (#4906).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* feat(linux): make the CEF runtime the default tauri build on Linux
`pnpm tauri` now goes through scripts/tauri.mjs (the former tauri-cef.mjs):
on Linux its dev, build and bundle commands run the feat/cef tauri CLI
with the CEF feature, cargo config and Cargo.cef.lock swap, and every
other platform or command passes straight through to @tauri-apps/cli.
The separate `tauri:cef` script goes away, so the release and nightly
workflows, the local Linux build script and the docs use plain
`pnpm tauri build` again.
The tauri webdriver harness (scripts/test-tauri.sh) still calls the
`tauri` binary directly and keeps the wry runtime on Linux, since
tauri-driver needs WebKitWebDriver.
Cargo.cef.lock picks up the quick-xml 0.41 bump from main.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* chore(nix): refresh cargoHash for the reshaped Cargo.lock
Dropping the packages/tauri-plugins submodule and the tauri-plugin-fs
path patch changed the vendored cargo dependency set, so the Nix
fixed-output hash moves to the value the nix-deps-check job reported.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* fix(linux): harden the CEF wrapper and pointer window drag
Review follow-ups on the CEF runtime work:
- scripts/tauri.mjs parks the wry Cargo.lock in Cargo.lock.wry, created
exclusively, so two CEF commands in one checkout cannot swap lockfiles
over each other, and a killed run leaves an obvious file to move back.
- The CEF runtime alias, entry point and runtime attributes are gated on
Linux as well as the `cef` feature; elsewhere the feature is a no-op.
- Pointer-driven window move/resize applies the last pointer delta when
the button is released before the pending animation frame, and does
not start tracking when the button was already released while the
window state was being read.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
* fix: prevent navigation and HTTP lifecycle rejections
Patch same-path history transitions and Tauri HTTP abort/body cleanup. Add regression tests for transition completion, native resource races, and stable Android updater failures.
* fix: own route transitions and scope Yandex cancellation
Replace the dependency patches with application-level fixes. Keep explicit route animations in a Readest provider and leave browser history native. Dispose Yandex deadlines and caller cancellation after response consumption, including error bodies.
* fix: refresh Nix pnpm dependency hash
* chore(deps): upgrade to TypeScript 7
TypeScript 7.0.2 is GA and @typescript/native-preview stopped publishing
after 7.0.0-dev.20260707.2, so the preview package is dropped and the real
typescript dependency carries the native compiler. "pnpm lint" now runs
"tsc --noEmit" because TypeScript 7 ships only a tsc bin, no tsgo.
Next.js 16.2 rejects TypeScript >= 7.0 outright, so next moves to 16.3.3,
which runs the project-local TypeScript CLI for build-time type checking
and tsconfig loading (experimental.useTypeScriptCli, on by default).
Two fallouts:
- TypeScript 7 enforces the inferred rootDir even under noEmit, so the
js-mdict sources mapped in from packages/ tripped TS6059. rootDir is
now set explicitly to the monorepo root.
- Next 16.3 added a required bfcacheId to AppRouterInstance, which the
nav test router mock was missing.
The browser extension stays on TypeScript 5 because ts-loader needs the
JS compiler API that TypeScript 7 removed.
Closes#5260
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(nix): refresh pnpmDeps hash for the TypeScript 7 lockfile
The TypeScript 7 and Next.js 16.3 upgrade changes pnpm-lock.yaml, so the
pinned fixed-output hash no longer matches. Value taken from the got: line
of the nix-deps-check run on this pull request.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(ui): migrate to daisyUI 5 and Tailwind CSS 4
daisyUI 5 requires Tailwind CSS 4, so the configuration moves into
globals.css: tailwind.config.ts is gone, and the built-in themes now
compile through a small plugin (src/styles/daisyui-themes.ts) that
shares one token emitter with the runtime custom theme injector.
Keep the rendering identical to daisyUI 4:
- themes.ts emits daisyUI 5 --color-* tokens, derives the *-content
colors with the v4 formula, and pins the v4 radii, border and depth.
- globals.css carries a compat block for the component defaults v5
changed: md field height, small size type, checkbox radius, menu
width and line height, disabled non-buttons, toggle width, and the
visibility of closed and nested dropdowns. Every rule has zero
specificity so utilities keep winning as they did on v3.
- Pin the Tailwind 3 color palette for the families the app uses;
Tailwind 4 ships oklch values that render noticeably more vivid.
- Restore the v3 preflight defaults the UI was tuned on (border and
placeholder colors, button cursor) and the v3 hover semantics.
Class names are migrated for both upgrades: the v3 renames (shadow,
rounded, blur, outline-none, flex-shrink, the important modifier, CSS
variables in arbitrary values) and the daisyUI removals
(input-bordered, form-control, label-text, tr.hover). Three call sites
relied on the old stylesheet order of conflicting utilities and now
say what they mean instead.
Fixes#5587: daisyUI 5 opts the select into appearance: base-select and
themes ::picker(select), so the option popup follows the app theme
instead of the operating system. The chromeless settings selects no
longer force appearance-none, which would cancel that.
The font dropdown's System Fonts sub-list now opens only when its row
is activated, and its bottom edge lines up with the parent menu.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(nix): refresh pnpmDeps hash for the daisyUI 5 lockfile
The daisyUI and Tailwind upgrade changes pnpm-lock.yaml, so the pinned
fixed-output hash no longer matches. Value taken from the got: line of
the nix-deps-check run on this pull request.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(ui): keep the daisyUI toggle size modifiers
The compat rule that restored the v4 track width applied to every
toggle, so toggle-sm and toggle-xs were stretched to the medium width:
the OPDS catalog manager's auto-download switches came out 48px wide on
a 20px track. daisyUI 4 sized each step separately and the steps do not
share one ratio, so pin all four.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(android): require WebView 111 and use btn-contrast for catalog save
Tailwind CSS 4 targets Chromium 111 and up, and the oklch fallback that
used to cover older WebViews is gone with the daisyUI 5 migration, so
raise the webview-upgrade plugin's minSupportedMajor from 92 to 111.
Below that the plugin now tells the user their WebView is too old
instead of letting the app render with broken colors.
Also switch the OPDS catalog dialog's submit button to btn-contrast,
which is the design system's primary action for dialogs.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(ios): require iOS 16.4
Tailwind CSS 4 targets Safari 16.4 and up. Below that, color-mix() and
@property are missing, so daisyUI's controls do not degrade gracefully:
input borders fall back to currentColor and the toggle geometry
collapses, as seen on an iOS 15.8 device. Raising the deployment target
keeps those devices on the last build that renders correctly instead of
shipping them a broken UI.
Covers the Tauri bundle config, the xcodegen project and every target in
the generated Xcode project.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore(deps): point the webview-upgrade plugin at the 111 default
Picks up readest/tauri-plugin-webview-upgrade#2, which raises the
plugin's own defaultMinSupportedMajor to match the minSupportedMajor
this app already sets in tauri.conf.json.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(layout): apply selected color to highlight options
* docs(agents): record the #5562 review and PR delivery learnings
Media Overlay iOS native playout: the review findings, the setting that a
hardcoded lock-screen title silently killed, and the fact that
NativeTTSPlugin.swift is compiled by no CI job.
PR delivery: offer the fast-forward before rewriting a contributor branch,
maintainerCanModify goes false on merge so a denied push may just mean the PR
already landed, and how to rebase past a squash-merged PR.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Notes in the annotation sidebar go through marked, so a reader taking notes on
a textbook could write markdown but not the formula the paragraph was about.
marked-katex-extension renders $...$ and $$...$$ through KaTeX.
The parser is a scoped Marked instance rather than the shared marked singleton,
which the export dialog also parses with: .use() mutates the instance it is
called on, so registering the extension globally would change what the export
preview produces as a side effect. It sits at module scope because parser
configuration is not per-render state, not for speed — constructing one costs
about a microsecond against a 14 microsecond parse.
Two option choices are worth recording, since neither is the default and both
have a cost.
output: 'mathml'. KaTeX emits a MathML rendering and an HTML rendering of every
expression and relies on katex.min.css to clip the MathML copy; with no KaTeX
stylesheet loaded, the default shows each equation twice. Emitting MathML alone
avoids that without pulling in 28K of CSS and 1.2M of webfonts, keeps the
accessible rendering rather than the aria-hidden one, and renders as real
glyphs, which e-ink handles better than KaTeX's sub-pixel positioned spans.
Rendering quality now varies by engine; every platform target supports MathML
Core except a stale Android WebView that has never updated through Play.
nonStandard: true. The extension's standard rule requires the opening $ to sit
at the start of the string or immediately after a literal space. A newline does
not satisfy that, while the closing rule accepts one, so an equation on its own
line inside a multi-line note rendered as literal text with no error at all —
a silent failure in the most ordinary way to write a note. The cost is the
reverse: bare dollar amounts such as "$5 and $10" are parsed as math, which is
visible when it happens and escapable as \$. A false positive the writer can
see beats a false negative they cannot.
katex is pinned to ^0.16.45 rather than the ^0.18.1 that a plain install
resolves. The extension's peer range is >=0.16 <0.18, so 0.18 was outside it,
and 0.16.45 is the copy streamdown already pulls in for mermaid and
rehype-katex — one katex in the tree instead of two, and a version the
extension is tested against.
The tests build their own parser rather than importing the component, whose
store and Supabase imports need env config to load at all. Mirroring the
options that way would normally mean a change to the component leaves every
case green while the app renders something else, so a guard test reads the
component source and compares the option set against the one under test. It
fails on a changed value, a removed or added option, and on dropping gfm.
Several tests in this repo already assert on source and config text the same
way.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Two spelling mistakes were live on both the App Store and Google Play:
"beatifully organized" and "seemless text-to-speech". The captions were
baked into the screenshot PNGs with no editable source, so fixing them
meant rebuilding the panels.
Screenshots:
* App Store iPhone rebuilt at 1284x2778, the size this record's 6.5 inch
slot accepts. Panels 3 to 5 recaptured from the simulator.
* iPad captions replaced on the existing 2048x2732 captures.
* macOS set replaced with fresh 2880x1800 captures.
* Google Play phone, 7 inch and 10 inch composites rebuilt from the live
listing assets rather than the local promo folder, which turned out to
hold an unused revision of panels 1 and 2.
Captions are now rendered as text by fastlane/compositor/render-caption.mjs
through headless Chromium using the app's own Inter webfont, so the next
typo is a one line fix instead of a repaint.
Metadata:
* fastlane/metadata-play feeds Google Play while fastlane/metadata/android
stays with F-Droid, so Play can carry a keyword title while F-Droid keeps
the plain app name.
* fastlane/metadata-macos gives macOS its own App Store text, since
deliver's metadata_path has no platform dimension and both Apple lanes
would otherwise push identical copy.
* Descriptions rewritten. Every feature claim was checked against the
source first, which removed a false "semantic search" claim that was
live on Play.
Listing text and Play imagery now upload on release. App Store screenshots
stay manual. The internal and beta Play lanes still skip metadata because
Play listing assets are store level, not track level.
Adds pnpm validate-google-play to dry run the Play listing without a build.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Developer ID provisioning supports iCloud Documents: the committed
Readest-DeveloperID profile grants the ubiquity container entitlements
and provisions all devices. A config overlay applies the entitlements
and embeds the profile only for direct-distribution builds, keeping
ad-hoc dev builds unsigned-entitlement free.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Every Tauri build since 0.11.20 logs a source map parse error per chunk in the
webview console:
Source Map "tauri://localhost/_next/static/chunks/<hash>.js.map" has
SyntaxError: JSON Parse error: Unrecognized token '<'
productionBrowserSourceMaps makes Turbopack emit the maps and append a
sourceMappingURL comment to every chunk. upload-sourcemaps.mjs uploads the maps
to Sentry and deletes them, but left the comments behind, so devtools requested
the missing maps (204 of 210 chunks) and got the asset protocol's HTML back.
- upload-sourcemaps.mjs: strip the comment alongside the map. Turbopack names a
map after a different hash than the chunk pointing at it, so every chunk under
the directory is rewritten rather than paired by name. The sentry-cli debugId
comment is preserved, since Sentry matches uploaded maps by it.
- KEEP_SOURCEMAPS=1 keeps the maps in the bundle instead. dev-ios, dev-android
and the new dev-macos set it, so local devtools resolve minified frames to
real sources.
- Move the script body behind a main guard so the helpers are importable, and
unit test them.
Symbolication is unaffected: the strip still runs after the upload, so the
copies Sentry holds keep their comments.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
pnpm deploy failed with "Worker exceeded the uncompressed size limit of
64 MiB" (worker was 88 MiB). OpenNext builds by running `pnpm build`, and
the deploy forces webpack via patch-build-webpack, whose sed only matches
a script ending in `next build"`. PR #5027 appended
`&& node scripts/upload-sourcemaps.mjs` to the build script, so the sed
stopped matching and the deploy silently fell back to Turbopack, whose
larger, less tree-shaken server bundle blew past the limit (it also
disabled the serwist PWA, which does not support Turbopack).
Changes:
- Split the sourcemap upload out of `build` into a separate
`upload-sourcemaps` script so `build` ends in `next build` again and the
webpack patch matches. Tauri beforeBuildCommand runs both steps.
- deploy: pass --minify to wrangler; it does not minify by default and
re-expands the already minified handler by about 18 MiB.
- Replace the googleapis barrel import in the Play IAP verifier with
@googleapis/androidpublisher (same underlying client, drops about
11.6 MiB of unused Google API clients from the server bundle).
- Exclude browser-only WASM from the server bundle: stub
@readest/turso-database-wasm/webpack (was double bundled, 24 MiB) and
jieba-wasm (3.8 MiB) when isServer for the web build. Both only run in
the browser, so the Worker never needs them.
Worker script drops from 88 MiB to 22 MiB (wrangler deploy --dry-run
--minify).
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Markdown footnotes were left as literal text because marked has no
footnote support, with or without the gfm flag, and its maintainers have
said they will not add it.
Support both syntaxes readers actually write. The reference form
`[^label]` plus `[^label]: note` is the de-facto standard, adopted
verbatim by GitHub, Pandoc, Obsidian, Typora, Python-Markdown, goldmark
and others, and is parsed by the marked-footnote plugin. Pandoc and
Obsidian's inline `^[note]` is not, so expandInlineFootnotes rewrites it
into the standard form before the plugin runs; both then share one
numbering sequence. Code spans and fenced blocks are left alone.
The plugin collects every definition into one trailing section, which
would strand the whole book's notes inside the last h1 section once md.ts
splits at chapter boundaries, so a reference in chapter 2 would jump the
reader to the end of the book. Instead the definitions are lifted out and
re-emitted as per-chapter endnotes, numbered from 1 in each chapter. A
note cited from two chapters is cloned into both so every chapter's list
is complete and its numbers match its own references.
Emit DPUB roles rather than GitHub's data attributes: doc-noteref puts
foliate's FootnoteHandler on its definite branch, so markdown footnotes
get the same tap-to-popup treatment as EPUB footnotes with no reader-side
changes, and doc-backlink keeps the back arrows from opening popups on
themselves.
Allow section in the shared sanitizer so the plugin's footnotes wrapper
survives long enough to be found.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(ios): add CarPlay support for TTS
Surface active TTS sessions on Apple CarPlay, mirroring the Android Auto
integration. A CarPlaySceneDelegate presents a CPListTemplate root
showing the currently reading book (or a placeholder when idle) and
pushes the system Now Playing template. Transport and metadata ride the
existing MPNowPlayingInfoCenter / MPRemoteCommandCenter path, so no
CarPlay button is routed by hand. A new iOS-only update_carplay_state
command lets the media bridge report session start and stop, and TTS
autoplay deep links are consumed even when the target book is already
mounted, for example when the app cold restores straight into the
reader.
Registering the UIApplicationSceneManifest crashed the app at launch on
real devices: tao's configuration_for_connecting_scene_session returned
a raw borrow of a Retained UISceneConfiguration it immediately dropped,
so UIKit retained freed memory. Add the tao fork as the packages/tao
submodule (github.com/readest/tao, branch readest-0.35: tao 0.35.3 plus
only the callback returning an autoreleased strong reference) and patch
it in the workspace. Bump @tauri-apps/api to 2.11.1 and @tauri-apps/cli
to 2.11.4 for the tao 0.35/wry 0.55 stack, and advance the tauri fork
(branch readest-2.11) with a guard in the generated unlisten script
against already-removed listeners.
The tauri 2.11 stack needs two CI accommodations. First, the
build_tauri_app job overrides setup-rust-toolchain's default RUSTFLAGS
of -D warnings: cargo builds path-patched dependencies without
cap-lints, so upstream warnings in the tao fork (deprecated glib
channel calls in the Linux backend) would fail the app build; warnings
in our own crate stay enforced by the rust_lint job. Second, tauri 2.11
enforces ACL for IPC from remote origins even without an AppManifest
(upstream security fix#15266), and the webdriver harness serves the
vitest tester page from its own port, which is a remote origin, so
every custom app command was denied and 56 tauri tests failed.
Production is unaffected since real app pages are local origins.
Declare the app commands in the ACL app manifest in build.rs (generated
allow permissions committed under src-tauri/permissions/autogenerated),
grant them in capabilities/default.json for local windows, and add a
webdriver-remote capability for localhost remote origins that is pinned
out of shipped builds via app.security.capabilities in tauri.conf.json;
scripts/test-tauri.sh opts into it with a --config override. Verified
with pnpm test:tauri: 112 passed, 1 skipped.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(android): handle audio focus properly for background TTS
Request focus with a modern AudioFocusRequest (USAGE_MEDIA,
CONTENT_TYPE_SPEECH) and pause instead of ducking, matching how spoken
audio should yield to navigation prompts. Resume after transient loss
only when the loss is what paused us, forward focus transitions to the
web side as media-session play/pause events, and pause on
ACTION_AUDIO_BECOMING_NOISY so unplugging headphones does not blast the
speaker.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(ios): native audio playout for Edge TTS with Now Playing support
WebAudio in WKWebView renders in WebKit's GPU process under an audio
session the app cannot own, which made every system media behavior
unreliable on device: no lock-screen card, the card vanished on pause,
AirPods resumed another app, and the mute switch silenced playback.
Play the Edge TTS utterances with an in-process AVPlayer instead. The
native-tts plugin gains a deliberately dumb playout engine
(playout_enqueue, playout_control, playout_position) and the new
NativeAudioPlayer mirrors the WebAudioPlayer session interface, so
EdgeTTSClient just picks the player per platform. Word highlighting
reads the player's media clock, which AVPlayer reports in item time and
is therefore unaffected by the playback rate; rate changes stay pitch
preserving via the timeDomain pitch algorithm and inter-sentence gaps
run on a native timer immune to background JS throttling.
With the audio in the app process the plugin claims a non-mixable
.playback session with .spokenAudio mode, so navigation prompts pause
instead of duck. Handle interruption began and ended with shouldResume,
pause on route change to the speaker, and bind an MPNowPlayingSession
to the playout player so the paused state is reported explicitly and
the Now Playing slot survives a pause. The silent keep-alive player
pauses in lockstep, KVC playback state writes are simulator only where
they are required and harmful on device, and the mixWithOthers
use_background_audio calls are removed. On the web side the composite
iOS media session mirrors metadata and position into
navigator.mediaSession, remote commands map to directional play and
pause plus a toggle, and the silent unblocker element is skipped on iOS
Tauri since a playing HTMLMediaElement makes WebKit register its own
competing now-playing client.
Volume-key page flip previously defeated all of this: its handler
unconditionally reconfigured the shared session with .mixWithOthers,
and a mixable session is ineligible for the Now Playing slot, so
pausing TTS dismissed the card and handed AirPod controls to another
app. The two plugins now coordinate through in-process notifications:
native-tts announces claim and release of the audio session, and the
volume key handler leaves the session untouched while TTS owns it, so
volume keys keep flipping pages during a pause without losing the card,
and re-owns the session after TTS teardown regardless of ordering.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Production JS crashes report minified chunk names with no source lines, which
blocked triaging most reader/TTS Sentry issues. Generate browser source maps for
the Tauri export build and upload them right after `next build`:
- next.config: productionBrowserSourceMaps for the export build.
- scripts/upload-sourcemaps.mjs: sentry-cli injects debug IDs + uploads the maps
(release Readest@<version>, ~/_next/static url-prefix), then strips the .map
files so they never ship in the app bundle. Token-gated; never fails the build.
- CI (release.yml, nightly.yml): pass SENTRY_AUTH_TOKEN / SENTRY_ORG /
SENTRY_PROJECT alongside SENTRY_DSN.
- docs/sentry-symbolication.md: setup + required secret, and the native
(Android ProGuard/.so, iOS dSYM) follow-up.
Local and fork builds are unaffected: with no token the maps are stripped and
the output is unchanged. Needs the SENTRY_AUTH_TOKEN GitHub secret to take effect.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(wordlens): support en-en monolingual glosses
Gloss difficult English words with a short English definition for learners
reading English with English hints.
- build: buildEnEn + shortDefGloss read ECDICT's English `definition` column
(first/primary WordNet sense, POS-stripped, drop ;-example, <=24 word-boundary
with trailing-connector trim). New `en-en` CLI branch; buildEnZh/buildEnEn now
share a buildEnPack core.
- gating: drop the hardcoded `hint === source` rejections (wordlensSection,
WordLensPanel) so same-language packs are allowed; availability is decided by
the manifest (resolvePack returns null when no pack exists).
- data: data/wordlens/en-en.json (26,578 entries) + regenerated manifest.json.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(wordlens): gloss styling, derivation lemmas, display-time cap
Builds on the en-en monolingual gloss support with refinements and
regenerated packs.
- settings: per-book gloss <rt> font size (em) and color in
Settings > Language > Word Lens (getRubyStyles reads viewSettings).
- en-en hints: WordNet hybrid (a simpler synonym, else a category
hypernym, else the ECDICT definition) instead of raw verbose
definitions.
- lemmatization: gate difficulty by the lemma rank for every English
source pair. enBaseFormCandidates now also covers -able/-ible suffixes
and negative prefixes (un/in/im/ir/il), so insufferable resolves to
suffer. A candidate is accepted when the English definition names the
base OR the Chinese translations share a content character, which keeps
true derivations (insufferable -> suffer) and rejects coincidental
stems (capable -> cap). en-X packs inherit the en-en lemma table.
- display cap: the max gloss length is applied at render time in
cleanGloss (MAX_GLOSS_LEN), so the packs store the full hint and the
cap can change without regenerating data.
- tooling: pnpm wordlens:preview to sample pack entries; cache build
corpora under data/wordlens/.sources (gitignored).
- data: regenerate en-en, en-zh and en-de/es/fr/pt/ru plus the manifest.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
"Word Wise" is a Kindle trademark, so rename the inline-gloss feature to
"Word Lens" throughout the product.
- User-facing strings → "Word Lens" across all 34 locales; brand translated
for Chinese (zh-CN 单词透镜, zh-TW 單詞透鏡) and German (Word-Lens-Daten).
- Code identifiers: WordWise→WordLens, wordWise→wordLens, WORD_WISE→WORD_LENS.
- Files/dirs: src/services/wordwise→wordlens, WordWisePanel→WordLensPanel,
wordwise{Ruby,Section}.ts, build/sync scripts, test dirs/fixtures,
data/wordwise→data/wordlens.
- Storage paths: CDN base, R2 key, on-device cache dir, WORDLENS_R2_BUCKET env,
pnpm wordlens:{manifest,sync}. manifest.json is path-agnostic so its
sha256/bytes stay valid (verified).
- biome.json: point the formatter-ignore at data/wordlens so the generated
one-line gloss packs aren't pretty-printed on commit.
Migration notes:
- Re-run `pnpm wordlens:sync` to upload packs to cdn.readest.com/wordlens/.
- Persisted view-settings keys renamed (wordWiseEnabled/Level/HintLang and
wordWiseAutoDownload) — saved values reset to defaults once on upgrade.
- Cached packs under the old Data/wordwise/ orphan (harmless re-download).
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Resolve transitive Dependabot alerts on the web lockfile.
esbuild >= 0.28.1 (GHSA-gv7w-rqvm-qjhr #239, GHSA-g7r4-m6w7-qqqr #238):
Deno-module RCE via NPM_CONFIG_REGISTRY and Windows dev-server arbitrary
file read. Forced via a pnpm-workspace override (esbuild is a regular dep
of vite, so the override applies cleanly); bounded to <0.29 to stay on the
verified line. vite 7.3.3 declares ^0.27.0, but the 0.28 JS API is
unchanged for vite's usage -- verified by the full test run and web build.
@vitest/browser >= 4.1.8 (GHSA-g8mr-85jm-7xhm #240): Browser Mode CDP
bridge bypasses allowWrite/allowExec, enabling config overwrite -> RCE.
Bumped the vitest devDep family (vitest, @vitest/browser-*, coverage-v8)
from ^4.0.18 to ^4.1.8; resolves to 4.1.9.
Verified: pnpm test (5685 passed), pnpm lint, pnpm build-web (exit 0).
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat(reader): Word Wise — inline native-language vocabulary hints
Kindle-style Word Wise: a short native-language gloss renders above difficult words
as you read (always-on ruby), gated by a CEFR vocabulary-level slider (A1–C2);
tapping a glossed word opens the existing dictionary.
- Pipeline: CEFR→frequency-rank difficulty, inflection-aware gloss index, pure
offset-aware planner (EN regex + jieba for CJK).
- Rendering: <ruby cfi-skip>…<rt cfi-inert> injected per occurrence — CFI-transparent
(verified), so highlights/bookmarks/progress are unaffected; kept out of TTS word
offsets and find-in-book.
- Delivery: gloss packs are version-controlled in data/wordwise/, mirrored to R2, and
downloaded on demand into local storage (sha-verified, single-flight) when enabled.
- Settings: a Word Wise sub-page under Settings → Language (enable, level, hint
language, per-pack download/manage, auto-download toggle).
- Build tooling: scripts/build-wordwise-data.mjs (ECDICT / CC-CEDICT+HSK / WikDict +
FrequencyWords, with lemmatization) and scripts/sync-wordwise-r2.mjs.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* data(wordwise): bundled gloss packs + manifest + attribution
13 frequency-trimmed gloss packs (en↔中文 + es/fr/de/pt/it/ru↔en, ~19 MB) generated
by build-wordwise-data.mjs from ECDICT (MIT), CC-CEDICT + HSK, and WikDict +
FrequencyWords (CC-BY-SA). Source of truth, mirrored to the CDN via `pnpm wordwise:sync`.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>