SELF-2650: Add WebView Ethereum bridge PoC with common bridge, Android/iOS implementations, and UI#1989
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a multiplatform WebView Ethereum bridge: shared request/response models and method registry, a Compose screen and navigation to exercise it, plus platform-specific WebView integrations for Android and iOS that route JS requests to native handlers and return responses. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 35fdc02225
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Greptile SummaryThis PR adds a proof-of-concept native↔WebView Ethereum bridge to the The common layer (
Confidence Score: 2/5Not safe to merge — the Android demo is non-functional due to stub injection ordering, and the iOS implementation has an incomplete escaping chain and a memory leak. The common layer is solid, but both platform implementations have concrete correctness problems: the Android bridge produces a broken demo (P0 —
Important Files Changed
|
There was a problem hiding this comment.
Actionable comments posted: 4
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: b32f47c0-eb3a-4854-939d-dcfd187d18b1
📒 Files selected for processing (6)
packages/kmp-minipay-sample/composeApp/src/androidMain/kotlin/xyz/self/minipay/webview/PlatformWebViewBridge.android.ktpackages/kmp-minipay-sample/composeApp/src/commonMain/kotlin/xyz/self/minipay/App.ktpackages/kmp-minipay-sample/composeApp/src/commonMain/kotlin/xyz/self/minipay/screens/HomeScreen.ktpackages/kmp-minipay-sample/composeApp/src/commonMain/kotlin/xyz/self/minipay/screens/WebViewBridgeScreen.ktpackages/kmp-minipay-sample/composeApp/src/commonMain/kotlin/xyz/self/minipay/webview/EthereumBridge.ktpackages/kmp-minipay-sample/composeApp/src/iosMain/kotlin/xyz/self/minipay/webview/PlatformWebViewBridge.ios.kt
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 232769be-0768-447c-a1a9-2e541c04e55e
📒 Files selected for processing (3)
packages/kmp-minipay-sample/composeApp/src/androidMain/kotlin/xyz/self/minipay/webview/PlatformWebViewBridge.android.ktpackages/kmp-minipay-sample/composeApp/src/commonMain/kotlin/xyz/self/minipay/webview/EthereumBridge.ktpackages/kmp-minipay-sample/composeApp/src/iosMain/kotlin/xyz/self/minipay/webview/PlatformWebViewBridge.ios.kt
✅ Files skipped from review due to trivial changes (1)
- packages/kmp-minipay-sample/composeApp/src/androidMain/kotlin/xyz/self/minipay/webview/PlatformWebViewBridge.android.kt
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/kmp-minipay-sample/composeApp/src/iosMain/kotlin/xyz/self/minipay/webview/PlatformWebViewBridge.ios.kt
Motivation
window.ethereum.request-style API to demo provider methods from the sample app.Description
webview/EthereumBridge.kt, includingProviderRequest,ProviderResponse,ProviderError,MethodRegistry,BridgeMethodException,ETHEREUM_BRIDGE_STUB, andBRIDGE_DEMO_HTML.WebViewBridgeScreencomposable that registers demo methodsdemo_echoanddemo_rejectand callsPlatformWebViewBridge(registry); declares theexpectfor the platform implementation.PlatformWebViewBridge.android.ktwhich wires aWebView, injects the JS stub, registers aJavascriptInterface, decodesProviderRequest, dispatches toMethodRegistry, and evaluates the response JS callback.PlatformWebViewBridge.ios.ktusingWKWebViewandWKScriptMessageHandler, injecting the JS stub and sending responses viaevaluateJavaScript.webview-bridgeroute inApp.kt, and a button onHomeScreenthat navigates to the WebView Bridge PoC.Testing
Codex Task
Summary by CodeRabbit