Open
Conversation
Draw/erase-only React Native Skia canvas module extracted as a shared monorepo package. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rops Replace local DrawingCanvas and smoothing utilities with @repo/pointer-native-drawing. Remove undo/redo and textMode props not yet supported by the shared package. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Prevent duplicate bundling of react, react-native, reanimated, and gesture-handler in pnpm monorepo. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Extracts the Scrap drawing/Skia logic into a new shared workspace package (@repo/pointer-native-drawing) and migrates the native app to consume it, while temporarily removing unsupported features.
Changes:
- Added new
@repo/pointer-native-drawingpackage (tsup build, TS config, Skia drawing canvas + path smoothing). - Migrated
apps/nativeScrap Skia utilities to re-export/use the shared package and removed legacy local drawing/smoothing modules. - Updated native UI/state wiring to drop undo/redo history props and adjusted Metro config to try to prevent singleton module double-bundling.
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/pointer-native-drawing/package.json | Declares the new shared drawing package entrypoints/peers. |
| packages/pointer-native-drawing/tsup.config.ts | Adds build config for ESM/CJS + externals. |
| packages/pointer-native-drawing/tsconfig.json | TypeScript config for the shared package. |
| packages/pointer-native-drawing/src/index.ts | Public exports for the shared package. |
| packages/pointer-native-drawing/src/DrawingCanvas.tsx | New shared Skia drawing canvas implementation. |
| packages/pointer-native-drawing/src/smoothing.ts | New shared path smoothing implementation. |
| apps/native/src/features/student/scrap/utils/skia/index.ts | Re-exports drawing utilities from the shared package. |
| apps/native/src/features/student/scrap/utils/handwritingEncoder.ts | Updates type imports to use the new re-export surface. |
| apps/native/src/features/student/scrap/hooks/useHandwritingManager.ts | Updates ref type import path. |
| apps/native/src/features/student/scrap/screens/ScrapDetailScreen.tsx | Swaps to shared DrawingCanvas import and removes history/text props. |
| apps/native/src/features/student/scrap/hooks/useDrawingState.ts | Removes undo/redo history state plumbing. |
| apps/native/src/features/student/scrap/components/scrap/DrawingToolbar.tsx | Removes undo/redo UI and props. |
| apps/native/src/features/student/problem/screens/ProblemScreen.tsx | Removes history props wiring to the drawing toolbar/canvas. |
| apps/native/src/features/student/problem/components/ProblemDrawingToolbar.tsx | Removes undo/redo UI and props. |
| apps/native/package.json | Adds workspace dependency on @repo/pointer-native-drawing and bumps reanimated patch. |
| apps/native/metro.config.js | Adds custom resolve logic intended to pin singleton modules to a single physical path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…pointer-native-drawing'
git-subtree-dir: packages/pointer-native-drawing git-subtree-split: ac29ede5c13e2f9f769c47c846bb2d03d262720f
- Rename to @repo/pointer-native-drawing, set private:true - Fix package.json exports (./package.json) and codegenConfig for Fabric codegen - Fix StylusInputView native event name and ivar access - Fix codegen spec (remove interfaceOnly, use Double[]) - Set iOS deployment target to 15.1 - Add backgroundColor/children props to DrawingCanvas for overlay pattern - Migrate ProblemScreen to DrawingCanvas children API - Remove deleted API references (setTexts/getTexts, TextItem, DrawingViewportTransform) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…3a9a7f 503a9a7f docs: update README with current API, props table, and architecture a51f5597 refactor: move height buffer logic from document to viewport controller 5d98e76e refactor: unify eraser phase state machine with draw lifecycle 3c4ef476 fix: correct eraser onEnd comment to match actual phaseShared behavior 105bfbf5 fix: correct API names in feature-spec-check doc 584cfe71 fix: address review findings — dep array, gesture finalize, pinch dead commit ede72be6 docs: add feature spec check with implementation status 46477517 fix: canvas height expansion buffer uses viewport height a6c8e492 feat: update example app with tool selector, undo/redo, zoom toggle f1b338a5 refactor: pinch/pan gesture coordination with worklet SharedValue 02331abc fix: onEdit prop missing in CanvasOverlayLayer + dependency array corrections 5e5e41c0 Merge branch 'refactor/drawingcanvas-decomposition-v2' into main 5e4acd93 refactor: decompose DrawingCanvas into responsibility-based modules d644d3f8 Merge branch 'fix/canvas-input-clamp' into main 0a447308 fix: address 8 bugs from pre-merge code review db7d072d fix: clamp draw/erase input coordinates to canvas bounds 102fc879 fix: textbox move boundary clamping and new textbox selection overlay 6e2689eb fix: add body tap gesture to TextBoxSelectionOverlay for edit re-entry 36bb1739 fix: auto-commit on tool switch, suppress draw in textbox mode, dismiss commits editing 118678f1 refactor: rewrite TextBox selection overlay with all-RNGH gestures c67517a7 fix: resolve TextBox stale closure, blur race, and canvas bounds (B1/B2/G1-G3) d263a5fe fix: adversarial review — endSession, textBoxesRef, Paragraph dispose 97b346a8 fix: address code review findings (CRITICAL 1 + HIGH 3) a8b94c5a fix: address production readiness feedback (4 items) e42cf07d feat: add TextBox edit, resize, and move (1-4, 1-5, 1-6) f5111a26 feat: add undo/redo HistoryManager and TextBox MVP (create + delete) 72898ed9 fix: pinch zoom focal-point anchoring, finger-lift jump, and rendering bugs 82738bff feat: add zoom/pan support with enableZoomPan prop 160a5012 Merge branch 'feature/native-path-builder' 5cd9f75c refactor: extract smoothing factor constant, remove unused velocity recomputation, fix SkPath dispose 45f2b26f Merge pull request #1 from team-ppointer/feature/native-path-builder 0bf4eae2 docs: add rendering pipeline analysis and native technology guide 559df493 fix: strokeWidth prop now correctly applied in fixed-width mode 718b2019 refactor: remove TuningPanel, update pen sizes to 0.2/0.75/1.45mm 3b0d3a1f refactor: 1€ filter to RNGH only + trim tuning panel cb62aeb9 refactor: move 1€ filter to RNGH adapter only (finger/60Hz input) d4ad482e fix: migrate C++ to SkPathBuilder API + fix podspec header resolution c7a4b9c2 fix: thread targetSpacing through native buildCenterlinePath 9ee97bb3 feat: add 1€ filter for stylus input smoothing 735aebfc fix: reduce prefix/tail overlap to 1 sample to minimize AA seam c9ac6ac8 feat: add DPI-aware buildCenterlinePath for fixed-width rendering 6d7cd561 feat: add iOS predicted touches for lower-latency live rendering 66d69d12 refactor: deprecate variable-width rendering, use fixed-width only 8fa22881 docs: add JSDoc for nativeBuildCenterlinePath and packPoints 1aaceab2 fix: address third-round review findings 7b4c7e8f fix: address second-round review findings 98b739b7 fix: address remaining review findings for native path builder 17a95829 feat: add native C++ JSI path builder with Skia integration 1a2c93ff feat: add fixed-width mode, eraser cursor, and children overlay pattern 5c4c4429 Perf/memory optimization and fix live stroke end-taper artifact ca80947f Stabilize sample pipeline: recompute velocities, smooth centerline, EMA continuity 8ee16e35 Add example app for testing drawing features on iOS 05dc0708 Fix RN 0.85 + Skia 2.6.x compatibility and add pencilOnly prop 19d2f959 Fix codegen event array types: ReadonlyArray<Double> → Double[] git-subtree-dir: packages/pointer-native-drawing git-subtree-split: 503a9a7f746cb4fc56475b7dd3ddece0de2330eb
…/mat-240-drawing-extract # Conflicts: # packages/pointer-native-drawing/ios/StylusInputView.mm # packages/pointer-native-drawing/src/DrawingCanvas.tsx # packages/pointer-native-drawing/src/specs/StylusInputViewNativeComponent.ts
…indicator - Update pointer-native-drawing package to latest (subtree pull) - Add pencilOnly prop to both ScrapDetailScreen and ProblemScreen - Enable enableZoomPan on both screens - Add scroll indicator with black style to DrawingCanvas - Fix ProblemScreen minCanvasHeight to screenHeight * 2 - Rename text mode props (isTextMode -> isTextBoxMode, activeTool) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add undo/redo buttons to DrawingToolbar and ProblemDrawingToolbar - Add strokeColor state to useDrawingState with lastColor persistence - Save/load textBoxes in useHandwritingManager (getTextBoxes/setTextBoxes) - Add lastColor field to handwritingEncoder for color restoration - Export TextBoxData type from skia index - Wire onUndoStateChange callback to both screens Co-Authored-By: Claude Opus 4.6 (1M context) <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>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 108 out of 126 changed files in this pull request and generated 5 comments.
Files not reviewed (2)
- packages/pointer-native-drawing/example/ios/PointerDrawingExample.xcworkspace/contents.xcworkspacedata: Language not supported
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- useDrawingState에 markAsUnsaved 액션 추가하고 DrawingCanvas onChange에 연결하여 autosave 트리거 복원 - decodeHandwritingData에서 lastColor 필드를 반환하도록 수정 - setTextBoxes를 무조건 호출하여 빈 배열일 때도 기존 텍스트박스가 클리어되도록 수정 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ard) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- handleSave dependency array에 strokeColor 추가 (색상 변경 후 autosave 시 이전 색상으로 저장되던 문제) - clampTransform에서 canvasW/vpW가 0 이하일 때 early return으로 NaN 전파 방지 - smoothing.ts의 SkPath를 import type으로 분리 - encodeHandwritingData의 lastColor 조건을 != null로 개선 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- DrawingCanvas에 onDirty prop 추가 (stroke + textbox 변경 모두 감지) - useTextBoxManager: commitEditing, deleteSelected, endMove, endResize에서 onDirty 호출 - useDrawingDocumentController: notifyChange에서 onDirty 호출 - ScrapDetailScreen: onChange → onDirty로 교체 - DrawingToolbar, ProblemDrawingToolbar: onUndo/onRedo optional → required - ProblemScreen: minCanvasHeight 주석, runOnJS deprecated TODO 추가 - .gitignore: .omx/ 추가 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… MAT-198 color palette)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pointer-native-drawing에 eslint lint 스크립트 추가하고 루트 ci:lint 필터에 등록. 기존 코드의 prettier, import/order, no-explicit-any, no-unused-vars 에러 수정. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Related Issue Number
✅ Key Changes
add @repo/pointer-native-drawing package
migrate to shared package and remove unsupported props
ProblemScreen, ScrapDetailScreen DrawingCanvas 및 DrawingToolbar 연결 완료
ci:lint 필터 추가, lint script 추가, pointer-native-drawing package lint 에러 수정