Skip to content

fix: open block explorer link from address detail sheet#83

Open
Sednaoui wants to merge 2 commits into
developfrom
fix/block-explorer-link
Open

fix: open block explorer link from address detail sheet#83
Sednaoui wants to merge 2 commits into
developfrom
fix/block-explorer-link

Conversation

@Sednaoui
Copy link
Copy Markdown
Member

@Sednaoui Sednaoui commented May 11, 2026

Tapping "View on Block Explorer" in the address detail sheet did nothing on Android 11+. Two causes:

  1. AndroidManifest.xml didn't declare a <queries> intent for the https scheme, so canLaunchUrl returned false on Android 11+ even though the OS could open the URL.
  2. The handler gated launchUrl behind canLaunchUrl, 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 AddressWidget in 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

  • Bug Fixes
    • Improved block explorer link behavior from address details: sheet now closes immediately, links open more reliably, and failures show a clearer snackbar message.
    • Enhanced Android intent declarations to better handle https VIEW links, improving URL-handling compatibility on Android devices.

Review Change Stack

Review Change Stack

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
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5776d076-3e3b-4e73-8a2a-30991dfe01dc

📥 Commits

Reviewing files that changed from the base of the PR and between 8e839b9 and 76b6d0f.

📒 Files selected for processing (1)
  • lib/shared/widgets/address_detail_sheet.dart
🚧 Files skipped from review as they are similar to previous changes (1)
  • lib/shared/widgets/address_detail_sheet.dart

📝 Walkthrough

Walkthrough

This PR adds an Android <intent> query for VIEW+https and simplifies the address detail sheet's _handleExplorer to pop the sheet and call launchUrl directly, showing a snackbar on failure.

Changes

Block Explorer URL Opening

Layer / File(s) Summary
Android Manifest HTTPS Intent Declaration
android/app/src/main/AndroidManifest.xml
Added <intent> filter under <queries> to declare visibility for android.intent.action.VIEW intents with https scheme.
Block Explorer Launch Logic
lib/shared/widgets/address_detail_sheet.dart
Refactored _handleExplorer to dismiss the bottom sheet before launching, removed canLaunchUrl check, and simplified to direct launchUrl call with unified failure snackbar handling.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A rabbit hops to Etherscan's door,
No manifest guards stopped it before!
With HTTPS declared and launch made clean,
Block explorer links now spark the screen.
Pop the sheet and off it goes—
Where blockchain data blooms and flows! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: open block explorer link from address detail sheet' directly describes the main change - fixing the functionality to open block explorer links from the address detail UI.
Linked Issues check ✅ Passed The PR addresses all coding requirements from issue #80: declaring https scheme in AndroidManifest.xml for Android 11+ package visibility, updating _handleExplorer to reliably launch URLs without gatekeeping behind unreliable canLaunchUrl checks, and showing error feedback via snackbar on failures.
Out of Scope Changes check ✅ Passed All changes are scoped to fixing the block explorer link functionality: AndroidManifest.xml intent declaration and _handleExplorer improvements directly address issue #80 requirements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@Sednaoui Sednaoui requested a review from andrewwahid May 11, 2026 16:53
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between df57bd9 and 8e839b9.

📒 Files selected for processing (2)
  • android/app/src/main/AndroidManifest.xml
  • lib/shared/widgets/address_detail_sheet.dart

Comment thread lib/shared/widgets/address_detail_sheet.dart Outdated
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug Simulation Review: block explorer doesn't open when clicking on it it in allowance page

1 participant