Skip to content

Add Boox MyScript handwriting recognition with ML Kit fallback - #7

Open
imedwei wants to merge 6 commits into
DurhamG:masterfrom
imedwei:feature/myscript-hwr
Open

Add Boox MyScript handwriting recognition with ML Kit fallback#7
imedwei wants to merge 6 commits into
DurhamG:masterfrom
imedwei:feature/myscript-hwr

Conversation

@imedwei

@imedwei imedwei commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds OnyxHwrTextRecognizer that uses the Boox MyScript HWR service via AIDL for on-device handwriting recognition
  • Refactors recognition behind a TextRecognizer interface with TextRecognizerFactory that auto-detects Boox devices and falls back to Google ML Kit
  • Includes stroke downsampling, protobuf encoding for the HWR service, fixture capture tooling, and comprehensive unit/instrumented tests

Test plan

  • Unit tests pass (73/73)
  • Instrumented tests pass on Boox device (3/3)
  • Verify MyScript recognition works on Boox device
  • Verify ML Kit fallback works on non-Boox device

🤖 Generated with Claude Code

@imedwei
imedwei force-pushed the feature/myscript-hwr branch from 11b1628 to 75d14ac Compare March 21, 2026 13:14
imedwei and others added 6 commits March 23, 2026 10:03
Scripts (review-pr.sh, review-check.sh) run Claude Code reviews locally
against the branch diff, with --local/--post/--no-post flags for
non-interactive agent use. Uses printf-based prompt passing to avoid
shell injection from diff content. Includes iterative review-fix-verify
cycle in CLAUDE.md PR workflow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use TypedValue.applyDimension for SP to pixel conversions instead of
the deprecated DisplayMetrics.scaledDensity field. Extract initLayout()
and computeTextSizes() for clearer separation of layout vs text sizing.
Add type-safe TestLogEvent, replace KotlinClosure2 with TestListener,
and add allTests task with test ordering.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace blanket finger rejection in both views with a shared TouchFilter
that applies five palm-rejection layers (pen-active suppression, 150ms
cooldown, touch-size threshold, multi-touch rejection, stationary timeout).

Canvas allows finger vertical scroll; text view allows finger taps on
logo/text and finger scroll. All stylus gestures unchanged.

Fixes #4

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the permanent ~69dp side gutter with lighter UI elements.
The "I" logo is now a floating icon in the top-right of the text view
that auto-hides during writing (300ms delay on pen lift). Split resize
is handled by dragging the 1dp divider with an expanded touch target.

Text view scroll drives canvas scroll so the two views stay
complementary — preview shows recognized content, canvas shows what
hasn't been recognized yet. Diagrams render progressively as they
scroll off, clipped to actual stroke bounds for flush alignment at
the boundary. Only currently-hidden lines appear in preview text.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@imedwei
imedwei force-pushed the feature/myscript-hwr branch from 75d14ac to 68b12c7 Compare March 23, 2026 18:51
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