feat(pdf): read ViewerPreferences Direction as book.dir - #75
Merged
Conversation
PDFs bound right-to-left (Japanese photo books, manga) declare it in the catalog's ViewerPreferences as /Direction /R2L. Surface it as book.dir so the fixed-layout renderer pairs and orders two-page spreads right-to-left and page navigation follows the reading direction. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
chrox
added a commit
to readest/readest
that referenced
this pull request
Aug 15, 2026
readest/foliate-js#75 was squash merged, so point the submodule at the commit on main instead of the feature branch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
chrox
added a commit
to readest/readest
that referenced
this pull request
Aug 15, 2026
* fix(reader): target the active book when the settings shortcut opens the dialog
The Shift+F shortcut opened the settings dialog without setting its book
key, so the dialog ran in bookless mode: writing mode and other per-book
changes were saved under an empty key, nothing applied to the open book,
and recreateViewer('') threw Book not found. Pass the sidebar book key
like the view menu entry does.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(reader): right-to-left page order for fixed-layout books, closes #5591
Books bound right-to-left (Japanese photo books, manga, RTL PDFs) showed
two-page spreads paired and ordered left-to-right with no discoverable
way to fix it.
Add a Right-to-Left Pages toggle to the view menu's fixed-layout section
next to the spread controls. It drives the existing per-book writingMode
setting (horizontal-rl / horizontal-tb) so it stays consistent with the
Layout panel and persists like any view setting.
Auto-detect the binding for PDFs that declare it: makePDF now surfaces
the catalog's ViewerPreferences /Direction /R2L as book.dir, and the
viewSettings.rtl derivation considers the loaded document's dir so
page-turn taps and swipes follow the reading direction.
Mirror the @pdfjs alias into the browser vitest config so browser tests
can load foliate-js/pdf.js, and translate the new label across all
locales along with the previously untranslated Send Document Metadata
key that extraction surfaced.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* chore(reader): bump foliate-js to the merged R2L direction commit
readest/foliate-js#75 was squash merged, so point the submodule at the
commit on main instead of the feature branch.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PDFs bound right-to-left (Japanese photo books, manga) declare it in the catalog's ViewerPreferences as
/Direction /R2L. Surface it asbook.dirso the fixed-layout renderer pairs and orders two-page spreads right-to-left and page navigation follows the reading direction.Covered by a browser test in the readest app (
pdf-viewer-preferences-direction.browser.test.ts) that loads minimal R2L-flagged and unflagged PDFs throughmakePDFand assertsbook.dir.Part of readest/readest#5591.
🤖 Generated with Claude Code