[MAT-269] 필기 성능 최적화 + PR #262 리뷰 반영#285
Merged
b0nsu merged 15 commits intorefactor/mat-240-drawing-extractfrom Apr 17, 2026
Merged
[MAT-269] 필기 성능 최적화 + PR #262 리뷰 반영#285b0nsu merged 15 commits intorefactor/mat-240-drawing-extractfrom
b0nsu merged 15 commits intorefactor/mat-240-drawing-extractfrom
Conversation
…ering - Overhaul WritingFeelConfig: pressure gamma, velocity thinning, tilt, EMA smoothing - Add isFixedWidthConfig() detection for centerline vs polygon envelope rendering - Add buildVariableWidthPath with frozen prefix optimization for long strokes - Add arc-length resampling and velocity recomputation pipeline - Switch live path scheduling from rAF to queueMicrotask (1-frame latency reduction) - Convert live path from ref-based to state-based (skia v2 reconciliation requirement) - Add deferred SkPath dispose to prevent use-after-dispose in Skia Canvas - Add pencilOnly support in RNGH adapter with SharedValue for worklet access - Skip velocity computation and tilt calculation in fixed-width mode - Add eraser cursor visualization and React.memo on SkiaDrawingCanvasSurface Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tingFeel-tune # Conflicts: # packages/pointer-native-drawing/src/DrawingCanvas.tsx # packages/pointer-native-drawing/src/index.ts # packages/pointer-native-drawing/src/input/nativeStylusAdapter.tsx # packages/pointer-native-drawing/src/input/rnghPanAdapter.ts # packages/pointer-native-drawing/src/model/writingFeel.ts # packages/pointer-native-drawing/src/render/skia/SkiaDrawingCanvasSurface.tsx # packages/pointer-native-drawing/src/render/skia/skiaDrawingUtils.ts # packages/pointer-native-drawing/src/render/skia/useSkiaDrawingRenderer.ts # packages/pointer-native-drawing/src/smoothing.ts
…13b430 ce13b430 merge: native finger input Phase 2 tuning de8ecc3e fix: tune native finger input from device testing 3b5f7a51 feat: integrate native finger input for iOS (Phase 0+1) git-subtree-dir: packages/pointer-native-drawing git-subtree-split: ce13b4305ca54b4e381fe3c249d68073be7a6b23
- 버전 맞추기: reanimated ~4.1.6, gesture-handler ~2.28.0, typescript ~5.9.2 - podspec author/homepage/source를 team-ppointer로 변경 - useImperativeHandle stale ref 수정 (textBoxesRef 도입) - useTextBoxManager 인라인 객체 useMemo 감싸기 - TextBoxData 마이그레이션: width/height 없는 기존 데이터 fallback - committed paths dispose를 queueMicrotask로 지연 (live path과 동일 패턴) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
EraseStrokesEntry에 cachedPathsBefore 필드 추가. erase 시작 시 committedPaths 스냅샷을 history entry에 저장하고, undo 시 캐시된 paths를 직접 복원하여 O(ΣP) path rebuild 생략. - HistoryManager: cachedPathsBefore, onEntryEvicted 콜백, push/clear/discard 시 dispose - rendererTypes: replaceCommittedStrokes에 prebuiltPaths 파라미터, getCommittedPaths - useDrawingDocumentController: beginEraseTransaction/commitEraseTransaction 래퍼 - useDrawingInteractionController: docController 래퍼 호출로 변경 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
터치 이벤트를 Fabric EventEmitter 전에 native에서 인터셉트하여 path를 미리 빌드. JS는 getNativeLivePath()로 미리 빌드된 path를 사용. Native C++: - NativeDrawingSession: 포인트 축적, 속도 계산, frozen prefix path 빌드 - NativeDrawingLivePathBridge: thread-safe 정적 브릿지 (mutex + CallInvoker push) - StylusInputView: 터치 인터셉트, tilt 변환, config 동기화 (static activeView) JSI: - getNativeLivePath(): 최신 native path 복사 - setSessionConfig(): JS config → native session 동기화 - registerLivePathCallback(): CallInvoker push (Phase 3D, New Arch 미활성) TODO: Phase 3D New Arch CallInvoker 접근 방식 수정 (별도 PR) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Stroke.points/samples가 Point[]|Float64Array 둘 다 지원. 새 stroke는 finalizeStroke에서 Float64Array로 생성 (메모리 60-70% 절감, GC 0). - drawingTypes: packed stride 상수, pack/unpack 헬퍼, 접근 함수 - DrawingEngine: finalizeStroke에서 packPoints/packSamplesArray 사용 - strokeUtils: deepCopyStrokes, getStrokeBounds, getMaxY Float64Array 지원 - smoothing: buildSmoothPath/buildCenterlinePath union 시그니처 + unpack fallback - nativePathBuilder: packSamples Float64Array 직통 (re-pack 생략) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
JSON.stringify → binary packing (DataView + ArrayBuffer → base64). decode 시 자동 감지 (첫 바이트 0x01=binary, 그 외=legacy JSON). Float64Array stroke 직접 encode/decode (Phase 4-A 연동). - timestamp 정밀도: stroke별 baseTimestamp(float64) + delta offset(float32) - 색상 테이블: stroke color 중복 제거 - 하위 호환: 기존 JSON 데이터 + TextBoxData 마이그레이션 유지 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
TanStack Query 백그라운드 refetch 시 setStrokes 재호출 방지. initialLoadDoneRef로 초기 1회만 데이터 로드. 근본 해결: refactor/mat-313에서 useHandwritingManager 구조 리팩토링 필요. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- unused imports 제거 (useCallback, useRef, DocumentSnapshot, ReadonlyPoint) - unused destructuring에 _ prefix (historyRef, maxYRef) - no-explicit-any → HistoryEntry 타입 캐스팅 + eslint-disable 주석 - prettier 자동 포맷팅 적용 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Phase 4-D binary encoder → JSON 원복 (Float64Array→object 변환 후 JSON.stringify) - binary 데이터 감지 시 빈 캔버스로 fallback (테스트 중 저장된 binary 대응) - useDrawingState: markAsUnsaved 액션 추가 - ScrapDetailScreen: onChange → markAsUnsaved 연결 → autosave 활성화 - useHandwritingManager: unmount 시 저장 (뒤로가기/탭 전환 대응) - lastSavedDataRef 비교로 query refetch 시 중복 로드 방지 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
base 브랜치 변경사항 통합. mat-269 최적화 코드 유지. 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.
Summary
필기 캔버스(pointer-native-drawing)의 성능 최적화 및 PR #262 sterdsterd 리뷰 반영. erase undo path 캐싱, native drawing session, Float64Array stroke 전환을 통해 전반적인 레이턴시 및 메모리 사용량을 개선합니다.
Linear
Changes
PR #262 리뷰 반영
Phase 4-C: Erase Undo Path 캐싱
Phase 3: Native Drawing Session
Phase 4-A: Float64Array Stroke
Point[] | Float64Arraydual type 지원저장 버그 수정
Testing
Risk / Impact