fix: open block explorer link from address detail sheet#83
Conversation
Declare https VIEW intent in AndroidManifest so canLaunchUrl resolves on Android 11+, and drop the canLaunchUrl gate in the detail sheet so the explorer button works on platforms where canLaunchUrl is unreliable. Pop the sheet before launching so the user lands back on the underlying screen. Closes #80
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR adds an Android ChangesBlock Explorer URL Opening
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@lib/shared/widgets/address_detail_sheet.dart`:
- Around line 51-53: The call to launchUrl(uri, mode:
LaunchMode.externalApplication) can return false on failure and is currently
ignored, causing silent failures; change the code around that call (the async
handler where launchUrl(...) is awaited and the existing catch block is) to
capture the boolean result, and if it is false call messenger.showSnackBar with
a user-friendly error message (keeping the existing catch block to handle thrown
exceptions), ensuring the message is shown when launchUrl returns false;
reference the existing launchUrl(...) invocation and messenger.showSnackBar to
locate where to add the check.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 97db31ef-6d93-462c-aa31-4a95591723d8
📒 Files selected for processing (2)
android/app/src/main/AndroidManifest.xmllib/shared/widgets/address_detail_sheet.dart
launchUrl returns Future<bool>; on Android it can resolve to false without throwing when no activity handles the intent. Capture the result and show the same error snackbar so failures are not silent.
Tapping "View on Block Explorer" in the address detail sheet did nothing on Android 11+. Two causes:
AndroidManifest.xmldidn't declare a<queries>intent for thehttpsscheme, socanLaunchUrlreturned false on Android 11+ even though the OS could open the URL.launchUrlbehindcanLaunchUrl, which is unreliable across platforms, and left the bottom sheet open so the error snackbar was hidden underneath.The same code path is used by every
AddressWidgetin the app, so this affected allowances, transfers, account list, and Safe API cards — not just the allowance page where it was reported.Closes #80
Summary by CodeRabbit