mirror of
https://github.com/readest/readest.git
synced 2026-11-29 19:02:28 +00:00
3400 commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
052bbc8e77
|
feat(library): remove selected books from the device only (#7324)
* feat(library): remove selected books from the device only (#7318) Bulk delete in selection mode always deleted from cloud and device; the device-only removal was only in Book Details, one book at a time. The bulk delete confirmation now has a "Remove from Device Only" toggle. It runs the existing local delete for the selected books that have a cloud copy (or an Audiobookshelf offline download) and skips the rest, so a bulk action never leaves a book with no copy anywhere. With it on, the purge toggle and the delete message are hidden and the button reads "Remove". Verified: - Tests written first. Before the change, library-utils.test.ts failed with "canRemoveFromDeviceOnly is not a function" and DeleteConfirmAlert.test.tsx with "Unable to find ... checkbox 'Remove from Device Only'"; the hidden-message check failed with "expected <div class="text-start text-sm"></div> to be null". All pass now (176 tests across library-utils, DeleteConfirmAlert, Bookshelf and BookDetailModal), plus alert-width-stability browser test (3 tests). - pnpm lint and pnpm format:check clean. - dev-web with Playwright on a fresh profile: imported 3 EPUBs, gave 2 a stand-in cloud copy (uploadedAt), selected all 9 books, turned the toggle on and confirmed. The 2 lost their local file and downloadedAt and stayed in the library; the local-only book and the demo books were untouched. Dialog checked in light, dark, e-ink (data-eink), RTL and at 390 px. - Not run: a real cloud account (the cloud copy was faked), native desktop/Android/iOS builds, and confirming the toggle-off Delete path in the app (covered by the unit test). Reported by poife on GitHub. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(library): keep Enter on a delete toggle and a cancelled delete from misfiring Two CodeRabbit findings on #7324: - Alert confirms on any Enter, so Enter on the focused "Remove from Device Only" toggle ran a cloud-and-device delete. Enter on a toggle now flips it instead (capture phase, ahead of Alert's listener). - Cancel set the abort flag even with no deletion running, so the next confirmed bulk delete stopped before its first batch and deleted nothing. runDeletion now clears the flag when it starts. Verified: - DeleteConfirmAlert.test.tsx "toggles instead of confirming when Enter is pressed on a toggle" failed before the fix with 'expected "vi.fn()" to not be called at all, but actually been called 1 times'. - library.test.tsx "deletes the books after an earlier delete confirmation was cancelled" failed before the fix with 'expected "vi.fn()" to be called 2 times, but got 0 times'. - Both pass now, with 178 tests across the four related suites and the alert-width browser test; pnpm lint and pnpm format:check clean. - dev-web with Playwright: Cancel, reopen, focus the toggle, press Enter: the toggle turned on and the dialog stayed open; Remove then dropped the local files of the 2 books with a cloud copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(library): keep each bulk deletion's cancel to its own run CodeRabbit on #7324: clearing a shared abort flag at the start of a run let a cancelled run continue with its remaining batches when a new deletion started before its current batch finished, and the old run could then close the newer alert. Each run now takes a token; Cancel and any newer run make it stale, so it stops before its next batch and leaves the alert alone. Also fixes the Romanian plural forms of the new string ("al 1 carte" was ungrammatical). Verified: - library.test.tsx "stops a cancelled deletion even when another one starts before its batch ends" failed before the fix with 'expected "vi.fn()" to be called 21 times, but got 41 times' and passes now; 179 tests across the four related suites pass; pnpm lint and pnpm format:check clean. - dev-web with Playwright: Cancel, reopen, Enter on the toggle, Remove still drops the local files of the 2 books with a cloud copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
8e2270aba4
|
feat(tts): preview voices and pick a default voice per language (#7322)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
Publish Docker image / build (linux/amd64, ubuntu-latest) (push) Waiting to run
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm) (push) Waiting to run
Publish Docker image / merge (push) Blocked by required conditions
Build with Nix / tests (push) Waiting to run
PR checks / koplugin_rust_lint (push) Waiting to run
PR checks / nix_flake_check (push) Waiting to run
PR checks / rust_lint (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
PR checks / test_web_app (1) (push) Waiting to run
PR checks / test_web_app (2) (push) Waiting to run
PR checks / test_web_browser (push) Waiting to run
PR checks / test_extensions (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
* feat(tts): preview voices and pick a default voice per language Settings > TTS gets a Voice Library page, and the player's voice list is rebuilt on the same component (VoiceList). Each row shows the voice's gender, its language and region, and a play button. - Opened from the library, the page lists every language that has voices, with a gender filter. Previews read a sample sentence in the voice's language (75 languages, gender-neutral wording). - With a book open, only the book language's voices are listed, and previews read whole sentences from the start of the current page: at least 5 s of estimated speech, at most 400 characters. - Choosing a voice in Settings makes it the default for that language only. Picking one in the player sets that language's default too, and TTSController switches to a language's engine when the reading language changes. - In the player, a preview pauses reading. Picking the voice just heard resumes reading with it; leaving the list keeps it paused. - Readest Voice previews need a signed-in reader; the other engines don't. /api/tts/readest/stream takes a `preview` lane: any signed-in plan, any offered voice, one segment of at most 400 characters, and a 6,000-character daily floor for plans without Readest Voice. The voice service sees an ordinary listening window under its own client id, so its contract is unchanged. - Gender comes from a generated map for Edge, from the voice id for Kokoro voices (Readest Voice and custom services), and from AVSpeechSynthesisVoice on iOS. Android and Web Speech report none, so those rows have no badge. - The Voice Library lists Linux Speech Dispatcher voices (#7314) as it does Android and iOS system voices. Tests that fail without the change (old file put back, new test run): - tts-readest-stream-route.test.ts: 6 preview tests, e.g. "expected 403 to be 200" and "expected { error: 'PLAN_REQUIRED' } to deeply equal { error: 'VOICE_TIER_REQUIRED' }". - tts-controller-readest.test.ts: 4 tests on the per-language engine, e.g. "expected Mock{ name: 'edge-tts', ... } to be Mock{ name: 'readest-tts', ... }". - edgeTTS.test.ts: "expected undefined to be 'female'"; readest-voice-catalog.test.ts: 2 gender tests. - useTTSControl.test.tsx: "reads on with the new voice when asked to, though reading is stopped" fails with "expected vi.fn() to be called at least once". - tts-voice-library.test.ts, Linux: "expected [] to deeply equal [ 'de' ]". Checks on this tree, rebased on origin/main |
||
|
|
d5a249e7eb
|
fix(reader): reach the last page when a book ends partway into a spread (#7320)
* fix(reader): reach the last page when a book ends partway into a spread Sections are sized by columns so the next one can start beside the previous one's end. The book's last section has no next section, so in a two-column layout the book could end on the left column of a spread, and the paginator's scroll container stopped half a spread short. The final spread showed the column before the last one again. With fractional page widths, as under Windows display scaling, the reader either never reached the end (the counter stayed at 1443 / 1447) or stopped a page early and never showed the last column. foliate-js (readest/foliate-js#147) now pads the views to whole pages and counts a partial last page as a page. Fixes #7303. Reported by gonwan on GitHub. Verification: - paginator-last-page.browser.test.ts turns pages to the end of 5-column and 3+4-column books, LTR, RTL and vertical-rl, at page sizes 1000, 1003.3, 1011.1 and 1017.9. With main's foliate-js all 16 cases fail (`expected 974.140625 to be less than 472.1015625`, `expected false to be true` on atEnd); with the change all pass. - The 27 browser suites that load the paginator pass (196 tests), as do the jsdom paginator suites. pnpm lint and pnpm format:check pass. - dev-web, Playwright Chromium at DPR 1.25, the reporter's EPUB, last chapter turned to the end at 39 window widths: main failed 12 (at 1681 the last ~14 paragraphs were never shown while the counter read 1447 / 1447); the change passes all 39, with Use Book Layout on and off, and in dark mode. - Not run: Windows WebView2 itself, iOS/macOS WebKit, Android. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(reader): bound the right edge of the last right-to-left column The right-to-left case checked only where the last column starts, so a column running off the right edge of the page would still pass. It now checks the column's right edge stays within the page. Verified: the 16 last-page browser tests pass with the fix; with foliate-js at main (2e4dbc1) the four right-to-left cases fail ("expected false to be true", "expected -442 to be greater than or equal to 471.1015625"). Biome and tsc are clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore(deps): pin foliate-js to the merged paginator fix (#147) Moves the submodule from the PR branch commit 86e5d61 to c14f30c, the squash of readest/foliate-js#147 on foliate-js main. The trees are identical (`git diff 86e5d61 c14f30c` is empty). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
2d75e0937b
|
fix(sync): give HTML chapter files their own sync identity (#7321)
* fix(sync): give HTML chapter files their own sync identity Web-novel downloaders such as the legado and moon KOReader plugins save each chapter as its own HTML file under the book's title and author. The metadata hash, which syncs reading progress across devices, then matched every chapter of the book, so opening a new chapter could pull the previous chapter's position. #7231 does not cover this: a chapter opened for the first time has no save of its own, so a sibling's newer position still wins. HTML files (.html, .htm, .xhtml, .xhtm, .mhtml, .mht) now salt the meta hash with the base filename, as PDFs already do (#5411), in both the KOReader plugin and the app. The app keeps the salted hash from import and never recomputes it on a metadata refresh. Files already opened keep their cached hash; chapters opened after the update get their own. Verified: - Tests that fail without the fix: - spec/syncconfig_spec.lua "gives per-chapter HTML files of one book distinct hashes": expected 'Sword Coming|Fenghuo Xizhuhou||0001', got the hash source without the filename. - import-metahash.test.ts "imports HTML chapters with identical metadata as separate books" (expected the salted hash, got the shared one) and "refreshBookMetadata preserves the salted metaHash for HTML" (expected 'salted-import-hash', got the recomputed hash). - All koplugin busted specs pass (513), luajit syntax check clean; the related app suites pass (34 files); pnpm lint and format:check clean. - On a Kindle with KOReader, two HTML files sharing a title got the same meta_hash_v1 under the old plugin and distinct ones under the fix, each equal to md5 of "<title>|||<basename>". - Not run: the cross-device sync round trip, because sync from that Kindle currently fails for an unrelated reason. Closes #7313 Reported by zzzh3ng on GitHub Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sync): salt the HTML metaHash when an existing row has none An existing HTML row with no metaHash (imported before metaHashes existed) kept undefined on re-import instead of getting a salted hash. Keep the stored hash only when there is one. Verified: the new import-metahash test "salts the metaHash when re-importing an HTML book that has none" fails without this change (expected undefined to be the salted hash) and passes with it; related suites pass (35 files, 543 tests); pnpm lint and format:check clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
6ab667bd26
|
fix(annotator): clear a moved highlight's old anchors on the server too (#7319)
Moving a highlight's range cleared its KOReader xpointers and CrossPoint anchor as undefined, and the push drops undefined fields. When the new range then couldn't be anchored, the server kept the old range's anchors, and the next pull merged them back over the local note, so KOReader and CrossPoint kept the old range. They are now cleared as null, which the push sends, so the server forgets the old range either way, and the next session tries to anchor the new one again. From CodeRabbit's review of #7317 (outside the diff). Fails without the change: useAnnotationEditor "a moved range drops the KOReader and CrossPoint anchors of the old one" (expected undefined to be null). transform "sends anchors cleared by a moved range as null, so the server forgets them" pins that a null reaches the server record. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
045beb4d1a
|
feat(crosspoint): sync CrossPoint 2.0 clippings with Readest highlights (#7317)
* feat(crosspoint): sync CrossPoint 2.0 clippings with Readest highlights
CrossPoint 2.0's Sync Clippings first probes
{KOSync server}/api/v1/clippings/{document} for sync_version 2, and stops
the whole sync, progress included, when the probe fails. Readest's KOSync
endpoint had no such route, so a reader signed in with the Readest plugin
showed "Could Not Sync Clippings" and stopped syncing progress once the
setting was on.
- /api/crosspoint/api/v1/clippings/{document} serves the clippings API
(sync_version 2, cursor paging, tombstones). A clipping is a book_notes
highlight whose new `crosspoint` column holds the reader's anchor (spine
plus a code-point range), the way xpointer0/xpointer1 hold KOReader's.
Only items the firmware can decode are sent, up to the 256 an X3/X4
holds per book. A rewritten copy (Optimize EPUB) syncs as the library
book it is linked to, and its first clippings move to that book when
its progress upload links it.
- Readest apps turn a clipping into a CFI when they open the book, and
give each EPUB highlight a CrossPoint anchor when they push it (tried
once a session). Moving a highlight's range drops the old anchors.
- Migration 033 adds book_notes.crosspoint (nullable jsonb). Apply it
before the web deploy.
- Plugin README: CrossPoint 2.0 names and requirements, and highlights.
Fails without the change: useNotesSync-crosspoint (4 of 5, e.g. "turns a
clipping a reader synced into a highlight at its CFI"), transform "carries
the anchor in the crosspoint column, both ways", useAnnotationEditor "a
moved range drops the KOReader and CrossPoint anchors of the old one"
(expected the old xpointer to be undefined), and the route test "moves a
rewritten copy's clippings to the library book it gets linked to". The
clippings route tests can't run without the route.
Verified on a real X4 (CrossPoint 2.0.0) with Sync Clippings on: the
probe and uploads answer 200, a reader clipping shows in Readest on its
words, a Readest highlight shows on the X4, and deletions go both ways.
Reported by itsthisjustin (CrossPoint).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(crosspoint): sync a document a reader names by its file name
A reader set to match documents by file name (CrossPoint's default, and
the alternate lookup of its Smart Sync) sends md5 of the book's file
name, as KOReader does. Since #7237 Readest keeps the name a book was
imported under (books.original_filename), and #7253 digests it the same
way in Readest's own KOSync client.
Progress, clippings and reading sessions now resolve such a document to
the library book imported under that name, link it on first sight like a
rewritten copy, and move clippings saved under the name's id to the book.
When two books were imported under one name, the most recently read one
wins. A document that is a book's own id is never looked up by name, and
an NFD spelling of the name does not match.
Fails without the change: 5 of the 6 tests in "a document named by its
file name", e.g. "syncs it as the library book imported under that name,
linked on first sight" (the link write and the library book's queries
never happen). The sixth, a name no book has, passed before too.
Not run on a device: the books in the test library were imported before
#7237 and have no original_filename.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(crosspoint): page the file-name lookup, and retry a failed clipping move
From CodeRabbit's review of this PR:
- The lookup of the book imported under a file name read the user's books
in one request, and PostgREST answers at most 1000 rows (db-max-rows),
so a match past them was never found. It now pages through them by
book_hash.
- A copy was linked before its clippings moved to the library book, and a
failed move only logged a warning. Every later request followed the
link, so those clippings stayed under the copy's id for good. They now
move first, and a failed move fails that sync, leaving the copy
unlinked so the next sync tries again.
Fails without the change: "finds the book past the first 1000 imported
under a name" (no link written: expected [ …(20) ] to deeply equal
ArrayContaining{…}), and "links a copy only once its clippings have
moved, so a failed move is tried again" (expected 200 to be 500).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
3384fa679e
|
feat(vocabulary): redesign the mobile header (#7315)
* feat(vocabulary): redesign the mobile header (owner: "the header is not modern and appealing")
The Vocabulary window's header on phones was a plain input, two text
export buttons and a boxed book select. It is now:
- a rounded search field with a clear button, and one round Export
button that opens a menu (Export CSV, Export to Anki);
- a row of filter chips (All, Looked Up, Learning, Mastered, each with
its count) ending in a book chip, scrolling sideways on narrow screens;
- in the word detail, the back button, the word, and Look up and Delete
icons on one line, replacing the text buttons at the bottom.
The book chip is last in the scrolling row and its picker lines up with
the chip's edge, so a half-hidden chip opened a half-hidden picker.
Pressing the chip now scrolls it fully into view first (keeping the
16px gutter), and so does choosing a book, since the chip widens to
the title.
Verified:
- New test "brings the book chip fully into view before its picker
opens" fails without the pointerdown handler ("expected vi.fn() to be
called with arguments: [{ block: 'nearest', ... }]") and passes with it.
- Xiaomi 2211133C (Android, dark) release build with real taps: export
menu, chip row swipe, book picker and filtering, the one-line detail
header, and the selected long-title chip fully in view.
- Chrome on dev-web at 500px: tapping the half-hidden chip scrolls it in
and the picker opens on screen, also after picking a long title.
- Playwright at 393px: light, dark, e-ink and RTL, list, menu, picker
and detail; 1100px desktop list and detail.
- Not run on the device: Look up, Delete and saving an export, to keep
sample words out of a synced account. Their handlers are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(vocabulary): keep the window inside screens 640-760px wide
From the sm breakpoint the window took a fixed 760px width, capped only
at 768px, so on screens from 640 to 760px wide it overflowed and was
clipped on both sides. Cap it at 90vw, as other wide dialogs do.
Verified:
- New browser test vocabulary-dialog-layout opens the window at 390,
640, 666, 720 and 1100px. Without the fix it fails at 640, 666 and
720px ("expected -60 / -47 / -20 to be greater than or equal to 0",
the box's left edge); with it all five pass.
- Playwright screenshot at 666px: the whole window, list and detail fit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(vocabulary): close the export menu, 44px header buttons, focus rings
From review on #7315:
- Export CSV / Export to Anki left the menu and its overlay open; both
items are now transient.
- Back, Look up and Delete in the word detail were 36px; Back navigates
away and Delete isn't undoable, so they are now 44px (DESIGN.md hit
targets). The row's edge margins grow to match, so the icons stay
aligned with the content.
- The search field's clear button was 28px; now 32px.
- Tabbing to the book chip showed nothing, and the search field's only
focus cue (a background shift) is off under e-ink. The chip now shows
a ring on keyboard focus, and the search field a solid ring under e-ink.
Verified:
- "exports only the words the filters show" now also expects the menu
closed; without `transient` it fails with "expected <button
role="menuitem" …> to be null".
- Browser test "gives the phone header buttons a big enough tap target"
fails without the change ("expected 28 to be greater than or equal to
32" for Clear; with only the old detail header, "Back: expected 36 to
be greater than or equal to 44").
- Browser tests "shows keyboard focus on the search field and book chip"
(e-ink off and on) tab to each control and fail without the change: the
chip's computed box-shadow/background/outline didn't change.
- pnpm lint clean; pnpm test 15274 passed; the browser test file 8/8.
- Playwright at 393px: word detail in dark, e-ink and RTL.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
50c4ae8258
|
feat(tts): read aloud with Speech Dispatcher voices on Linux (#7314)
* feat(tts): read aloud with Speech Dispatcher voices on Linux
Read Aloud on Linux can now use the voices installed in Speech
Dispatcher (eSpeak NG, or Piper through a module) under System TTS.
The native-tts plugin speaks SSIP over the daemon's Unix socket with
no speech library linked, so the AppImage uses the host daemon and the
Flatpak needs --filesystem=xdg-run/speech-dispatcher:ro
(docs/linux-system-tts.md). Each reader window gets its own
connection, closed when the window is destroyed. If the daemon or its
voices are unavailable, the other engines remain.
- Voices keep their Speech Dispatcher names; eSpeak NG's per-variant
copies ("English (America)+Annie") are dropped, so English lists 9
voices instead of 945. The module is appended only when two modules
list voices.
- Pause stops the sentence and Play reads it again, as on Android. A
speechd PAUSE holds back the restarted SPEAK, and RESUME then
cancels it, so Play skipped the paused sentence.
- A closing window cancels its speech: speechd finishes a disconnected
client's message.
- Events that arrive before the speak reply are kept, and an aborted
utterance is canceled by ID so a late reply cannot stop its
replacement. Rates go to speechd as given, without the mobile
exponent.
Tests that fail without the change:
- Rust (plugin): pause_cancels_so_the_restarted_sentence_is_not_held_back
(left "PAUSE SELF\r\n", right "CANCEL SELF\r\n");
lists_each_espeak_voice_once_rather_than_once_per_variant (4 voices,
expected 2); closing_a_reader_window_silences_its_speech (left "",
right "CANCEL SELF\r\n").
- TS: 8 tests in native-tts-client.test.ts and tts-controller.test.ts
fail against the old NativeTTSClient/TTSController, 7 on assertions
(e.g. "expected [] to deeply equal [ 'boundary', 'end' ]",
"expected null not to be null" for the Linux system voices) and one
on its 5 s timeout (overlapping speak replies).
Real use, Linux CEF dev build, isolated HOME, host speech-dispatcher
0.12.1 with its eSpeak NG module:
- Pause/Play 3 of 3 re-read the paused sentence with no "Speech
interrupted"; before the fix 3 of 3 skipped it.
- Speak on a selection while paused speaks (before: silent).
- Picker lists 9 System TTS voices; choosing another voice and pressing
Play reads on in that voice.
- Speed: 2.7 s per sentence at 1.5x, 5.2 s at 0.95x.
- Closing the book at +1.4 s into a sentence: speech ends 1 s later;
without the cancel it ran 3.6 s to the sentence's end.
- SPEECHD_ADDRESS at a missing socket: "System TTS unavailable" is
logged and Read Aloud falls back to Edge TTS.
Checks: plugin cargo test (36 passed), pnpm test:rust (204 passed),
the two TS suites (171 passed), pnpm lint, pnpm fmt:check, pnpm
clippy:check, cargo check of the plugin for x86_64-pc-windows-gnu and
aarch64-linux-android.
Not run: the AppImage and Flatpak packages, two reader windows reading
at once, light/dark/e-ink (no UI changed). Chinese books get no System
TTS voice: eSpeak NG labels them cmn/yue and language matching expects
zh.
Closes #6805
Reported by ell1e on GitHub.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(tts): keep a slow Speech Dispatcher voice list from disabling System TTS
Every command waited at most 3 s, and a timeout closes the connection
because a late reply would answer the next command. eSpeak NG sends
about 15k voice rows for LIST SYNTHESIS_VOICES: 0.4 s here, warm or
cold, so a slow machine or module could run past 3 s. voices() then
took the dead connection for a module without voices and failed with
"Speech Dispatcher has no installed voices".
The voice list now gets 10 s, under the reader's 15 s engine init
limit. A lost connection ends the listing with its cause ("Speech
Dispatcher did not answer in time while listing piper voices"); a
module that answers with an error is still skipped.
Raised by CodeRabbit on #7314.
Tests that fail without the change:
- waits_for_a_slow_voice_list: the reply comes 3.5 s after the request;
fails at "a voice list slower than one command must still arrive".
- a_lost_connection_while_listing_voices_reports_the_cause: left
Some("Speech Dispatcher has no installed voices"), right
Some("Speech Dispatcher disconnected while listing espeak-ng voices").
Checks: plugin cargo test --lib (38 passed), pnpm test:rust (204
passed), pnpm fmt:check, pnpm clippy:check, cargo fmt --check in the
plugin. Real daemon (speech-dispatcher 0.12.1, eSpeak NG): init()
lists 141 voices in 0.43 s.
Not run: a real slow module (the delay is simulated in the test), and
the Tauri app after this change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(tts): give every reader speed its own Speech Dispatcher rate
The reader offers 0.5x to 3x (the speed ruler and RSVP's rate list),
but the Linux bridge sent (rate - 1) * 100 clamped to SSIP's -100..100,
so 2x, 2.5x and 3x all became 100 and sounded the same, and 0.5x only
reached -50. 0.5x-1x now spreads over -100..0 and 1x-3x over 0..100.
Raised by CodeRabbit on #7314.
Test that fails without the change:
every_reader_speed_has_its_own_ssip_rate, left
[-50, -25, 0, 50, 100, 100, 100], right [-100, -50, 0, 25, 50, 75, 100]
for 0.5, 0.75, 1, 1.5, 2, 2.5, 3.
Real daemon (speech-dispatcher 0.12.1, eSpeak NG), one sentence spoken
through SpeechDispatcher at each speed, begin to end: 0.5x 12.17 s,
1x 5.57 s, 1.5x 3.91 s, 2x 2.97 s, 2.5x 2.29 s, 3x 1.82 s (0.46x,
1.42x, 1.88x, 2.44x, 3.05x of 1x).
Checks: plugin cargo test --lib (39 passed), pnpm test:rust (204
passed), pnpm fmt:check, pnpm clippy:check, cargo fmt --check in the
plugin.
Not run: the speed ruler in the Tauri app after this change; the
mapping from the ruler to set_rate is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
8f36b28982
|
fix(sync): sync a re-enabled or cleared custom TTS field to other devices (#7307)
* fix(sync): sync a re-enabled or cleared custom TTS field to other devices Replica fields merge per key, and a key left out of the push keeps its old value on the server. Re-enabling a custom TTS service dropped the 'disabled' key instead of sending false, so the next pull disabled the service again; clearing instructions, voices or the response format came back the same way. Always send these keys, as the custom translator adapter already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore: trim comments Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * style: format customTTS adapter test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(sync): assert the clearing value in the custom TTS adapter test `toHaveProperty` also passed when pack() wrote `undefined`, which JSON drops, so a broken fix would still have passed. Assert `false` for `disabled` and `null` for the other fields, as CodeRabbit pointed out. Verified: writing `fields['instructions'] = s.instructions` (no `?? null`) now fails "clearing instructions reaches other devices" with "expected undefined to be null"; with the PR's fix all 8 cases pass. Full `pnpm test` (15267 passed) and `pnpm lint` pass on this head. Main's newer commits touch no sync or TTS files and the merge is clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Huang Xin <chrox.huang@gmail.com> |
||
|
|
8380b8c6f7
|
fix(send): allow PATCH through CORS so the apps can approve a sender (#7312)
Tapping the checkmark on a pending sender in Send to Readest sends PATCH
/api/send/senders. PATCH was missing from the methods the API allows, so
the desktop and mobile apps, which call the API cross-origin, had it
blocked at preflight and showed "Could not approve sender". Adding and
removing a sender use POST and DELETE and were not affected. The web app
is same-origin, so it was not affected either.
src/middleware.ts is the fix: it answers every /api OPTIONS request first.
src/utils/cors.ts gets the same word so the two lists agree. Its methods
are not reached on /api, so it has no test of its own.
This was the only blocked call. /api/notion is the only other PATCH route;
the web app reaches it same-origin and the native client bypasses it. The
OPDS proxy's read-only list is correct as it is.
Fails without the change: src/__tests__/middleware.test.ts "allows PATCH
so the native apps can approve a pending Send to Readest sender", with
"expected [ Array(5) ] to include 'PATCH'".
Verified in WebKit and Chromium through Playwright, from a page on an
allowed origin calling a dev server with the same request as
approveSender():
before: PATCH blocked (WebKit "TypeError: Load failed"), DELETE reached
the route
after: PATCH and DELETE both reached the route (403 for the probe's
fake token)
pnpm test: 15264 passed, 16 skipped. pnpm lint, pnpm format:check and
pnpm build-web pass.
Not run: approving a real pending sender from a signed-in app. The apps
call production, so this can only be checked after the web deploy.
Reported by a user by email.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
a389b68b35
|
feat(annotator): draw a global annotation's copies as a dashed underline (#7309)
* feat(annotator): draw a global annotation's copies as a dashed underline (owner: "showing dashed underline without note icon") Every other occurrence of a global annotation's text used to get the annotation's own highlight plus a note icon. Each copy now draws one fine dashed underline in the theme's text color at 50% (solid on black-and-white e-ink) and no note icon. Clicking a copy opens the note when the annotation has one, and the highlight toolbar otherwise. The original keeps its highlight and note icon. - The underline strokes var(--color-base-content) set as a style, so it follows a light/dark switch: overlays aren't redrawn on a theme change, and a resolved color drawn in dark mode stayed light gray on a light page. - Global annotations are now also bucketed under their own section. They were kept out of it, so the original's note icon was never drawn after the book reopened; the copies' icons used to hide that. - Click resolution moved into resolveAnnotationClick so it can be tested. Verified: - With the source reverted to origin/main, 9 of the new tests fail: 6 on assertions (6 overlays instead of 3 for a global note, 'highlight' instead of 'global' for a copy, no theme-variable stroke, a global note missing from its section's notes) and 3 because resolveAnnotationClick did not exist. All pass with the change. - pnpm format:check, pnpm lint and pnpm test (1253 files) pass. - In Chrome on pnpm dev-web, with a global "Alice" plus a note in Alice's Adventures in Wonderland: copies across chapters draw dashed with no icon; clicking one opens the note; after a reload the original keeps its highlight and icon; a live dark/light switch recolors the dashes; on e-ink all 53 copies on the open pages draw solid. - Not checked: vertical writing mode, mobile devices. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(annotator): keep toolbar actions on a global copy bound to its highlight Answers CodeRabbit on #7309. Clicking a copy of a global highlight with no note opens the toolbar with the highlight's cfi but the copy's range. handleHighlight recomputed the CFI from that range, so Delete Highlight (and a restyle) missed the highlight and added a new one at the copy. An annotated single-range selection now keeps its cfi, as popup selections already did; the range editor keeps that cfi in step when it resizes a highlight. A copy also no longer opens the range handles: dragging them moved the highlight itself to the copy's text. Black-and-white e-ink draws the copies dashed at full opacity, not solid as the first commit said: a solid line would look like an Underline highlight. The comment and test say so. Verified: - Two new tests in AnnotatorShowImportedAnnotation.test.tsx fail without the fix: Delete Highlight on a copy left `expected [ { …(2) }, { …(2) } ] to deeply equal [ { …(2) } ]` (the highlight kept plus a new record at the copy), and the copy rendered the range editor. Both pass with it. - pnpm lint and pnpm test (1253 files) pass. - In Chrome on pnpm dev-web: a global "Rabbit" with no note, clicked on a copy, opens the toolbar with no handles; Delete Highlight removes the highlight and all its copies, and a reload shows nothing left behind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(annotator): draw global copies with foliate's Overlayer.dashedUnderline (owner: "should we draw the dashed line in foliate overlayer?") drawDashedUnderline copied Overlayer.underline's placement (the edge, the padding, the vertical writing-mode branch) into annotatorUtil. The dashed line now lives in foliate-js as Overlayer.dashedUnderline (readest/foliate-js#146), next to underline and squiggly. Readest still chooses the look: var(--color-base-content) as the color, 50% opacity, full opacity on black-and-white e-ink. The submodule points at the PR branch's commit 31d584c. It has to be re-pointed at the merged commit once readest/foliate-js#146 is merged. Verified: - overlayer-dashed-underline.test.ts fails before the method exists (`Overlayer.dashedUnderline is not a function`) and passes with it. It checks the stroke, opacity, width and dash attributes, and that each line runs along the centre of underline's rect, horizontally and in vertical-rl. - The existing drawAnnotationOverlay tests pass unchanged against the foliate method. pnpm lint and pnpm test (1254 files) pass. - In Chrome on pnpm dev-web from this branch: 29 copies on the open pages draw with stroke var(--color-base-content) (rgb(23, 23, 23) in the light theme), opacity 0.5, width 1, dashes 2 2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore(foliate-js): point at the merged dashedUnderline (#146) readest/foliate-js#146 merged as 2e4dbc1, with the same content as the branch commit 31d584c this PR pointed at before (empty diff between them). Verified: overlayer-dashed-underline.test.ts and annotatorUtil.test.ts pass against 2e4dbc1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(annotator): open the note editor when annotating a global copy Answers CodeRabbit's outside-diff finding on #7309. After dbee344de, Annotate on a copy of a global highlight with no note found the highlight in handleHighlight (it keeps the selection's cfi) but looked the target up again by the copy's range, found nothing and returned: no editor opened. Both now use keepsSelectionCfi, so the editor opens on the highlight. Verified: a new test in AnnotatorShowImportedAnnotation.test.tsx fails without this (`expected null not to be null`: no note editor) and passes with it, with no record added. pnpm lint and pnpm test (1254 files) pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
16a5468921
|
fix(annotator): line the note card up with its popup box (#7310)
* fix(annotator): line the note card up with its popup box (owner: "two popups overlayed and the corner is not well aligned")
A note opens as its own bordered card inside the toolbar's 44px popup
box. The box has a 1px border in every mode and the card sat at offset 0
inside it, 1px in from the box's outer edge, where the triangle joins.
The box's frame showed around the card and the corners didn't match.
With the popup above the text, the triangle's fill covered the box's
border row but not the card's, one row up, leaving a line across the
triangle's base.
The card and the note editor now sit at -1px on the triangle edge and
the side, so they cover the box exactly. The e-ink-only
translate(-1px, -1px) on .annotation-notes is gone: it only fixed popups
below the text and put popups above it 2px off.
Verified:
- New browser test in annotation-popup-layout.browser.test.tsx measures
the card against the box with the triangle up and down, e-ink on and
off. With the source reverted to origin/main, 3 of the 4 fail:
`expected { left: 21, right: 321, bottom: 199 } to deeply equal
{ left: 20, right: 320, bottom: 200 }` (light/dark, triangle below), 1px
on the top and left with the triangle above, and 2px at the bottom on
e-ink with the triangle below. All 4 pass with the change.
- pnpm format:check, pnpm lint, pnpm test (1253 files) and the popup
browser tests (annotation-popup-layout, footnote-popup-toolbar-stacking,
popup-safe-area) pass.
- In Chrome on pnpm dev-web, a note popup above and one below the text
have card and box edges equal to the pixel, with no line at the triangle.
- Not checked in the app: the note editor (same -1px placement), vertical
writing mode, mobile devices.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(annotator): measure the note editor against its popup box too
Answers CodeRabbit's nitpick on #7310: the alignment test measured the
note card only, so the editor's -1px offsets could regress unnoticed. Each
case now also opens the note editor and checks its left, right and
triangle-side edges against the popup box.
Verified: with only AnnotationPopup.tsx (the editor's offsets) reverted
to origin/main, all 4 cases fail on `.annotation-note-editor`; with the
change they pass. pnpm lint passes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(annotator): cover vertical writing in the note card alignment test
Answers CodeRabbit's nitpick on #7310: the card and editor offsets have a
vertical branch (right/left plus top), but the test only rendered
horizontal text. It now runs all four triangle directions (up, down,
left, right) with e-ink on and off, and checks the triangle's edge and the
two edges across from it for both the note card and the note editor.
Verified: with AnnotationNotes.tsx, AnnotationPopup.tsx and globals.css
put back to origin/main, all 8 cases fail; with the change they pass.
pnpm lint and the popup browser tests (annotation-popup-layout,
footnote-popup-toolbar-stacking, popup-safe-area) pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
8c10025f37
|
fix(auth): keep the sign-in callback URL out of logs (#7305)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
Publish Docker image / build (linux/amd64, ubuntu-latest) (push) Waiting to run
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm) (push) Waiting to run
Publish Docker image / merge (push) Blocked by required conditions
Build with Nix / tests (push) Waiting to run
PR checks / nix_flake_check (push) Waiting to run
PR checks / rust_lint (push) Waiting to run
PR checks / koplugin_rust_lint (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
PR checks / test_web_app (1) (push) Waiting to run
PR checks / test_web_app (2) (push) Waiting to run
PR checks / test_web_browser (push) Waiting to run
PR checks / test_extensions (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
The macOS auth session logged the full callback URL at INFO, which the release build writes to Readest.log. Its fragment holds the session's access and refresh tokens (and the provider token for Google sign-in). Log only that the callback arrived. The auth page also printed the same URL, and the single-instance payload carrying it, to the webview console; drop both. Verified: the change only removes log output, so there is no behavior to test. `pnpm lint` passes and `cargo fmt --check` passes on the file. Not run: a macOS build or sign-in, since this machine has no macOS target; the edited line only drops the format argument from a `log::info!` call. Reported by ts-eva on GitHub. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
cc9ac61c4b
|
fix(bookdrop): keep received file names inside the inbox (#7304)
* fix(bookdrop): keep received file names inside the inbox The Nearby BookDrop receiver joined the file name the sending device declared straight onto the inbox folder, so a name with `../` segments or an absolute path was saved outside it. Use only the last path component of the declared name, falling back to "file" when there is none. The web-browser download path has its own unique_path, but both of its callers already reduce the name to one component first. Verified: - localsend::service::tests::unique_path_keeps_peer_file_names_inside_the_inbox fails without the change: left "/tmp/ls-up-trav-…/../../evil.epub", right "/tmp/ls-up-trav-…/evil.epub". It passes with it. - pnpm test:rust (203 passed), pnpm clippy:check, pnpm fmt:check. - In the Linux CEF dev build (isolated profile), a LocalSend v2 client sent "../../../../../../../../../../tmp/claude-adv/pwned-target/evil.epub"; after Accept the upload returned 200 and the file was saved as localsend/inbox/evil.epub, with nothing written to the target folder. - Not run: the same request against the unfixed build in the app (the dev target directory was shared with another running app), or on Windows, where `\` is also a separator for Path::file_name. Reported by ccsimplyspolit on GitHub. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(bookdrop): reserve each inbox name before the upload writes it Uploads in one session are handled concurrently, and keeping only the last path component makes `a/book.epub` and `b/book.epub` both pick `book.epub`: two uploads could pass the exists() check together and write the same file. unique_path now claims the name with an empty file (create_new) and moves to the next numbered name when it is taken. The upstream writer opens the target with File::create, so it truncates the placeholder as before. A failed reservation fails that upload. Verified: unique_path_reserves_the_name_it_returns fails without the change (left "/tmp/ls-up-res-…/book.epub", right "…/book (2).epub") and passes with it. pnpm test:rust (204 passed), pnpm clippy:check and pnpm fmt:check pass. Not run: an in-app transfer of two same-named files, since the dev build's target directory is shared with another running app. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(bookdrop): report a failed inbox reservation like a failed upload When the inbox name couldn't be reserved, the upload was dropped without the per-file done event, so the app never heard that file had failed or why. The reservation error now goes through the same completion task as a failed write: the file counts as failed, `localsend:receive-file-done` carries the error with no path, and the session-end check runs. Verified: pnpm test:rust (204 passed), pnpm clippy:check and pnpm fmt:check pass. Not run: a test or in-app run of the failure path. No test in this crate builds an AppHandle (tauri's `test` feature is off), and the dev build's target directory is shared with another running app. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
e9490ee4a9
|
fix(reader): preserve publisher font lists and category fallbacks (#7302)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
Publish Docker image / build (linux/amd64, ubuntu-latest) (push) Waiting to run
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm) (push) Waiting to run
Publish Docker image / merge (push) Blocked by required conditions
Build with Nix / tests (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
PR checks / test_web_app (1) (push) Waiting to run
PR checks / nix_flake_check (push) Waiting to run
PR checks / rust_lint (push) Waiting to run
PR checks / koplugin_rust_lint (push) Waiting to run
PR checks / test_web_app (2) (push) Waiting to run
PR checks / test_web_browser (push) Waiting to run
PR checks / test_extensions (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
Tokenize family lists locally so quotes, comments, CSS escapes and function commas remain intact. Use the same tokenization for generic detection and replacement, and nest every eligible category in publisher list order. Preserve the existing encoded-apostrophe fix from aae1b6517. Verification: - New tests failed before the fix: quoted names were changed, commented generics were missed, and later enabled categories kept PublisherMixed. Four unit and two computed-style browser regressions failed. - Related unit suites: 224 passed; focused Chromium suites: 10 passed, including the existing encoded O'Neill regression. - Running web reader with generated EPUB: quoted/apostrophe names preserved, commented serif and later monospace switches work, original fonts restored. - Formatting, lint and the full unit suite run through the pre-push hook. - Native Linux, Android and iOS checks not run for this parser follow-up. Co-authored-by: Claude Code <noreply@anthropic.com> |
||
|
|
ba8cc03573
|
fix(reader): draw PDF text at the screen's full resolution on iOS and Android (#7300)
* fix(reader): draw PDF text at the screen's full resolution on iOS and Android PDF pages on mobile are drawn within a memory budget (#5118): at most 2x and about 3.1 Mpx per page. A 3x iPhone drew text at 2x, an iPad page fitted to the screen came out at 1.85x on a 2x screen, and zooming lowered it toward 1x, so text got softer the further the reader zoomed. foliate-js (readest/foliate-js#144) keeps the budgeted page and adds a canvas over only the on-screen part of it at the full device pixel ratio. Its size is bounded by the screen, so the budget still holds. The page is cut away under it, since Readest's mix-blend-mode would otherwise show the coarse page through as a halo. Desktop is unchanged. Verification: - New pdf-detail-canvas.test.ts: with main's foliate-js 3 of its 5 tests fail ("expected undefined to be truthy" for the detail canvas, and "expected '' to match /^polygon\(evenodd.../" for the clip); all 5 pass with the change. - pnpm test: 1252 files passed, 4 skipped (15217 tests passed). - pnpm lint and pnpm format:check passed; eslint on foliate pdf.js passed. - iPad Air 11" M2, iPadOS 27, release build with devtools, a text PDF driven over the WebKit inspector: the visible page went from 1.85x to 2.0x at fit and from 1.0x to 2.0x at 300% zoom. Edge blur score (grey edge pixels per ink pixel) 1.77 -> 0.87 at fit, 3.64 -> 2.18 at 300%. The detail followed a pan; scrolled flow gave each of two visible pages its own slice; 25 page turns at 300% left no WebKit memory kill in syslog. With mix-blend-mode multiply on a sepia page, the halo shows without the clip and is gone with it. - Not run: an iPhone (3x), Android, e-ink, and themed PDF page colors on a device: iOS WebKit has no canvas filter, so "apply theme to PDF" does not theme pages on iOS with or without this change. Reported by ruslanMacari on GitHub (#7100). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(reader): release closed PDF pages' detail canvases, test a page scrolled away Moves foliate-js to da95896 (readest/foliate-js#144), which holds the detail canvases' documents weakly: once a reader closed, nothing pruned them, so each closed page document stayed reachable with its page bitmap until another PDF opened. Adds a test that a page scrolled off the screen, with its iframe still visible, drops its detail canvas and clears the clip. Both raised by CodeRabbit on #7300. Verification: - The new test passes; all 33 document test files pass (294 tests). - eslint on foliate pdf.js passed. - iPad Air 11" (iPadOS 27), rebuilt release build: detail canvas at 2.0x at fit, at 300% and after a pan, and again after closing and reopening the book and turning a page. - Not run: a memory measurement of closing a reader (the leak was only reachable references; there is no GC hook to assert it in jsdom). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore(deps): move foliate-js to main after #144 and #145 merged Points the submodule at 95fa3b7, the merge of readest/foliate-js#145 on top of #144 (b8dd100). Its pdf.js is identical to da95896, the commit this PR pinned before and that was tested on the iPad (git diff --quiet). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
c296a204ae
|
feat(reader): ignore publisher font names by font category (#7298)
* feat(reader): ignore publisher font names by font category (#7276) Books often name fonts ahead of the generic family (`font-family: Palatino, Merriweather, serif`), so the reader's Serif, Sans-Serif and Monospace choices were never reached. Each font picker now has an "Ignore publisher font names" switch, off by default, like KOReader's option of the same name. A book font list that names serif, sans-serif or monospace is wrapped as `var(--book-serif, Palatino, ..., serif)`. `--book-serif` is defined only while that category's switch is on, so with it off the book's own list applies as before, and toggling takes effect without reloading the chapter. Linked stylesheets, `<style>` blocks, `style` attributes and the `font` shorthand are covered. The shorthand's family list is found word by word after the size and optional `/line-height`, with no backtracking regex. Lists without one of these generics (fantasy, cursive) are left alone, and Override Book Font still wins: the switches are disabled and the variables are not set while it is on. Verification: - New browser test publisher-fonts.browser.test.ts. Before the change, "swaps only the switched categories for the reader font, live" failed with: expected 'PublisherSerif, "Publisher Two", Read…' to match /^ReaderSerif,/. It passes with the change. Four style.test.ts assertions were updated to the wrapped text. - New style.test.ts cases for the shorthand. "stays linear on long runs of whitespace" took 15153 ms against a first single-regex version (expected < 200) and passes now. - pnpm test (15213 passed), pnpm test:browser (916 passed), pnpm lint. - dev-web: imported an EPUB with a linked stylesheet, a style block, a `font` shorthand, an inline style, code and a fantasy list. Computed fonts switched per category live, persisted across reload and were restored when switched off. Decorative text was unchanged. The switches were disabled under Override Book Font. The panel was checked in light, dark, e-ink and RTL. - Not run: desktop, Android and iOS app builds. Reported by Alsharad on GitHub. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(reader): keep quotes in encoded inline font names A `style` attribute with `font-family: "O'Neill", serif` had `"` swapped for `'`, so the wrapped list read `'O'Neill', serif`. That declaration is invalid and the paragraph fell back to the inherited font. Decode `"` to `"` for the CSS pass and encode it again when writing the `"`-quoted attribute back; such a value can't hold a raw `"`, so the round trip is exact. Verification: publisher-fonts.browser.test.ts gains an O'Neill paragraph. Before the fix, "keeps the book fonts while every switch is off" failed with: expected 'ReaderSerif, "LXGW WenKai GB Screen",…' to be '"O\'Neill", serif'. It passes after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
d1d1391c97
|
perf(reader): subscribe the vim command line to the store fields it uses (#7301)
VimCommandLine is mounted in every book cell. Destructuring useBookDataStore() and useReaderStore() subscribed it to the whole stores, so each cell re-rendered on every page turn even with no find open. Per-field selectors, as BooksGrid uses (CodeRabbit on #7282). Verified: e2e/tests/vim-find.spec.ts 14/14 (--repeat-each 2); pre-push format:check, lint and pnpm test. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
faabbf0fd3
|
fix(reader): set spread defaults (owner: only change the default for desktop and mobile) (#7299)
Default PDF/CBZ spread to auto in native desktop apps and single-page elsewhere. Pass the desktop-app flag into settings defaults and preserve saved global and per-book choices. Keep the existing View menu controls. Verified: 74 related tests pass; pnpm lint and git diff --check pass. The full unit suite previously passed with 15,219 tests. Native Linux CEF verification covered PDF single-page loading, live spread switching, CBZ two-page rendering, and reopening. Android/iOS devices were not exercised; platform defaults are covered by unit tests. Regression evidence: desktop-browser default test fails without the change (expected 'none', received 'auto'); app-service flag test fails without the context wiring (missing isDesktopApp: true). Reported by TOM-PIC on GitHub (#7283). Co-authored-by: Claude Code <noreply@anthropic.com> |
||
|
|
3e1af7fe88
|
fix(library): refresh external sources without a Readest login (#7297)
* fix(library): refresh external sources without a Readest login Route both library pull-to-refresh stages through the same handler. Allow configured external sources to refresh while signed out, run the existing file-sync, OPDS and Audiobookshelf checks, and await subscription checks. Keep the sign-in prompt when no external source is enabled. KOSync remains reader-scoped; enabling it suppresses the unrelated Readest login prompt. Verification: - 59 tests passed across useLibraryRefresh, useBooksSync-routing, usePullToRefresh, useLibraryFileSync, useOPDSSubscriptions and useABSSync. - The new regression tests failed with the original callback behavior: signed-out OPDS refresh called navigateToLogin in both stages, and signed-in refresh completed before the pending OPDS check resolved. - pnpm lint and git diff --check passed. - In an isolated iPad-sized Chromium session, a normal pull downloaded a newly published EPUB into the library while signed out; a deeper pull checked the feed again without navigating to login. - Native iOS/iPadOS verification was not run on this Linux host. The full unit suite is left to CI, following the related-tests-only preference. Reported by fake-name on GitHub. Fixes #7280 Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(library): retain login fallback for paused file sync Use the same active-backend gate as pullLibrary when deciding whether a signed-out refresh has an external file-sync source. An enabled backend paused by the hosted plan gate cannot refresh and must not suppress login. OPDS and other eligible sources continue to refresh independently. Verification: - New hosted/free-plan regressions failed in both pull stages before the fix: expected navigateToLogin to be called, but it was called zero times. - 63 tests passed across six related refresh and provider suites. - pnpm lint and git diff --check passed. - Rechecked both pull gestures in the isolated iPad-sized web app: a new OPDS EPUB downloaded into the library without login; a deeper pull checked the feed again. - Native iOS verification was not run on this Linux host. Co-Authored-By: Claude Code <noreply@anthropic.com> --------- Co-authored-by: Claude Code <noreply@anthropic.com> |
||
|
|
0535ac710a
|
feat(reader): vim-style find to start and extend a selection from the keyboard (#7282)
* feat(reader): search select * refactor(reader): moved select into view * feat: added tests for select logic * fix: does not select from search, only options * fix: test * fix: CFI validation * fix: code cleaning * Revert "fix: code cleaning" This reverts commit 00c9ec3b78e7f91828e28d9239f366cafddc4743. * Revert "Revert "fix: code cleaning"" This reverts commit 2f85d454de39d3f551594a2fe0eb3c146314cbfe. * Revert "fix: CFI validation" This reverts commit 9ed92a3d9e6be0707513ba873687d54ad7b59d70. * fix: cfi validation * fix: test pt2 * feat(reader): vim-style find to start and extend a selection from the keyboard A keyboard-only reader could act on a selection (Ctrl+H/U/N/D/T/R/C) and adjust it with Shift+Arrows (#4728), but couldn't start one without a mouse (#7281). Vim-style find fills that gap: - `/` opens a command line at the bottom of the book. Enter searches the whole book and selects the first match at or after the current page, wrapping to the first. The line shows the term and `[i/N]` until Esc. - `n` / `Shift+N` jump the selection to the next / previous match. - While a match is selected, h l w b e j k 0 $ ( ) { } extend its moving end and `o` swaps the ends, as in visual mode. The page turns when the moving end leaves it. `y` copies (also added to Copy Selection). - Esc clears the selection and ends it. The search stays live across Ctrl+H, so `/term`, Ctrl+H, `n`, Ctrl+H highlights match after match. None of these keys change meaning unless a find is live: the handlers sit ahead of page navigation and the Notebook in one shortcut listener and fall through otherwise. The sidebar search and Previous/Next Result are unchanged and keep using goTo(); vim find runs its own search so their highlights are left alone. A selection made by view.select(), and the keyboard extending it, opens the toolbar and never runs the instant quick action, until the next pointer press. Jumping to a match clears the last one's selection in another section under the guard the cross-page path uses, so the throttled popup dismiss can't close the new toolbar. Chromium quirks handled: `paragraph` steps keep the caret's x, and a forward selection won't extend back to a line or paragraph boundary, so `}` steps to paragraphboundary and `0`/`{` move a collapsed caret and re-extend. `w`/`e` skip spaces so they land the same with macOS and Windows word steps. This replaces the PR's first approach: the select() wrapper in types/view.ts and its test are removed (foliate's view.select() already selects), and the sidebar result click is back to goTo(). Text objects (iw/is/ip) were left out: a two-key sequence doesn't fit the shortcut config without bare s/p bindings. Verified: - e2e/tests/vim-find.spec.ts (7 tests): 28/28 with --repeat-each 4. Before the feature 5 of 6 failed (no find line); the sidebar test passed. Resetting the navigated mark after the first selection fails "a match never runs the instant quick action, nor does extending it" (Dictionary opens on `e`). Dropping the stale-selection clear fails "n and N step through matches" (the old match stays selected). - dev-web, Chromium: light, dark, e-ink, chrome shown (line sits above the footer); scrolled mode; `}` across a page turns the page; Ctrl+H, n, Ctrl+H made two highlights. - annotation.spec.ts + reading.spec.ts: passed except #6540's "keeps the note bubble on restyle", which also fails 3/3 on main under dev-web. - pnpm test: 1250 files, 15210 tests passed (shortcut tests updated for the new `n` / Shift+N defaults). pnpm lint, format:check: clean. - i18n: 5 new strings added and translated in all 34 locales; nothing else in the locale files changed. - Not run: Windows WebView2 and WebKit (macOS/iOS) word and boundary steps, Firefox web (no sentence/paragraph steps), Tauri builds. Reported by you-gao on GitHub Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Huang Xin <chrox.huang@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
e20fb3b52b
|
fix(bookorbit): let the web proxy run on Cloudflare Workers (#7296)
* fix(bookorbit): let the web proxy run on Cloudflare Workers Every /api/bookorbit request on web.readest.com answered 500, so BookOrbit could not connect on web at all, with or without Cloudflare Access service tokens. The proxy fetched with redirect: 'error', which the Workers runtime rejects before sending anything: "Invalid redirect value, must be one of "follow" or "manual"". Native apps call the server directly and were not affected. The proxy now fetches through publicFetch (redirect: 'manual' on Workers, a resolved-address check on Node, as the KOSync proxy does) and still refuses to follow a 3xx, so the redirect-based SSRF guard is kept. Verified: - bookorbit-ssrf.test.ts "forwards allowed requests on Cloudflare Workers" stubs fetch to reject redirect: 'error' like workerd; it fails on main with "expected 500 to be 200" and passes with the fix. A 302 to 169.254.169.254 is not followed. - pnpm preview (opennext on local workerd): an allowed request reached the upstream and its status was relayed (production returns the 500 above for the same request); custom headers and the /api/v1/koreader/plugin/version path arrived at an echo server; an http->https 301 is refused; a private address is still a 400. - pnpm test (15213 passed), pnpm lint. - Not run: a real BookOrbit server behind Cloudflare Access. Fixes #7291. Reported by shahram7 on GitHub. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(bookorbit): assert manual redirect mode and the forwarded Access secret Answers CodeRabbit's two nitpicks on #7296. bookorbit-ssrf.test.ts: 6 passed; pnpm lint and pnpm format:check clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
4148460195
|
chore(agent): update memories (#7295) | ||
|
|
ba94f098df
|
fix(reader): keep the sidebar button top-left on tablets, tidy the transparent-image row (#7294)
* fix(settings): render the transparent-image row like its neighbours
"Make White Image Backgrounds Transparent" was wrapped in its own
BoxedList card, so it showed a shaded box between the plain "Invert Image
In Dark Mode" and "Override Book Color" rows in the Color panel. Render it
as the same plain label row, keeping its description line and the PDF
disabled state.
Verification:
- New ThemePanel.image-rows.test.tsx failed before the fix on
`expect(row.closest('.card')).toBeNull()` ("expected <div …> to be
null") and passes with it.
- pnpm test: 1251 files passed, 4 skipped (15211 tests passed).
- pnpm lint passed.
- dev-web, reader Settings > Color: checked dark mode, light mode and
e-ink (data-eink) with no card and aligned with the rows next to it;
clicking the label still toggles the setting on and off.
- Not checked on an iPad or Windows device, or under RTL.
Reported by noideaforeal on GitHub (#7292).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(settings): shorten the transparent-image label (owner: remove the description and shorten the label for this option)
Rename "Make White Image Backgrounds Transparent" to "Transparent Image
Background" in the Color panel, View Options and the command palette, and
drop the row's description line so it reads like the one-line rows around
it. The command palette keeps "white" among its keywords.
Verification:
- ThemePanel.image-rows.test.tsx now asserts the row's whole text is the
short label; ViewMenu.test.tsx checks the renamed menu item. 18 tests
passed.
- pnpm test: 1251 files passed, 4 skipped (15211 tests passed).
- pnpm lint passed.
- dev-web, reader Settings > Color in dark mode: one-line row, aligned
with "Invert Image In Dark Mode" and "Override Book Color".
- Not checked on a device.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(reader): keep the sidebar toggle top-left on tablets in portrait
On a tablet held portrait the header dropped its sidebar toggle (#5634),
so "Go to Library" took the top-left spot where the toggle sits on
desktop, and readers moving between the two tapped it by mistake. Show
the toggle in the header on tablets in every orientation. Phones are
unchanged (the toggle stays hidden below `sm:`), and iPhone Duo keeps its
phone bars in every pose.
Verification:
- HeaderBar.test.tsx "is shown on tablet portrait" failed before the
change ("Unable to find an element with the text: sidebar-toggler")
and passes with it; a new iPhone Duo case pins the unchanged layout.
- pnpm test: 1250 files passed, 4 skipped (15211 tests passed).
- pnpm lint passed.
- pnpm test:browser HeaderBar.browser + SidebarTogglerAlignment.browser:
12 tests passed.
- Not checked on an iPad, Android tablet or iPhone Duo device.
Reported by noideaforeal on GitHub (#7292).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(view-menu): reject the PDF image toggle in either state
The PDF case queried the exact name "Transparent Image Background", but
MenuItem names a toggle "<label> - ON" or "<label> - OFF", so the query
could never match and the test passed even if the toggle rendered. Match
the label as a prefix.
Verification: rendering the PDF case as an EPUB now fails the test
(1 failed | 16 passed); restored, ViewMenu.test.tsx passes 17/17.
Raised by CodeRabbit on #7294.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
4000a85797
|
fix(koplugin): collect sync workers before KOReader exits (#7293)
* fix(koplugin): collect sync workers before KOReader exits
Exiting KOReader from inside a book quits about a second after the
close-time pushes fork their workers. UIManager:quit() empties the task
queue, so the polls that would collect those workers never run and the
workers keep going after KOReader is gone. The reporter's Kindle often
segfaulted at exit when that happened.
The sync client now keeps the pid of every forked worker (sync RPCs,
book and cover downloads) and wraps UIManager.quit: running workers get
up to 5 s to finish, then the rest are killed and reaped before the
original quit runs.
Verified:
- New syncclient specs: a worker that finishes in the grace period is
waited for, a stuck one is killed after 50 x 100 ms, and quit doesn't
wait with no workers. Without the change the first two fail
("Expected 3, passed 0" and "Expected 50, passed 0").
- pnpm test:lua (510 passed), pnpm lint:lua.
- Kindle Voyage, firmware 5.13.6, KOReader v2026.07.2-300 (no Turbo),
exiting from inside the book with auto sync on. origin/main: 2 of 5
exits left workers running after KOReader was gone (reparented to
init). This change: 4 of 4 exits logged "waiting for sync workers
before exit", then killed and reaped the 3 workers still stuck in TLS;
none outlived KOReader. No segfault in either build on this device, so
the crash itself was not reproduced.
- Not verified: a worker finishing within the grace period on a device
(every push on the test network timed out in TLS), and Android.
Fixes #6685. Reported by tramch on GitHub.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(koplugin): deliver finished worker results at exit and keep partial covers out of the cache
Review follow-up for #6685:
- The exit wait reaped a worker that finished inside the grace period
but never ran its poll, so a token refresh that completed there lost
its rotated refresh token. Sync RPC workers now register their poll
with trackWorker, and the exit wait runs it for every worker that has
finished. Workers that callbacks start then share the same 5 s budget.
- A cover worker killed at exit left a partial <hash>.png that the cover
cache treats as complete. The worker now writes <hash>.png.part and
renames it only after a 200; failures remove the .part.
Verified: two new specs fail without this change
("delivers the response of a worker that finishes while KOReader quits":
expected 1 reply, got 0; "keeps a cover under a temporary name until it
is complete": the file was at dst mid-transfer). pnpm test:lua (512
passed), pnpm lint:lua. Not run on the device: the Kindle could not
reach the Readest API at the time (curl timed out after 10 s).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(koplugin): give each cover download worker its own temporary file
Review follow-up for #6685. The manual Download Cover action bypasses
the automatic cover queue, so two workers can download the same cover
at once. With one shared <hash>.png.part, one worker could rename it
while the other was still writing, and the second then reported a
failure. Each worker now writes <hash>.png.<pid>.part.
Verified: "keeps a cover under a temporary name until it is complete"
fails without the change (no h1.png.123.part mid-transfer: expected
"file", got nil). pnpm test:lua (512 passed), pnpm lint:lua.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
6e2390fe5e
|
feat(metadata): search for book covers in app (#7290)
Add Google, Bing and DuckDuckGo image search from Edit Metadata, using the
book title and author. Allow device-local custom search engine templates.
Show the original engine page with explicit image selection, then require
app-owned confirmation before a native fetch so remote pages cannot silently
forge a cover selection. Stage the confirmed image through the existing
cover-save flow. Support desktop and mobile native browsers, with an external search
and file-import fallback on web.
Verification on origin/main
|
||
|
|
b58728c29a
|
feat(vocabulary): vocabulary builder and Learning/Mastered marks for Word Lens (#7284)
* feat(vocabulary): entry model, sentence extraction and merge Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(vocabulary): revive a word looked up after a delete on a stale device Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(vocabulary): local store, file persistence and backup Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(wordlens): hint Learning words and skip Mastered words Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(dictionary): Learning and Mastered chips, capture lookups to Vocabulary Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(sync): vocabulary table and sync route Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(sync): sync vocabulary across devices Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(vocabulary): export to Anki and CSV Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(vocabulary): hint sources from dictionaries and the AI context dictionary Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(vocabulary): vocabulary builder window Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore(i18n): vocabulary strings Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(vocabulary): resolve the sync endpoint on use, not at import Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(vocabulary): save the lookup's sentence from its own paragraph with spacing kept Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(vocabulary): take a dictionary hint from the first definition, not the entry header Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(vocabulary): save a hint on Enter inside the Dialog Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(wordlens): re-render hints after the selection clears, keeping the dictionary open Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(vocabulary): leave ruby hints out of saved sentences, dedupe a sentence across CFIs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(vocabulary): keep book text in its own direction under an RTL interface Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(vocabulary): a lookup never overrides a Learning or Mastered mark from another device A word first looked up on a device stamped modifiedAt with the current time, so its empty state beat a mark set elsewhere in the merge. Lookups now carry modifiedAt 0. Selections with no letters get no chips or entry. The migration moves to 032 (031 is taken on main). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(vocabulary): keep syncing past a bad row and cap saved sentences A rejected row failed the whole push, and the push's failure skipped the pull, so one bad word stopped vocabulary sync on that device. The server now skips malformed rows and reports them, the client clears them, and a failed push no longer prevents the pull. Sentences are cut to a window around the word and pushes go in batches of 50. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(vocabulary): rebuild from the server when the local word list is lost The pull cursor lives on the device apart from vocabulary.json. With the file missing or unreadable, the cursor still claimed everything was pulled, so the words never came back. Sync now starts over when the file held no words, trusts the cursor again after that full pull, and keeps a copy of an unreadable file before it is saved over. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(vocabulary): show typed hints as written; harden sentence capture and IME Enter A saved hint went through the pack gloss cleaner, which cut it at a comma or slash. A range the sentence reader couldn't handle could throw inside the annotator; it now falls back to the selected text. WebKit's IME-confirming Enter (keyCode 229) no longer saves the hint early. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(api): keep /api/sync/vocabulary off language detection and DOMPurify The vocabulary route syncs on every book open, so it joins the hot routes that #7274 keeps light. It passes as written: the route imports only the Supabase client, access check, CORS and the vocabulary entry/wire modules. Checked the case can fail: with `import '@/utils/sanitize'` added to the route it fails with `expected [ 'dompurify' ] to deeply equal []`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(vocabulary): describe lookup capture without naming another reader Comment-only change; no behavior to test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(vocabulary): drop the lookbehind from export bolding; guard CSV cells against formulas CodeRabbit on #7284. boldWord used (?<!…), which WebKit before 16.4 rejects and which failed the build's check:lookbehind-regex (build_web_app). It now consumes the boundary before the word in a capture group. CSV text cells that start with = + - @ tab or CR get a leading apostrophe, so a spreadsheet won't run book text or a hint as a formula. Tests that fail without it (export.test.ts): 'bolds whole words without lookbehind support' (RegExp throwing on lookbehind, as old WebKit does) and 'stops spreadsheet apps from running a cell as a formula'. pnpm build-web + pnpm check:all: no lookbehind in chunks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(vocabulary): cap a saved sentence when the selection itself is over the limit CodeRabbit on #7284. With a selection of 300+ characters the window half was 0 and pre.slice(-0) kept the whole text before it. Such a selection is now cut to the limit on its own. Test that fails without it (entry.test.ts): 'caps a selection longer than the limit' (expected 414 to be less than or equal to 302). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(vocabulary): keep unpushed words pending when the word file loads CodeRabbit on #7284. load() merged the file into memory with mergeEntries, which drops the dirty flag, so a word restored from a backup or looked up before the file loaded was never pushed. Either side being dirty now keeps the merged word dirty, as applyRemote already does. Test that fails without it (vocabulary-store.test.ts): 'keeps unpushed changes pending when the file loads over them' (expected undefined to be true). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(api): keep database errors out of /api/sync/vocabulary responses CodeRabbit on #7284. The route returned PostgREST error messages to the client; it now logs them and returns a fixed message. A since_ts that isn't a timestamp gets a 400 before any query. Tests that fail without it (sync-vocabulary.test.ts): 'rejects a since_ts that is not a timestamp before querying' (expected 200 to be 400) and the two 'keeps database error details out of …' cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(vocabulary): run one more sync when one is asked for mid-sync CodeRabbit on #7284. A debounced sync that fired while a sync was running got the running promise back, so words changed after its push snapshot waited for the next change. It now sets a flag and the running sync makes one more pass. Fake timers in the sync tests are restored in afterEach. Test that fails without it (vocabularySync.test.ts): 'runs once more when a sync is asked for while one is running' (pull called 1 time, expected 2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(wordlens): wait to draw hints when a selection starts while the pack loads CodeRabbit on #7284. whenSelectionClears guarded only the start of a refresh; a selection made while the gloss index or OpenCC loaded still had hints drawn under it, which can close the dictionary popup. The draw step now goes through whenSelectionClears and is dropped if a newer refresh ran. Tests (wordlens-section.test.ts): 'waits to draw hints when a selection starts while the pack loads' fails without it (expected [ '尼莫' ] to deeply equal []); 'drops a waiting draw once a newer refresh has run' guards the generation check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(reader): give the Learning/Mastered chips a 32px hit target and focus ring CodeRabbit on #7284, per DESIGN.md (32px minimum hit target, the canonical focus-visible ring). Styling only. Checked on dev-web in Chrome: both chips measure 32px high in the dictionary popup, and Learning toggles on and off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(vocabulary): drop the context when a selection leaves no room for it CodeRabbit on #7284. A 299-character selection skipped the over-limit cut, but the window half was still 0, and pre.slice(-0) kept the whole prefix. Context is now dropped whenever the half window is 0. Test that fails without it (entry.test.ts): 'caps the context when the selection leaves no room for it' (expected 701 to be less than or equal to 302). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(vocabulary): break merge ties on the display word too CodeRabbit on #7284. Two lookup-only copies of a word (same modifiedAt, state and hint) could keep "Serendipity" or "serendipity" depending on argument order, so devices and the server could show different forms. The tie key now ends with the display word. Test that fails without it (entry.test.ts): 'keeps the same display word whatever the argument order' (expected 'Serendipity' to be 'serendipity'). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(vocabulary): save pulled words to the data file before moving the cursor CodeRabbit on #7284. The pull saved its cursor right after applying a page, while the file write waited for the 500 ms save delay; quitting in between left the cursor past rows the file never got, and later pulls start from the cursor. The store gains flush(), and the pull awaits it before each cursor write. Test that fails without it (vocabularySync.test.ts): 'writes the pulled words to the data file before moving the cursor' (expected [ [] ] to deeply equal [ [ 'en:a' ] ]). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(wordlens): defer a whole hint refresh while text is selected CodeRabbit on #7284. The section-load refresh (and any other caller) cleared hints before checking the selection, which unwraps the <ruby> under it and can close the dictionary popup. refreshSectionGlosses now defers itself until the selection clears; its generation bump drops any older pending draw. Test that fails without it (wordlens-section.test.ts): 'leaves drawn hints alone until a live selection clears' (expected [] to deeply equal ['尼莫']). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(reader): save a new sentence for the same word while the dictionary stays open CodeRabbit on #7284. Lookup capture ran only when the word changed, so selecting the same word in another sentence with the popup still mounted saved nothing. It now also runs when the occurrence's book or sentence changes; repeat sentences are still deduplicated by the store. Test that fails without it (DictionaryVocabularyChips.test.tsx): 'records a new sentence for the same word while the popup stays open'. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(vocabulary): write the word file one save at a time, and never mid-load CodeRabbit on #7284: flush() cleared the save timer but not a save already writing, so that older write could land over the list flush() had just saved, after the pull had moved its cursor. Writes now run through one chain, each saving the list as it is when it starts. The same race reached backup restore, which wrote the file directly while a delayed save could still land over it. Backup and restore now flush first. A save that ran while the file was still loading wrote the partial list in memory over the file; saves now wait until it has loaded, and load saves the merged list when words were recorded before it finished. Tests that fail without it: - vocabulary-store.test.ts 'flush saves the newest list even while a delayed save is still writing' (expected [ 'en:first' ] to include 'en:second') - vocabulary-store.test.ts 'saves a word looked up while the file is loading, without dropping the file': without the loaded check, expected [ 'en:new' ] to deeply equal [ 'en:new', 'en:old' ]; without the save after load, expected [ 'en:old' ] to deeply equal [ 'en:new', 'en:old' ] - backup-vocabulary.test.ts 'includes a word saved moments ago…' (expected [] to include 'en:fresh') and 'keeps restored words when an earlier save finishes during the restore' (restored word overwritten) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(vocabulary): sync the restore race test on flush instead of a delay CodeRabbit on #7284: a fixed 50 ms wait didn't show the restore was blocked on the stalled save, so the test could pass or fail on timing. It now releases the stalled save only once the restore has called flush(), and always releases it so a failure can't stall later tests. Checked it still catches the bug: with restore's flush() removed it fails with 'expected "flush" to be called at least once'; with it, 3 passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
8bd96ef9b9
|
feat(reader): add a straight-line reading ruler (#7288)
* feat(reader): add a straight-line reading ruler Add a Line style alongside the existing Band ruler, with custom color and 1–8 px thickness. Keep surrounding text undimmed and reuse line snapping, page navigation, pointer dragging and settings persistence. Use an opaque theme foreground for monochrome e-ink. Verification: - New rendering and settings tests failed before implementation because the straight guide and style controls were absent. - Edge-case tests failed before fixes: scrolled style changes kept 34 px geometry, large text was capped at 48 px, and boundary guides extended to 1002/802 px outside 1000/800 px viewports. - Focused suites: 83 tests passed across 5 files. - Full unit suite: 14997 passed, 16 skipped; 1233 files passed, 4 skipped. - TypeScript/Biome lint passed (one info in unrelated nativePageTurn.ts). - Formatting and git diff --check passed. - Browser and Linux CEF checks covered navigation, dragging, persistence, light/dark/e-ink/RTL, phone/tablet layouts, scrolling, spreads, PDF and vertical writing. A real touch gesture moved the guide in mobile Chromium. - Native Android/iOS devices were not exercised. Requested by localcatgirl-dev on GitHub (#6705). Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(reader): refresh fixed-layout ruler size when switching style Discard the previous ruler size when changing Band/Line style so PDF and other fixed-layout books immediately use the current style's geometry. Verification: - Both new PDF style-switch tests failed before the fix: expected 56 to be 28 for Band to Line, and expected 28 to be 56 for Line to Band. - Focused ruler/settings/defaults/persistence suites: 85 tests passed. Co-Authored-By: Claude Code <noreply@anthropic.com> --------- Co-authored-by: Claude Code <noreply@anthropic.com> |
||
|
|
372082c76d
|
fix(sync): support provider downloads and generic transfer history (#7289)
Allow Download All to use active file-sync providers before Readest Cloud, and record selected downloads and automatic provider file operations in Cloud File Transfers. Show provider names, file names, progress and errors; persist observed history without scheduling it as executable queue work. Reuse queued primary book rows and expose the panel while signed out. Verification: pnpm test --run passed 1,233 suites and 15,018 tests (4 suites and 16 tests skipped). pnpm lint, changed-file Biome format checks and git diff --check passed. Before implementation, provider Download All regressions failed because the action was absent, queued provider downloads never invoked the provider runner, and provider-log tests expected history entries but received an empty array. Actual web app: authenticated loopback WebDAV bulk/selected downloads, automatic library/config sync, injected failure, persisted clear actions, and dark/e-ink/RTL/phone layouts passed in fresh browser contexts. Exact saved bytes and downloadedAt were checked; one binary GET per book and no duplicate primary rows. Live other providers and native device safe areas were not exercised. Provider routing is covered by unit tests. Reported by lvejun123 on GitHub (#6715). Co-authored-by: Claude Code <noreply@anthropic.com> |
||
|
|
617db1aa3c
|
fix(dictionary): stream context dictionary responses (#7285)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
Publish Docker image / build (linux/amd64, ubuntu-latest) (push) Waiting to run
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm) (push) Waiting to run
Publish Docker image / merge (push) Blocked by required conditions
Build with Nix / tests (push) Waiting to run
PR checks / test_web_app (2) (push) Waiting to run
PR checks / nix_flake_check (push) Waiting to run
PR checks / rust_lint (push) Waiting to run
PR checks / koplugin_rust_lint (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
PR checks / test_web_app (1) (push) Waiting to run
PR checks / test_web_browser (push) Waiting to run
PR checks / test_extensions (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
* fix(dictionary): stream context dictionary responses Request SSE from custom OpenAI-compatible endpoints and reveal structured entries or sanitized Markdown while generation is still running. Reset the 60-second timeout on stream activity, including reasoning, and preserve cancellation, final validation, cache integrity, and thinking-option fallback. Verification on current origin/main: - New SSE regression fails without the change: expected undefined to be true for the request's stream flag; passes with the change. - Six affected test files: 88 tests passed. - Full unit suite: 1233 files passed, 4 skipped; 14992 tests passed, 16 skipped. - pnpm lint, changed-file formatting, and git diff --check passed. - Google Chrome with local Ollama qwen3 streamed and completed both built-in JSON and custom Markdown; partial content appeared before completion. - Controlled SSE browser checks covered cancellation and phone dark/e-ink/RTL. - Gemma3 streamed Markdown successfully but returned malformed final JSON, which retained the existing visible validation error. - Native iOS and Tauri were not exercised. Fixes #7279 Reported by noideaforeal on GitHub Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(dictionary): preserve streamed provider error messages Normalize structured SSE errors into Error instances so the dictionary shows the provider's explanation instead of [object Object]. Preserve existing Error instances and their HTTP status for the thinking-option fallback. Verification: - New regression fails before the fix: expected the structured provider error to be an instance of Error; passes after normalization and checks the message. - Six affected suites: 89 tests passed. - git diff --check passed. The push hook runs lint and the full unit suite. Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(dictionary): clear partial entries when streaming fails Remove incomplete context dictionary content before displaying a stream, timeout, or final-validation failure. Keep the aborted-request guard so an older lookup cannot clear the next lookup's container. Verification: - Three new regression cases fail before the change because the partial definition remains visible after an error, and pass with the change. - Added cancellation regression preserves the next lookup's content. - Three affected suites: 55 tests passed; git diff --check passed. - The required push hook runs formatting, lint, and the full unit suite. Co-Authored-By: Claude Code <noreply@anthropic.com> --------- Co-authored-by: Claude Code <noreply@anthropic.com> |
||
|
|
7a0e98f533
|
fix(sync): sign bucket-root listings with a trailing slash (#7278)
* fix(sync): sign bucket-root listings with a trailing slash
MinIO canonicalizes a bucket-only path with a trailing slash when it
verifies SigV4 (`GET /bucket` becomes `/bucket/`), while aws4fetch signs
the literal pathname. Listing the bucket root therefore failed with
SignatureDoesNotMatch, surfacing as an authentication error in the S3
settings probe even though every object operation worked.
Request the bucket root as `/<bucket>/` so the signed path and the
canonicalized path agree. Object paths (`/<bucket>/<key>`) are
canonicalized verbatim and are unaffected; AWS S3 and R2 accept the
trailing-slash form as well.
Add regression tests asserting that the root listing path ends with a
slash and matches the path that was signed, plus the same for the
deleteDir prefix scan.
* fix(sync): delete ordinary keys when scanning the S3 root
Use an empty prefix for deleteDir('/') so ordinary bucket keys are included.
Replace the empty-root regression fixture with a populated mock bucket that
filters on the requested prefix and removes keys only on DELETE.
Verification:
- Before the fix, the root-deletion test fails: expected [] but both
library.json and Readest/books/h1/config.json remain.
- After the fix, all 18 S3 provider tests pass.
- Sync tests: 965 passed across 77 files.
- Full unit suite: 12913 passed, 16 skipped across 1095 passing files.
- TypeScript and Biome lint pass; Biome format checks 2710 files.
- Checks run in a credential-free sandbox on the original contributor head.
- Not run: live MinIO/app verification. Both image registries rejected the
pull, and the upstream binary endpoint returned HTTP 410.
Reported by gilgamesh-tkh on GitHub (#7277).
Co-Authored-By: Claude Code <noreply@anthropic.com>
---------
Co-authored-by: Agents Bot <agents@readest.dev>
Co-authored-by: Huang Xin <chrox.huang@gmail.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
|
||
|
|
746a13eb0d
|
feat(translator): add a Thinking setting to custom LLM translators, fix translator field sync (#7275)
* feat(translator): add a Thinking setting to custom LLM translators (#6865) Custom OpenAI-compatible translators get a Thinking select: Default leaves the request unchanged, Off asks the service to skip the model's reasoning. Each service spells that differently, so Off sends the field for the base URL's host: - OpenRouter: reasoning.effort = none - DeepSeek, Zhipu (bigmodel.cn, z.ai), Volcengine Ark: thinking.type = disabled - SiliconFlow, DashScope: enable_thinking = false - anything else (OpenAI, Gemini, Ollama, LM Studio): reasoning_effort = none A model that can't turn thinking off (Gemini 3, GPT-5 before 5.1, models that always reason, gpt-4.x) answers 400 to the field. The request is then retried once without it, and that base URL + model stops sending it, so Off never breaks a translator that worked under Default. The AI context dictionary shares the same request helper, so it follows the setting too. The setting syncs with the translator. Verified: - thinking.test.ts runs the real AI SDK with a stubbed fetch and checks the request body per host, Default sending nothing, and the 400 retry. Before the change, the 9 host cases and the retry case failed, for example "expected { …(2) } to match object { reasoning_effort: 'none' }". - customTranslator.test.ts round-trips `thinking`. With the adapter change reverted, 2 tests fail on the missing "thinking": "off". - The real translator ran against a local OpenAI-compatible mock over HTTP. The server received {reasoning_effort: "none"} for Off, no field for Default, and for a model that answers 400 one request with the field, the retry without it, and the next translation without it. - The editor was rendered in Chromium (vitest browser) at 360 px and 420 px in light, dark, e-ink and RTL. - pnpm test: 1231 files / 14975 tests passed. pnpm lint clean (one existing info in an unrelated file). Not run: a request to a real hosted service (no API keys on this machine), and the editor inside dev-web (Custom Translators needs Premium and no account was signed in). The per-host fields come from each service's docs. Requested by gixxub on GitHub. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(translator): sync Thinking back to Default, test the context dictionary path Answers the CodeRabbit review on #7275. - pack always sends `thinking` ('default' when unset). Replica fields merge per key, so leaving it out kept a peer's old 'off' after the user switched back to Default. New test "switching Thinking back to Default clears Off on other devices" failed before with "expected 'off' to be undefined". - thinking.test.ts gains "applies to the AI context dictionary too", which calls lookupInContext with the real SDK. With main's contextDictionary.ts it fails with "expected { model: 'qwen3', messages: [ …(2) ] } to match object { enable_thinking: false }". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sync): sync re-enabling a custom translator and clearing its temperature The custom translator adapter left a field out of the push when it was unset. Replica fields merge per key on the server, so the old value stayed for other devices: a translator re-enabled here stayed disabled there, and a cleared Temperature kept the old number. pack now always sends `disabled` (false when unset) and `temperature` (null when unset); unpack already reads both back as unset, as do older clients. The API key is left as it is: a device holding no local key (one that pulled while its passphrase was locked) would push an empty key on any edit and wipe it for every device. Verified: "clearing %s reaches other devices" in customTranslator.test.ts runs thinking, disabled and temperature through a per-key merge. Before this change the disabled and temperature cases failed with 'expected { id: 'rid', …(10) } to not have property "disabled"' (and "temperature"); they pass now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
42c81714b4
|
perf(api): stop hot sync routes loading the TTS engine and DOMPurify (#7274)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
Publish Docker image / build (linux/amd64, ubuntu-latest) (push) Waiting to run
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm) (push) Waiting to run
Publish Docker image / merge (push) Blocked by required conditions
Build with Nix / tests (push) Waiting to run
PR checks / nix_flake_check (push) Waiting to run
PR checks / rust_lint (push) Waiting to run
PR checks / koplugin_rust_lint (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
PR checks / test_web_app (1) (push) Waiting to run
PR checks / test_web_app (2) (push) Waiting to run
PR checks / test_web_browser (push) Waiting to run
PR checks / test_extensions (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
Most of readest-web's CPU goes to cold Worker isolates, and a cold isolate
pays for the full module graph of the route it serves. The three hottest
routes (/api/sync, /api/sync/replicas, /api/send/inbox/claim) only check a
token and read or write rows, yet each loaded 65-80 local modules:
- services/constants.ts imported two TTS gap numbers from TTSController and
EdgeTTSClient, which pulled the whole TTS engine (controller, Edge client,
media overlays, audio players, zip.js, foliate-js, Tauri plugins) and,
through it, the language detection (franc-min, iso-639-2/3).
- utils/access.ts took the localStorage daily-usage helper from
translators/utils.ts, which imports utils/lang.ts (language detection).
- utils/misc.ts imported utils/lang.ts for isCaselessUILang.
- utils/transform.ts took a NUL-stripping helper from utils/sanitize.ts,
which loads DOMPurify.
- bookshelves/fields.ts took getBookPageCount from utils/book.ts, which loads
the document parsers and language detection.
Each helper now lives in, or next to, a module without those imports: the
gap defaults in tts/gap.ts (re-exported from their old homes), the daily
usage in translators/dailyUsage.ts, isCaselessUILang in utils/lang.ts,
sanitizeString in transform.ts, getBookPageCount in bookshelves/fields.ts
(re-exported from utils/book.ts). BufferedTTSClient now imports TTSController
as a type only, which removes a runtime cycle the old constants.ts import
order had been hiding. Static import graphs, by esbuild metafile: /api/sync
70 -> 19 local modules, /api/sync/replicas 80 -> 20, /api/send/inbox/claim
65 -> 14, none loading franc, iso-639, DOMPurify or any TTS module.
Test that fails without the change: sync-route-light-imports.test.ts loads
each route with the four packages trapped. On main it fails for all three
routes ("expected [ 'dompurify', 'franc-min', ... ] to deeply equal []" for
/api/sync; the language packages for the other two); with the change it
passes.
tts-book-cache-store.test.ts now imports @/utils/access statically: it only
reached that mocked module through constants.ts -> TTSController, and once
that path was gone the dynamically imported sync client bound to the real
module before the mock's importOriginal factory finished.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
bd418a575a
|
perf(web): run the web Worker near Supabase with Smart Placement (#7273)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
Publish Docker image / build (linux/amd64, ubuntu-latest) (push) Waiting to run
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm) (push) Waiting to run
Publish Docker image / merge (push) Blocked by required conditions
Build with Nix / tests (push) Waiting to run
PR checks / koplugin_rust_lint (push) Waiting to run
PR checks / nix_flake_check (push) Waiting to run
PR checks / rust_lint (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
PR checks / test_web_app (1) (push) Waiting to run
PR checks / test_web_app (2) (push) Waiting to run
PR checks / test_web_browser (push) Waiting to run
PR checks / test_extensions (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
Most of readest-web's CPU bill comes from cold isolates, not steady requests. Over 2026-10-27..11-02 the median request used ~9 ms of CPU while the p99 sat near 1 s; in a live tail sample the 2.5% of requests costing 1-2 s each (tiny bodies, CPU ~= wall time, every route) carried ~73% of all CPU. A local profile of the built worker shows the same mechanism: a cold POST /api/sync costs ~120 ms of CPU against ~6 ms warm, almost all of it module initialisation. Smart Placement runs the Worker near its back end instead of in every location, so traffic lands on fewer isolates and they stay warm. API routes make 1-3 round trips to Supabase in us-east-1, so readers far from it should also see faster sync responses. Static assets are still served from the nearest location, and the cron `scheduled()` handler is not placed. How it was checked: config only, no behaviour to unit-test. wrangler.toml parses with the new [placement] table. Effect to be measured after deploy with the GraphQL workersInvocationsAdaptive query (CPU per request, cpuTimeP99, wallTimeP50) against the 7-day baseline above; revert by deleting the [placement] table. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
263d76cb14
|
feat(android): choose the system dictionary lookup app (#4937) (#7272)
* feat(android): choose the system dictionary lookup app (#4937) Add System Dictionary > Lookup App on Android. It lists every app that handles ACTION_PROCESS_TEXT, browsers left out, plus "Ask Every Time". The chosen app gets every lookup directly. Before, a remembered app counted only when a browser was among the handlers and two or more dictionaries remained, so on ROMs where a search app registers the intent but doesn't answer the https browser probe (Baidu on HyperOS), lookups always fell through to the system chooser. The picker replaces the System Lookup App reset row from #4568. That row could never appear: get_lookup_dictionary and clear_lookup_dictionary had no Rust commands, so Tauri forwarded them as getLookupDictionary and the plugin answered "No command getLookupDictionary found" (seen on 0.12.16). The new get_lookup_apps and set_lookup_app commands are wired through commands.rs, mobile.rs, desktop.rs and lib.rs. Test that fails without the change: LookupDispatchTest noBrowserPresent_chosenApp_launchesChosenDirectly failed with "expected:<DispatchExplicit(handler=LookupHandler(packageName=org.goldendict.android, ...))> but was:<LookupDispatch$DispatchImplicit>"; 9/9 pass with it. Verified on origin/main |
||
|
|
62272df36c
|
feat(reader): show background textures in footnote popups (#7268)
* feat(reader): show background textures in footnote popups Reuse the reader texture beneath footnote content in an isolated stacking context, preserving backgrounds authored by the book. Cover EPUB and synthesized data-attribute notes without changing other popup surfaces. Verification: - New browser regression cases fail without the change: expected 'none' to contain '/images/paper-texture.png' (5 failures). - Related Chromium browser suites: 21 tests passed. Final theme-identifier check: all 10 layout/background tests passed. - Full unit suite: 14,924 passed, 16 skipped (1,228 files passed). - pnpm lint, changed-file formatting, and git diff --check passed. - Linux Tauri/CEF: imported a sample EPUB, selected Paper in settings, opened plain, colored, and patterned notes, and inspected screenshots. Plain notes show texture; authored fills and gradients paint above it. - Not exercised on physical e-ink, Android, iOS, macOS, or Windows devices. Closes #6841. Reported by noideaforeal on GitHub. Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(reader): retain footnote textures when scrolling and in e-ink mode Scroll the note inside the stationary texture surface. Omit only the app's e-ink body fill for textured footnote documents, preserving authored body backgrounds and the main reader's existing fill. Verification: - Before the fix, browser regressions fail in both e-ink cases (opaque body instead of transparent) and on long-note scrolling (content scrollTop 0 instead of greater than its viewport height). - Related Chromium browser suites: 24 passed. - Related unit suites: 28 passed. - pnpm lint, changed-file formatting, and git diff --check passed. - Linux Tauri/CEF with E-Ink Mode enabled: plain, blue, and patterned EPUB notes retain layering; a synthesized note scrolled 5309px while the texture surface stayed at scrollTop 0. Screenshots inspected. - Not exercised on physical e-ink, Android, iOS, macOS, or Windows. Reported by noideaforeal on GitHub. Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(reader): texture footnote arrows (owner: consistent color) Apply the popup texture to its inner arrow with the same opacity, size and blend mode, clipping it for all four directions. Other popup arrows retain their existing appearance, including the e-ink border and resting lifecycle. Keep authored body foregrounds paired with their backgrounds in textured notes. Allow Foliate to paint its extracted body background on the note's view surface; Override Book Color still clears the fill for the texture. Verification: - New arrow browser cases fail without the change: 16 failures, background image none instead of the popup texture. The unrelated-popup case passes. - Body color regressions fail without the change: dark text replaces white authored text, or a black fill remains under overridden dark text. - Related Chromium suites: 47 passed (directions, light/dark, e-ink, texture removal, other popup surfaces, footnote layout, overflow and stacking). - Related popup/footnote/texture unit suites: 28 passed. - pnpm lint and git diff --check passed. Formatting checked on changed files. - Linux Tauri/CEF: inspected textured arrow screenshot; verified authored white-on-black view surface with Override Book Color off and transparent surface with dark text when on, with E-Ink Mode enabled. - Not exercised on physical e-ink, Android, iOS, macOS, or Windows devices. Reported by noideaforeal on GitHub. Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(reader): keep textured footnote pbg fills transparent Exclude textured footnotes with Override Book Color enabled from the later dark-mode body.pbg fill. Preserve other pbg behavior. Add real Foliate paginator coverage that inspects its extracted view surface for light/dark override states and authored opaque backgrounds. Verification: the real-renderer dark override regression fails before the fix with an opaque fill instead of rgba(0, 0, 0, 0). All 53 related browser tests, pnpm lint, formatting and git diff --check pass. This edge case was verified in Chromium with the real renderer; no additional native/device launch was run for this one-line guard. Reported by noideaforeal on GitHub. Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(reader): preserve authored pbg fills in textured footnotes Exclude textured footnotes from the forced dark-mode pbg fill in both color-override states. Run the real renderer tests with pbg in both states. Verification: before the change, the dark non-override real-renderer test fails with rgb(255, 255, 255) instead of the authored rgb(0, 0, 0). All 53 related Chromium browser tests, pnpm lint, formatting and git diff --check pass. No additional native/device launch was run for this guard. Reported by noideaforeal on GitHub. Co-Authored-By: Claude Code <noreply@anthropic.com> --------- Co-authored-by: Claude Code <noreply@anthropic.com> |
||
|
|
ab8025cb4c
|
feat(reader): make white image backgrounds transparent (#7270)
* feat(reader): make white image backgrounds transparent
Add an opt-in image transparency setting to Theme settings and View Options.
Remove pixels with all RGB channels at least 245 while preserving other
colors and existing alpha. Apply it before optional dark-mode inversion,
cover SVG-wrapped bitmaps and fixed-layout images, and preserve the filter
in the image viewer. Leave PDF page canvases unchanged.
Verified on origin/main at
|
||
|
|
d5d5cbdb03
|
fix(library): ignore leading English articles in title sorting (#7271)
Skip a leading A, An or The when comparing book titles, including primary and secondary sorting, grouped shelves, previews, widgets and search. Preserve displayed titles, numeric collation and group-name sorting. Reported by Hyzian on GitHub (#7057). The default behavior was requested explicitly during implementation. Verification: - New title-articles and library/search integration tests failed before the change: A Tale sorted before Dune instead of after The Great Gatsby. - Full unit suite: 1224 files passed, 4 skipped; 14868 tests passed, 16 skipped. - Related suites: 417 tests passed; final focused verification: 176 passed. - pnpm lint, changed-file Biome formatting and git diff --check passed. - Chromium: imported EPUBs, default and descending sort, reload persistence, search, and desktop/phone menu without an article toggle; no page errors. - Native Tauri and mobile builds were not exercised. Co-authored-by: Claude Code <noreply@anthropic.com> |
||
|
|
74e770e0c4
|
feat(ios): add fullscreen system dictionary setting (#7269)
* feat(ios): add fullscreen system dictionary setting
Add System Dictionary > Fullscreen on native iOS, retaining the compact
default. Persist the preference, preserve edits during asynchronous
dictionary hydration, and forward the option through the mobile bridge.
Use an opaque UIKit container so fullscreen definitions remain readable
under the app's light and dark appearances.
Regression evidence: the pending-load store tests failed before the
hydration fix with "expected false to be true" and "expected true to be
false". Both now pass, alongside save/reload and iOS-only dispatch tests. The
loading-guard UI test also failed with "expected false to be true" before
disabling the switch until hydration completes.
Verified on origin/main
|
||
|
|
1796037808
|
test(reader): handle cancelled paginator previews in browser tests (#7267)
Race paused capture readiness against preview completion and retry completed pre-capture cancellations within a bounded wait. Reuse the helper in the three interruption tests and release paused snapshots during cleanup. Add Chromium regressions for an immediate null preview and a render during the initial preview paint frames. Both failed before the fix with: "cancelled preview must not leave capture readiness pending: expected null not to be null". Both pass with the fix. Verified: unit suite 14,911 passed / 16 skipped; browser suite 875 passed / 1 skipped; paginator browser file 35 passed; pnpm lint; Biome formatting; git diff --check. This is a test-only change with no app UI behavior change. Reported by chrox on GitHub (#7266). Co-authored-by: Claude Code <noreply@anthropic.com> |
||
|
|
ee1a955039
|
fix(ios): decode imported file URL basenames once (#7263)
Keep file URLs encoded through both Open With entrypoints. In openFile, reuse the URL basename helper to decode the iOS filename once and use that same name for the temporary copy. Preserve the original URL for native copying. This keeps reserved characters and literal percent sequences intact in originalFilename and prevents URI malformed errors for percent filenames. Android provider and desktop filename handling are unchanged. Verified: ten regressions failed before the fix across cold-start intent parsing, live URL ingress and native file opening. Failures included encoded # and ? in File.name, literal % throwing URIError, and a second decode changing the temporary basename. All 180 related tests pass, including import metadata, PDF title/provenance, conversion and filename checksum cases. TypeScript, Biome lint, formatting and whitespace checks pass; full suite runs in pre-push. Not run on iOS: this Linux host has no Xcode, simulator or attached iOS runtime. Development servers remain stopped after host memory pressure. Found during review of #7253; tracked in #7257. Co-authored-by: Claude Code <noreply@anthropic.com> |
||
|
|
0c4b602108
|
fix(account): require explicit confirmation before deleting account (#7258)
* fix(account): require explicit confirmation before deleting account Show the signed-in email and current plan in the account deletion dialog, warn about paid plans and purchases (including customization-only unlocks), and require exact DELETE entry before enabling permanent deletion. Clear confirmation when the dialog closes or the account changes, and keep the Delete All Books flow independent. Verification: nine account-actions regression tests pass. With the original component restored, the account identity assertion fails because the email is absent and the typed-confirmation assertion fails because deletion is enabled immediately. Restoring the fix makes all nine tests pass. Full unit suite: 1,224 files and 14,866 tests passed; four files and 16 tests skipped. pnpm lint and changed-file Biome formatting checks passed. Exercised the actual web app and Linux CEF runtime with synthetic sessions and intercepted deletion requests. Checked narrow and short viewports, long email addresses, dark mode, RTL and e-ink. Native Android and iOS not exercised. Reported by noideaforeal on GitHub (#7251). Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(account): contain keyboard focus in deletion confirmation Focus the first dialog control on mount, wrap Tab and Shift+Tab around enabled controls, redirect outside focus into the dialog, and restore the previous focus on close. Verification: the two new focus-entry and Tab-wrapping regression tests fail without the change. All 12 account-actions tests pass with it. pnpm lint passed. Actual browser keyboard navigation passed across six scenarios covering desktop, narrow and short viewports, long email, dark mode, RTL and e-ink, using intercepted deletion requests. Native Android and iOS not exercised. Full suite runs in the pre-push hook. Addresses CodeRabbit review on #7258. Original report by noideaforeal on GitHub (#7251). Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(account): refresh entitlements after restoring purchases Refresh the auth session after purchase verification so the account deletion confirmation includes benefits restored during the current session. Verification: the new profile-page regression fails without the change (expected refresh once, got zero), then passes with it. All 13 confirmation tests and pnpm lint pass. The native Android/iOS store-restore flow was not exercised. The pre-push hook runs formatting, lint and the full unit suite. Reported by noideaforeal on GitHub (#7251). Addresses the follow-up review on #7258. Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(account): report session refresh failure after restore Return a success flag from auth refresh and use the existing restore error message when verified entitlements cannot be refreshed. Existing callers that ignore the refresh result retain their behavior. Verification: five new outcome assertions fail without this change (refresh returns undefined and restore incorrectly reports success), then pass with it. All 21 related auth and account confirmation tests and pnpm lint pass. Native Android/iOS purchase restoration was not exercised. The pre-push hook runs formatting, lint and the full unit suite. Reported by noideaforeal on GitHub (#7251). Addresses review on #7258. Co-Authored-By: Claude Code <noreply@anthropic.com> --------- Co-authored-by: Claude Code <noreply@anthropic.com> |
||
|
|
f004fa39fe
|
feat(library): add searchable history dropdown (#7261)
* feat(library): add searchable history dropdown Show recent book and full-text searches below the library search field, with per-item removal and Clear All. Reuse BoxedList styling, preserve legacy full-text history, and translate the new labels in all locales. Apply selections immediately, including reselecting a query while its clear action is still waiting for the debounced URL update. Verification: - pnpm test --run: 1224 files passed, 4 skipped; 14863 tests passed, 16 skipped. Final related run: 4 files and 13 tests passed. - Library header Chromium tests: 18 passed across phone, tablet, desktop, RTL and e-ink layouts. - Playwright search-history test passed with an imported Alice EPUB, covering book/full-text reuse and persisted deletion. - pnpm lint passed; git diff --check passed. - Running web app and isolated Linux CEF app exercised; screenshots inspected in light, dark, e-ink and RTL layouts. - Before implementation, dropdown tests failed to find the Dune entry. Before the immediate-apply fix, the e2e test expected Alice but got an empty input after clear and reselect; it passes with the fix. - Not tested on physical Android or iOS devices. Production builds were not run; no dependencies or Rust code changed. Reported by d3m3vilurr on GitHub (#7126). Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(library): preserve search history deletion during pending writes Apply pending book input before deleting history and invalidate running full-text history writes when their query is removed or all history is cleared. A later scan can save the same query again. Also record the query when switching from text search to book search. Verification: - New full-text tests failed before the fix: deleted queries returned on completion (expected false, received true). - New book deletion tests failed before the fix: pending search was not applied before removal. Mode-switch e2e failed with missing book history. - All 15 focused unit tests, 18 header browser tests, and four app e2e tests pass. Typecheck, Biome lint and patch whitespace checks pass. - Full unit suite runs again in the pre-push hook. - Original CI's paginator browser timeout is tracked separately in #7266. - Physical mobile devices and production builds were not run. Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(library): save explicitly applied book searches Record Enter and history selections even when the query already matches the URL. Keep pre-delete application separate so deletion stays effective. Verification: - New unit regression failed before the change: expected ['Dune'], got []. - New app regression failed before the change: book history was null after Enter on the current query. - 16 focused unit tests and five app e2e tests pass, including deletion regressions. Full format, lint and unit checks run in the pre-push hook. - Physical mobile devices and production builds were not run locally. Co-Authored-By: Claude Code <noreply@anthropic.com> --------- Co-authored-by: Claude Code <noreply@anthropic.com> |
||
|
|
a70e326d07
|
feat(kosync): support original filename checksums (#7253)
* feat(kosync): support original filename checksums Offer File Name in KOReader Sync settings and use MD5 of the saved original basename, including its extension, matching KOReader's getFileNameDigest. Keep the existing content digest when the original name is unavailable and explain that fallback in settings. Content matching remains the default. Verified: new tests first failed on the missing File Name option and on filename-mode GET/digest assertions returning the content hash. All 35 related tests pass, including exact Unicode/literal names, changed bytes, legacy and ABS fallback, GET/PUT consistency, and settings persistence. Full suite: 1,223 files passed (4 skipped), 14,836 tests passed (16 skipped). TypeScript, Biome lint, formatting and whitespace checks pass. Real web app: selected File Name, reloaded, imported sample-alice.epub, and observed progress GET under its independently calculated filename MD5. Desktop light, phone dark/RTL and tablet e-ink screenshots were checked. Browser progress upload was inconclusive; GET/PUT identity is unit-tested. No physical XTEINK/KOReader device or native app was exercised. Development servers were stopped by the harness under memory pressure after testing. Reported by kigrup on GitHub (#7118). Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(kosync): pull again after switching checksum method Reset pull and conflict-resolution state when checksum method changes so filename-keyed progress is checked before automatic uploads resume. Reject queued pushes captured under the previous method. Unrelated settings edits retain the previous pull state. Verified: two hook regressions first failed because changing checksum method made no new GET. Resetting the pull alone also exposed a stale queued upload; the old-method guard fixes that assertion. All 51 related hook/client/settings tests pass, as do TypeScript and Biome lint. Full suite runs in pre-push. Also executed KOReader's actual getFileNameDigest and splitFilePathName source functions with its ffi/sha2.lua under its bundled Linux LuaJIT. All four vectors match Readest: My Book.epub, a Unicode/percent/uppercase-extension basename, a literal-backslash POSIX basename, and sample-alice.epub. KOReader source revision: 51db00155ce4ff5a1cd7aded0e95efd9102da588. Native/device UI was not exercised; development servers remain stopped. Reported by kigrup on GitHub (#7118). Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(kosync): discard pending work after checksum changes Invalidate pending pulls, conflict previews, position conversions and uploads when the checksum method changes. Clear the previous conflict immediately; old continuations cannot navigate or release automatic uploads for the new identity. Unrelated settings changes retain the existing sync state. Verified: delayed-response regressions first failed because an old empty GET changed conflict to synced, an old preview replaced the new conflict, and an old conversion navigated the reader. A delayed upload conversion also failed before its guard. All 56 related hook/client/settings/provider tests pass. TypeScript, Biome lint, formatting and whitespace checks pass. The complete suite runs in the required pre-push hook. Native/device UI was not exercised; development servers remain stopped after host memory pressure. Reported by kigrup on GitHub (#7118). Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(kosync): discard stale converted position before caching Capture the checksum generation before converting a position and reject a stale result before it writes the fallback XPointer cache. Verified: the pending upload conversion test first failed because the cache changed from empty to the old XPointer after a checksum-method switch. It now passes with all 56 related hook/client/settings/provider tests. TypeScript, Biome lint, formatting and whitespace checks pass. Full suite runs in the required pre-push hook. Native/device UI was not exercised; development servers remain stopped after host memory pressure. Reported by kigrup on GitHub (#7118). Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(kosync): use title filename fallback (owner: use a {title}.{ext} as the filename) When File Name is selected, hash the saved original filename or synthesize {title}.{ext} from the current title and lowercase format extension. Update the settings explanation. File Content retains its existing digest behavior. Verified: four checks failed before the change: two legacy filename digest cases, the progress GET digest and the settings explanation. All 57 related hook/client/settings/provider tests now pass, covering GET/PUT consistency, Unicode titles, original filename precedence and File Content ABS behavior. TypeScript, Biome lint, formatting and whitespace checks pass. Full suite runs in the required pre-push hook. Native/device UI was not exercised; development servers remain stopped after host memory pressure. Reported by kigrup on GitHub (#7118). Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(kosync): order pulls after pending progress uploads Serialize progress uploads and wait for pending writes before pulling a new checksum identity. Recheck generation before starting a queued upload or pull, so a checksum switch discards queued work from the previous method. This preserves request ordering for servers that alias document hashes. Verified: two hook regressions failed before implementation because a new pull overtook an active upload and two uploads ran concurrently. All 59 related hook/client/settings/provider tests pass after the fix. TypeScript, Biome lint, formatting and whitespace checks pass. Full suite runs in the required pre-push hook. CrossPoint's writeDeviceProgress and progress GET source confirm canonical document mapping; no live server/device was tested. Development servers remain stopped after host memory pressure. Reported by kigrup on GitHub (#7118). Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(kosync): shorten filename tip (owner: Remove the last sentence.) Keep only the sentence describing the original filename and extension. The title-and-extension fallback behavior is unchanged. Verified: the component test first failed to find the shortened tip, then both settings tests passed after the text change. Full checks run through the required pre-push hook. The app was not relaunched after development servers were stopped for host memory pressure. Reported by kigrup on GitHub (#7118). Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(kosync): reset sync when a title fallback digest changes Subscribe to the current book and track its effective document digest. Reset pull and conflict state when that digest changes, including legacy-book title edits in filename mode. Discard pending work and queued pushes from the prior digest. Stable digests do not repull after a title edit. Verified: two title-edit regressions failed before implementation because no new GET was made and the new identity remained checking. All 63 related hook/client/settings/provider tests pass, including binary/original-filename stable-identity controls. TypeScript, Biome lint, formatting and whitespace checks pass. Full suite runs in the required pre-push hook. Native/device UI was not exercised; development servers remain stopped for host memory pressure. The separate iOS filename decoding defect is tracked in #7257. Reported by kigrup on GitHub (#7118). Co-Authored-By: Claude Code <noreply@anthropic.com> --------- Co-authored-by: Claude Code <noreply@anthropic.com> |
||
|
|
4b8da3715f
|
feat(reader): add dialogue highlighting weight options (#7256)
Add independent Normal, Slightly heavier and Bold dialogue weights. A thin current-color stroke provides subtle emphasis for fonts with regular/bold faces. Weight alone enables marking, and Bold reaches explicitly regular text inside dialogue. Persist and reset through the existing settings paths and translate the new labels in all supported non-English locales. Test-first: the new picker, default, marking and CSS assertions failed before implementation. The descendant regression failed with expected bold but received 400 before the Bold-only descendant rule. Verified: 78 focused tests; full suite 14,835 passed, 16 skipped across 1,223 passing files (4 skipped); pnpm lint; source/locale formatting; JSON validity; git diff --check. Android x86_64 debug APK build passed. Real app checks passed on web, Linux CEF and Android 15 / WebView 124, including weight-only styling, nested text, persistence and reset. Web screenshots covered phone/tablet, dark mode, e-ink and RTL. iOS not run. Reported by lambda3141 on GitHub (#7250). Co-authored-by: Claude Code <noreply@anthropic.com> |
||
|
|
5dfe48e553
|
fix(reader): highlight long punctuated single-quoted dialogue (#7255)
* fix(reader): highlight long punctuated single-quoted dialogue Allow punctuation-terminated single quotes within one paragraph to use the existing 2048-character quote limit. Keep the 300-character loose fallback and continued-paragraph limits unchanged. Regression: before the fix, the 600- and 2048-character cases returned no highlight spans, and a long speech with word-final apostrophes stopped at ‘We’re goin’. All seven new regression cases pass with the fix. Verified: - Dialogue utility and settings suites: 77 tests passed. - Full unit suite with --maxWorkers=1: 1223 files / 14834 tests passed, 16 tests skipped. Initial four-worker run failed with an XPointer oracle timeout and eight worker errors; the five affected files passed separately with one worker. The failed run remains recorded. - pnpm lint, Biome checks on changed files, and git diff --check passed. - Repro EPUB in web and Linux Tauri/CEF: all 580 speech characters highlighted; narration, long fallback quotes, and paragraph boundaries remain correct. - Web checks included desktop/phone/tablet, light/dark, e-ink, RTL content, and both book-layout settings. 20000 short-quote inputs matched identically. Not verified: Android and physical-device safe areas. The reused CEF binary exited 139 when the isolated windows were closed after successful checks; its shutdown failure was not investigated in this change. Reported by lambda3141 on GitHub (#7249). Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(reader): preserve short quotes before oversized dialogue Retry the existing short single-quote fallback at an opening mark when its punctuation-terminated match exceeds the 2048-character limit. Otherwise a distant closer suppresses a valid short quote. Regression: the new oversized-match fallback test failed before this change with expected ['‘Hello’'] but received []. It now passes. Added 304 characters as the first changed plain-punctuated boundary. Verified: 79 dialogue and settings tests passed; pnpm lint and diff whitespace check passed. Web EPUB import confirmed the recovered short quote, full 580-character speech, paragraph limits, both layout modes, and e-ink across desktop, phone and tablet viewports. Android and native app were not rerun for this follow-up. Full suite runs in pre-push. Reported by lambda3141 on GitHub (#7249). Co-Authored-By: Claude Code <noreply@anthropic.com> --------- Co-authored-by: Claude Code <noreply@anthropic.com> |
||
|
|
763242049a
|
fix(reader): release volume keys while reader controls are open (#7254)
Return volume keys to system volume control while toolbars, menus or
Settings are open. Check current visibility for forwarded native events,
and restore page-turn interception once controls close and TTS is idle.
Reuse the existing reader overlay detection and shared document observer.
Verified on current origin/main
|
||
|
|
d5e10369b4
|
fix(library): preserve original filenames and use PDF filename titles (#7237)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
Publish Docker image / build (linux/amd64, ubuntu-latest) (push) Waiting to run
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm) (push) Waiting to run
Publish Docker image / merge (push) Blocked by required conditions
Build with Nix / tests (push) Waiting to run
PR checks / koplugin_rust_lint (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
PR checks / nix_flake_check (push) Waiting to run
PR checks / rust_lint (push) Waiting to run
PR checks / test_web_app (1) (push) Waiting to run
PR checks / test_web_app (2) (push) Waiting to run
PR checks / test_web_browser (push) Waiting to run
PR checks / test_extensions (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
* fix(library): preserve import filenames and use PDF filename titles Save each imported file's original basename, including its extension, on the local Book record. Use the filename stem as the PDF display title while preserving embedded metadata and the sourceTitle used to locate managed files. Retain the original filename when re-importing a managed copy. Regression evidence: before the fix, import-metahash and import-docx-conversion had 13 assertion failures for missing originalFilename fields and PDF titles still reading PowerPoint Presentation. Both suites pass with the change. Verified: - Full unit suite: 1220 files passed, 4 skipped; 14648 tests passed, 16 skipped (before updating to origin/main |
||
|
|
4f9395859c
|
fix(security): remediate Dependabot dependency alerts (#7248)
* fix(security): upgrade direct ZIP readers to 9.0.5 Upgrade the app, native narration reader and Windows thumbnail provider; adapt fallible filenames and optional data offsets. Update both app lockfiles and the thumbnail lock while preserving unrelated pins. Verified: 201 app Rust tests, 24 native TTS tests, 6 thumbnail tests under Wine (1 existing ignored), strict app clippy, formatting and locked CEF Linux dependency graph. Thumbnail strict clippy reproduces 3 existing lints on the original source; it passes with those CLI lint allowances. CEF compilation and native Windows device testing were not run. This is a dependency/API migration covered by existing archive tests; no new application behavior is intended. The Windows updater retains ZIP 4 because its patched release requires an incompatible Tauri family. Co-Authored-By: Claude Code <noreply@anthropic.com> * fix(security): update vulnerable JavaScript dependencies Raise patched dependency floors, scope the modern minimatch upgrade to v10 consumers, and patch deepmerge prototype writes in both merge loops. Upgrade the SVG renderer and keep its font shaper external so Node can load its WASM asset when generating PNGs. Regression tests fail before the fixes: deepmerge inherits attacker properties; minimatch expands 256 patterns instead of 64 and performs 500500 comparisons instead of zero. The unpatched image upgrade fails with a dynamic require of fs / missing hb.wasm. All 31 new tests pass with the fixes, including actual translation and PDF vendor consumers. Verified: full unit suite 14714 passed/16 skipped; final focused tests 31 passed; lint, formatting, frozen install, web build and Tauri frontend build passed. Final web build was repeated after the renderer patch. Nix hashes still need CI regeneration; CEF compilation was not run. Version-based audits still flag patched deepmerge and legacy minimatch 3/5, which lack this advisory's vulnerable optimizer. Co-Authored-By: Claude Code <noreply@anthropic.com> * build(nix): request fresh security dependency hashes Invalidate the pnpm and Cargo fixed-output hashes so the PR dependency check computes the updated stores instead of substituting old cached stores. Replace both values with the CI-reported hashes before merge. Verified the diff changes only the two affected hash fields; local Nix is unavailable. CI verification is pending on this commit. Co-Authored-By: Claude Code <noreply@anthropic.com> * build(nix): pin regenerated security dependency hashes Use the pnpm and Cargo hashes calculated by the PR dependency check (run 41428540045). Both fetchers completed and reported their actual fixed-output hashes. Replace the temporary empty values. Verified against the CI log's pnpm-deps and vendor-staging got values; git diff --check passes. The final hash-check rerun is pending. Co-Authored-By: Claude Code <noreply@anthropic.com> --------- Co-authored-by: Claude Code <noreply@anthropic.com> |
||
|
|
1714c2d8a8
|
feat(dictionary): customize context prompts and response limits (#7244)
Let readers choose a saved translator prompt or dictionary-specific instructions in Manage Dictionaries and set a dictionary-only output limit. Render custom responses as sanitized Markdown, retain the built-in entry format by default, and persist and sync the new dictionary preferences. Verified with the full Vitest suite (1220 files, 14723 tests passed), the final focused dictionary/settings/sync suites (150 tests passed), pnpm lint, Biome formatting, and git diff --check. New tests failed before the implementation: the Prompt control was absent and custom prose replies were rejected as invalid JSON. Dismissal tests also failed with no saved instructions or token limit; both now persist without needing to blur. The same tests pass with the change. Exercised a live DeepSeek lookup of a word selected in an EPUB, verified custom instructions and max_tokens on the request, and checked settings persistence after reload. Inspected browser layouts at phone, tablet and desktop sizes in light, dark, e-ink and RTL modes, plus settings in Linux CEF. Physical Android and iOS devices were not tested. Reported by noideaforeal on GitHub (#7198). Co-authored-by: Claude Code <noreply@anthropic.com> |