Skip to content

fix(editor): keep text insertion at the tapped page position - #27

Merged
markm39 merged 1 commit into
mainfrom
fix/text-insertion-coordinates
Sep 26, 2026
Merged

markm39 merged 1 commit into
mainfrom
fix/text-insertion-coordinates

Conversation

@markm39

@markm39 markm39 commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Text insertion could land away from the tap—or on another page—after scrolling or zooming. The overlay moved inside the transformed canvas in #8, but its tap handler still treated local touch coordinates as screen coordinates and inverted the viewport a second time.

Use the overlay's local coordinates directly to select the page and position the text box. Reject taps outside the notebook, including its trailing boundary and invalid coordinates.

Validation: all five new handler-level regression tests failed before the fix and pass afterward; the full suite passes 61 tests, TypeScript passes, and git diff --check is clean. Tests cover three zoom/scroll configurations, multiple pages, edges, empty notebooks, and invalid taps. Simplify and security reviews found no remaining issues. Native verification also passed on an iPad Pro simulator: bundled the candidate JavaScript into the unchanged native simulator app, inserted text on the first page and after scrolling onto the second, then relaunched and confirmed both positions persisted. Exported the notebook through the real app and verified the resulting PDF contained both text boxes and a rotated inserted image on 612 × 792-point pages. Simulator logs showed OS haptics/share-sheet diagnostics, with no observed JavaScript failure.

@markm39
markm39 merged commit acbbefc into main Sep 26, 2026
1 check 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.

1 participant