Skip to content

Add Kodi Reader for iOS (Expo, Expo UI, Liquid Glass) - #1

Merged
dev-olly merged 4 commits into
dev-olly:mainfrom
AnthonyProjects-dev:mobile/ios-expo
Oct 14, 2026
Merged

dev-olly merged 4 commits into
dev-olly:mainfrom
AnthonyProjects-dev:mobile/ios-expo

Conversation

@AnthonyProjects-dev

Copy link
Copy Markdown
Contributor

Kodi Reader for iOS (Expo + Liquid Glass)

Adds Mobile/, an iOS-first port of Kodi Reader built with Expo SDK 57, Expo Router native tabs, @expo/ui SwiftUI components, and expo-glass-effect. It reuses reader.js and reader.css from Sources/ReaderUI/Resources inside a WKWebView, so pagination, anchors, and highlight painting are the same engine as the Mac app. Reading positions and annotations use the same simplified-CFI locators.

What works

  • Library with covers, progress, rename and remove; import EPUB/PDF from Files; two bundled Project Gutenberg samples.
  • Paginated EPUB reading with swipe and edge-tap page turns, chapter hand-off, table of contents sheet, saved position.
  • Highlights (five colours + underline) and Markdown notes via a Liquid Glass palette over the selection; tap a highlight to recolour, note, copy or delete.
  • Appearance sheet (SwiftUI Form): light/dark/system, New York/Georgia/Palatino/Charter/Helvetica/San Francisco, size, line spacing, margins, justify, hyphenation. Changes reflow live.
  • Notes tab across all books with Markdown export (same format as the Mac export).
  • Open a web page in the in-app browser and save it as a reader-mode book (Readability extraction and ArticleEPUBBuilder ported to TypeScript, images inlined).
  • PDFs open in the native WebKit viewer (read-only).

Not in this PR

Ask AI, cloud sync, Excalidraw drawings, PDF highlights.

Layout

Mobile/src/app/        Expo Router routes (tabs, reader, sheets, web browser)
Mobile/src/reader/     WebView bridge, runtime install, settings → CSS
Mobile/src/reader/runtime/  copies of reader.js, reader.css, Readability.js + bridge.js
Mobile/src/lib/epub/   unzip (fflate), OPF/NCX/nav parsing
Mobile/src/lib/web/    article → EPUB builder
Mobile/src/lib/store.ts  library.json store

Running

cd Mobile
npm install
npx expo run:ios   # Xcode 26 + CocoaPods; needs a dev build, not Expo Go

Tested on the iPhone 17 Pro simulator (iOS 26.5): import, reading, TOC, highlights, notes, theme switching, web import. npx tsc --noEmit and npx expo lint are clean.

🤖 Generated with Claude Code

An iOS-first port under Mobile/ built with Expo SDK 57, Expo Router native
tabs, @expo/ui SwiftUI components and expo-glass-effect. It hosts the Mac
app's reader.js/reader.css engine in a WKWebView, so pagination, positions
and highlight anchors match the macOS app.

Includes: library with covers and progress, EPUB import (fflate unzip plus
OPF/NCX/nav parsing), paginated reading with glass chrome, highlights and
Markdown notes, contents and appearance sheets, light/dark/system themes,
Notes tab with Markdown export, and saving web pages as reader-mode books
(Readability and ArticleEPUBBuilder ported to TypeScript). PDFs open in
the native WebKit viewer.

Not yet ported: Ask AI, cloud sync, Excalidraw drawings, PDF highlights.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 14, 2026

Copy link
Copy Markdown

@Anthonydesinenerd is attempting to deploy a commit to the devolly's projects Team on Vercel.

A member of the Team first needs to authorize it.

Anthonydesinenerd and others added 2 commits October 14, 2026 13:23
Opening a book took 10 to 18 seconds in the simulator. Timing showed the
cost was WebKit starting a new content process for every reader web view,
plus round trips through the JS thread before a chapter could lay out.

- Move the reader out of the route stack into ReaderOverlay, a layer that
  lives for the whole session. Its web views start at launch, so opening
  a book is a page navigation and reopening the same book is instant.
- Write each chapter's boot data (runtime options, position, highlights)
  into its <head>; bridge.js boots the page on DOMContentLoaded itself.
- Preload the next chapter in a second web view and swap it to the front
  at a chapter end or a Contents jump.
- Always navigate to a fresh file name instead of reloading, and route
  external links through the origin whitelist instead of a JS handshake.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Record a cover's path whenever the copy succeeds. A File's `exists`
  read stale right after copying, so first imports had no cover. Books
  imported before this fix recover their cover path on launch.
- Replace the header menu, which did not open, with a More button that
  shows a native action sheet (Open Web Page, Add Sample Books).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@dev-olly dev-olly left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed af9e201. Please address the five inline findings before merging: destructive identifier handling, EPUB access to private library data, unawaited SDK 57 filesystem operations, book ID collisions, and pending note edits discarded on dismissal.

Validation: TypeScript typecheck, Expo lint, and the iOS JavaScript export passed. Targeted temporary harnesses reproduced the identifier deletion/collision, asynchronous import, and note-dismissal paths. A native macOS WKWebView test using synthetic files confirmed that an EPUB script can read library.json with the configured permissions. Native iOS UI behavior is still unverified because the review machine has no iOS simulator runtime installed.

Comment thread Mobile/src/lib/epub/import.ts
Comment thread Mobile/src/reader/ReaderWebView.tsx Outdated
Comment thread Mobile/src/lib/epub/import.ts Outdated
Comment thread Mobile/src/lib/files.ts
Comment thread Mobile/src/app/note/[bookId]/[annotationId].tsx Outdated

@dev-olly dev-olly left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed the five review findings in 73a2db0: SHA-256 storage IDs and path containment, book-scoped WebKit access with a nonce-based script policy, awaited filesystem operations, and pending note edits committed on dismissal. Added regression coverage and Mobile checks CI; all five review threads are resolved.

Validation: all 10 regression tests, typecheck, lint, and iOS JavaScript export passed in GitHub Actions: https://github.com/dev-olly/kodi-reader/actions/runs/38647575817. The native macOS WKWebView smoke test passed pagination, fragment navigation, position restore, highlight painting, and isolation checks. Native iOS UI testing remains unverified because no simulator runtime is installed on the review machine.

The remaining Vercel failure is contributor deployment authorization, unrelated to the mobile build checks.

@dev-olly
dev-olly merged commit 00a52df into dev-olly:main Oct 14, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants