Repository navigation
Conversation
Closes #24. Adds real-format coverage and opt-in large-book stress checks; records remaining performance limits.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b4aafafcb4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (lc.contains('<svg')) return FlowKind.svg; | ||
| if (lc.contains('<html') || | ||
| lc.contains('<?xml') && lc.contains('<head')) { | ||
| return FlowKind.html; |
There was a problem hiding this comment.
Distinguish SVG roots from SVG embedded in HTML flows
For a KF8 book whose primary HTML flow contains an SVG cover within its first 256 bytes, such as <html><body><svg ...>, this check classifies the entire HTML flow as SVG before checking for <html>. BookFlows.primaryHtml then returns null, and both the reconstruction and fallback paths in KindleBook.fromBytes dereference flows.primaryHtml!, causing an otherwise readable AZW3 or dual-format MOBI to fail opening as an invalid document. Check the root element rather than the presence of any SVG descendant, or identify the primary flow by its defined index.
Useful? React with 👍 / 👎.
Adds MOBI, AZW3, TXT, CBR and CBZ reading alongside EPUB and PDF. Previously these formats could reach library/import flows without a working reader route; they now open through the reflow or fixed-page engine, retain original-format locators, and allow Back during preparation.
Closes #24. Implements format coverage within FR-3_1; does not close the whole requirement or certify NFR-4_2 performance. Companion client integration: client PR #141, which pins this reader commit. Merge this reader PR first.
Implementation
Validation
On Apple Silicon macOS with the workspace-pinned Flutter SDK:
Browser observations used a fresh Chrome instance per book. Times measure document readiness, not guaranteed first rasterized paint. Memory is peak aggregate browser-process RSS across open/read/reopen/cancel, including GPU and workers, with about 0.81 GiB baseline.
Corpus sources: Webster's Dictionary, Gutenberg 29765, scanned Alice PDF, and Whiz Comics #6. The 272-page comic fixtures repeat the original 68 JPEGs four times using stored ZIP/RAR5 entries; the separate original CBR checks compressed input. Reproduction instructions are in docs/VALIDATION.md.
Known limits
Large-book functionality is established for these samples, but uniformly non-blocking behavior is not: MOBI and AZW3 produced 232 ms and 227 ms main-thread long tasks, and whole-comic conversion has substantial memory cost. These remain optimization work. The 12 MB dictionary EPUB also exceeds the NFR-4_2 opening-time target.
Physical Android/iOS and low-memory behavior, arbitrary publisher files, every page, and long-distance Flutter pagination in the monolithic MOBI remain unverified. Encrypted books, password/multi-volume archives, Topaz and Kindle Print Replica remain unsupported.