feat(native/bridge): web fallbacks for all hooks + useNativeTransition page transitions#245
Merged
mayankmahavar1mg merged 2 commits intoMay 26, 2026
Conversation
… with web fallbacks - Extract all 9 hooks from monolithic hooks.js into src/native/bridge/hooks/ (one file per domain) - hooks.js becomes a 2-line re-export shim for backwards compatibility - Add web fallbacks for useVideoStream, useCamera, useCameraPermission, useFilePicker, useHapticFeedback, useDataProtection, useNetworkStatus, useSafeArea, useDeviceInfo - Fix useBaseHook isNative detection to use nativeBridge.isAvailable() instead of raw window check - Fix Rules of Hooks violations in useDataProtection, useFilePicker, useCamera - Add isNative/isWeb to useSafeArea, useNetworkStatus, useDeviceInfo return shapes - Fix useNotification interface alignment (add schedule alias, requestPermission, isNative/isWeb) - Add webFallback prop dynamic sync to all hooks via useEffect - Update KB with 4 new entries: notification config, sound asset, googleSignIn config, useBaseHook fix Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… implementation - Add TransitionManager.kt: snapshot overlay pattern using Canvas bitmap, ImageView on decorView, Handler safety timeout, slide/fade animations - Wire startTransition/commitTransition/cancelTransition in NativeBridge.kt and BridgeUtils.kt (options parsing, delegation, malformed JSON safety) - Add useNativeTransition.js hook: wraps useNavigate, CSS overlay web fallback, rAF double-frame commit, per-call configurable timeout - Add transition bridge helpers to NativeBridge.js (start/commit/cancel) - Register transition commands in NativeInterfaces.js - Export useNativeTransition from hooks/index.js Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
DeputyDev will no longer review pull requests automatically.To request a review, simply comment #review on your pull request—this will trigger an on-demand review whenever you need it. |
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.
Description:
webFallbackprop is synchronous source of truth; overrides internal state.Bug fixes included:
useBaseHook:isNativedetection fixed to usenativeBridge.isAvailable()instead of
window.WebBridgecheck (was alwaysfalseon real Android devices)useDataProtection,useFilePicker,useCameraisNative/isWebadded to thin-state hooks (useSafeArea,useNetworkStatus,useDeviceInfo)hooks.jsretained as re-export shim for backwards compatibility2. useNativeTransition
Snapshot overlay pattern for native-quality page transitions:
navigate(to, opts)→ bridgestartTransitioncommitTransition→ native animates overlay outWeb fallback: CSS overlay +
requestAnimationFramedouble-frame commit.Android:
TransitionManager.kt— Canvas bitmap,ImageViewondecorView,Handlersafety timer, slide/fadeObjectAnimator. Bridge wired inNativeBridge.kt+BridgeUtils.kt.JS:
useNativeTransition.jshook,NativeBridge.jshelpers, commandregistrations in
NativeInterfaces.js.iOS implementation complete but not included in this PR (pending iOS-only commit).
Files changed
NativeBridge.kt,BridgeUtils.kt,TransitionManager.ktNativeBridge.js,NativeInterfaces.js,useBaseHook.jshooks/directory (11 files),hooks.jsshimknowledge-base.json(114 entries)