feat: add OneKey native image component - #90
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Automated code review found blocking issuesReviewed commit Review summaryBefore: the repository had no OneKey-owned cross-platform image surface, and the tab/skeleton components used their existing native implementations. After: a new Nitro OneKeyImage view routes React props through generated bindings into SDWebImage on iOS and Glide on Android, with cache controls, TOS resizing, placeholders/fallbacks, animated-image safety checks, preload APIs, and lifecycle callbacks. Supporting work adds shared skeleton rendering, lazy tab placeholders and rejected-tab rollback, example coverage, native dependency wiring, and regenerated Nitro bindings. Existing image consumers and unrelated native modules remain behaviorally unchanged except for the explicitly updated Nitro/runtime version alignment. What needs attention: Please resolve the preload input contract, Android display lifecycle parity, and the cross-platform animated-image safety-limit mismatch before merging. Issues to address
Validation gapsThe added unit tests cover many pure helpers and wrapper transitions, but no full native build or device-level test was run in this checkout because the Yarn install state is absent. Add integration coverage for invalid preload inputs, detach/reattach display callbacks, and a boundary animated canvas accepted or rejected consistently on both platforms. |
|
Review follow-up completed in 505e4da.
Validation: image Jest 15/15; image and skeleton typecheck/lint passed; image Android JVM tests 46/46; image and skeleton Kotlin compilation passed; example app compileDebugKotlin passed. iOS was source-audited against its existing attachment, animated-boundary, and frame-buffer tests. No device tests or npm publish were run. |
Summary
@onekeyfe/react-native-imageNitro HybridView backed by SDWebImage and Glide, with native placeholder/fallback rendering, preload/cache APIs, lifecycle events, recycling, TOS resizing, and bounded decode safety.@onekeyfe/*patches into app-modules.@onekeyfe/react-native-tab-viewwith the existing animation, selection, haptics, iOS immediate-transition, TypeScript compatibility, and Android inactive-scene touch interception fixes.onDisplayuntil the native view is attached.Image safety behavior
Verification
SDImageCache.shared, use value-stable cache identities, and have no Android-style object-identity issue.@onekeyfe/react-native-image@3.0.101and all 37 packages, with 3.0.101 on thelatestdist-tag.