Skip to content

Page curl: state machine interface and its first tests - #20

Draft
artemlitch wants to merge 2 commits into
artem/page-curl-bake-state-machinefrom
artem/page-curl-state-machine-tests
Draft

artemlitch wants to merge 2 commits into
artem/page-curl-bake-state-machinefrom
artem/page-curl-state-machine-tests

Conversation

@artemlitch

@artemlitch artemlitch commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Four review rounds on #17 each found new edge cases in the page curl controller. Every one was a failure path or a message ordering, and nothing automated covered the controller. Hand testing on the simulator only exercises the normal path.

What this adds

This is the start of testing the bake loop first, before any more controller changes.

  • RNCPageCurlStateMachine is the interface the bake loop moves into: Foundation only, events in and effects out. The implementation is an empty stub for now.
  • apple-tests/ has the first eight tests, for the basic bake loop. They are expected to fail against the stub.
  • The podspec declares the tests as a CocoaPods test spec (s.test_spec 'Tests'). An app opts in with :testspecs => ['Tests'] and runs them in its own workspace. Bookwise does this in readwiseio/rekindled#13844.
  • apple-tests is added to the package files list, so a GitHub pin ships the tests.

A separate commit carries the Metal texture change from the bake time work. A WKWebView snapshot comes back as 32-bit RGBA, so its bytes are copied straight into a texture instead of redrawn into a new bitmap first. That change ran on the iPhone Duo simulator before the checkout holding it was lost; this commit restores it from the session record. It has not been run since.

Status

  • pod install with the test spec works next to autolinking, and generates the react-native-webview-Unit-Tests scheme in bookwise.xcworkspace.
  • The tests compile. The last run failed at link on C++ standard library symbols. The test spec now links c++; that fix has not been run.
  • No test has been seen failing for the right reason yet. That is the next step.

The full plan, with the test list in order, is docs/plans/2026-10-23-page-curl-state-machine-tests.md in readwiseio/rekindled#13844.

🤖 Generated with Claude Code

artemlitch and others added 2 commits October 23, 2026 15:30
…allows

A WKWebView snapshot comes back as 32-bit RGBA with alpha last. Metal can
take those bytes as RGBA8Unorm, and little-endian alpha-first bytes as
BGRA8Unorm, so the bake no longer redraws every page into a new bitmap
first. Any other layout is still redrawn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The bake loop moves into RNCPageCurlStateMachine, Foundation only, as
events in and effects out. This commit has the interface, an empty
implementation, and the first eight tests, which are expected to fail.

The tests are a CocoaPods test spec, so an app opts in with
:testspecs => ['Tests'] and runs them in its own workspace.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant