mirror of
https://github.com/readest/readest.git
synced 2026-11-30 03:13:39 +00:00
* feat(reader): add Page Flip page-turn style on Android, iOS and desktop
Page Flip lifts the whole sheet over the spine instead of curling a
corner. It is a separate Animation Style next to Page Curl, offered in
the apps only; a spread and the web turn it as a Page Curl.
The sheet follows a physical profile model ported from page-turn-core
(MIT, notice kept in each port): PageFlipModel.kt, PageFlipModel.swift
and pageFlipModel.ts are line-for-line ports and share the same tests.
Android draws it in NativePaperView (GLES 3), iOS in NativePaperView
(Metal), and desktop in the captured-turn WebGL renderer, which asks
for WebGL 2 only for surfaces built for Page Flip. A released flip
settles on its own physics instead of a fixed easing.
On macOS a backward turn showed the previous page for a few frames
while it was captured. macOS now covers the webview with a snapshot
during that capture, as Android and iOS already do, which also fixes
the same flash for Page Curl on macOS.
Verified:
- pnpm test (1199 files pass), pnpm lint, pnpm fmt:check,
pnpm clippy:check, pnpm test:rust, browser tests for the renderer.
- Tests that fail without the change:
- page-flip-model.test.ts: without the unturn phase a tap's return
jumps, "expected 0.13785… to be less than 0.12".
- captured-turn.browser.test.ts "settles a chosen Page Flip on its
own physics in both directions": without the settle it fails with
"expected 0 to be greater than 4".
- ControlPanelUpdateReset.test.tsx "offers Page Flip in the apps" and
"shows a synced Page Flip as Page Curl on the web".
- Android: taps and drags in both directions on a phone, with an
earlier build of this change.
- macOS: forward flip recorded at about 60 fps.
Not run:
- The macOS backward cover in the app (a system permission prompt
blocked the run).
- Android after moving the flip choice to the turn host (rebuild
pending).
- iOS on a simulator or device; the Metal shaders were compiled at
runtime with makeLibrary(source:) only.
- Windows and Linux have no native cover, so a backward turn there
still shows the previous page briefly, for both styles.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(ios): build Swift plugins with SwiftPM's native build system
Swift 6.4 (Xcode 27.1) builds packages with Swift Build by default. It
writes the static libraries to `Products/<Config>-<sdk>` instead of the
triple directory swift-rs links from, and prelinks each module so the
@_cdecl entry points (init_plugin_*, register_plugin, run_plugin_command)
are local symbols Rust cannot link.
An incremental iOS build therefore linked whatever plugin libraries an
older build had left in the triple directory: the app built and
installed, but ran old plugin Swift ("No command paper_curl found for
plugin native-bridge", so no native page turn worked). A clean build
failed with "could not find native static library `Tauri`", then with
undefined `_init_plugin_*` symbols once pointed at the new directory.
Passing `--build-system native` restores the layout and the exported
symbols.
Verified:
- With the plugin build caches cleared, `pnpm dev-ios` fails without
the change ("could not find native static library `Tauri`") and
builds and installs with it.
- On an iPhone XS Max (iOS 18.7) the new build turns a page with the
native turn and logs no error, where the old build failed every turn.
- rustfmt --check on the changed file.
Not run: the simulator build, and a build with an older Xcode (not
checked which older SwiftPM versions accept `--build-system native`).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| types | ||
| autorelease.rs | ||
| build.rs | ||
| dark_magic.rs | ||
| lib.rs | ||
| swift.rs | ||
| swift_arg.rs | ||
| swift_ret.rs | ||
| test-build.rs | ||