Skip to content
All work

Personal project

Leu

Read a passage. Find the gap. Return to the exact source.

Built with
SwiftUI · PDFKit · Swift · ONNX Runtime · Kokoro-82M
Context
Independent product · 2026

Behind the interface

Architecture & tools.

The native reader owns source selection and exact return. A shared learning core owns session state, while a separate voice provider generates neural audio entirely in-process on the device.

Native interface

SwiftUI · PDFKit · Swift

Keep reading, selection, source return and learning state inside a native iOS experience.

Learning core

ShelfCore · source anchors · persisted session state

Preserve document identity, exact source ranges, drafts, feedback and Teach It Back transitions.

Neural voice

Kokoro-82M · ONNX Runtime · AVAudioEngine

Generate narration on-device, time-stretch playback without pitch shift, and map playback state back to the active source.

Verification

XCTest · XCUITest · iOS Simulator

Exercise cancellation, stale-result suppression, source ownership, selected-passage playback and the learning Listen journey.

  1. 01

    Read

    Select an exact passage in the native PDF reader.

  2. 02

    Diagnose

    Ask a source-grounded question and capture the learner answer.

  3. 03

    Repair

    Give specific feedback, clarification or a harder follow-up.

  4. 04

    Teach back

    Return to the source, explain it, and preserve the completed trace.

A stale or cancelled speech result cannot start after a newer request or Stop. Voice preference persists across relaunch, playback itself does not, and narration marks are transient rather than saved as source annotations.

Editorial Leu cover showing a warm paper reading surface with a highlighted source passage and compact playback controls.
Leu. Editorial case-study cover based on the native reader direction.

The challenge

Reading a PDF is not the same as understanding it. Generic AI explanations can drift away from the source, while quiz flows often test recall without helping the learner repair the exact gap.

Decisions that shaped the product

01

Never detach the answer from the source.

Selections preserve document identity and exact text ranges through questioning, feedback and source return. The learner can always get back to the passage that triggered the session.

The tradeoff. The product carries more source-state than a conventional chat or quiz flow, but that state is what makes the learning trace inspectable.

02

Diagnose, repair, then ask for explanation.

A session can move from a diagnostic answer into specific feedback, clarification, a harder follow-up and Teach It Back instead of ending at correct or incorrect.

The tradeoff. The state machine is more involved than a card carousel, but each transition has a distinct learning job.

03

Keep neural voice inside the app.

Kokoro-82M runs through native ONNX Runtime and AVAudioEngine. Narration follows the active source, pause softens the mark, Stop clears it, and stale generation cannot begin playing after replacement or cancellation.

The tradeoff. Bundled model assets and runtime memory are meaningful costs, so physical-device performance still needs release validation.

The outcome

A native SwiftUI/PDFKit learning product with source-linked sessions, exact source return, persistent learning state and on-device neural narration. The current Kokoro build completed more than 2.8 minutes of continuous native playback in iOS Simulator, and its generated clips were listening-reviewed before this case study was published.

Physical-iPhone performance, peak memory and energy use, a full VoiceOver/Reduce Motion pass, production-PDF validation on the new Simulator, and TestFlight signing remain release work.

Next case study

VIGIA