Skip to content

feat(simulation): tap token name to view contract address#84

Merged
Sednaoui merged 3 commits into
developfrom
feat/tappable-token-address
May 18, 2026
Merged

feat(simulation): tap token name to view contract address#84
Sednaoui merged 3 commits into
developfrom
feat/tappable-token-address

Conversation

@Sednaoui
Copy link
Copy Markdown
Member

@Sednaoui Sednaoui commented May 11, 2026

Summary by CodeRabbit

  • New Features
    • Token symbols and logos in transaction simulations are interactive—tap to view token contract address details.
    • NFT collection headers (image and name/symbol) are tappable to view collection address information.
    • Token and collection labels in allowance and revoked-allowance messages are now tappable and use dotted-underline styling for improved discoverability.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

📝 Walkthrough

Walkthrough

SafeTxSimulationScreen adds tappable token and NFT labels/logos that open an AddressDetailSheet via a modal bottom sheet; new helpers (_tokenLogo, _inlineTokenSpan, _inlineTappableLabelSpan, _showTokenDetail) centralize logo rendering and tappable, dotted-underlined inline labels.

Changes

Interactive Token Details in Transaction Simulation

Layer / File(s) Summary
Dependency Addition
lib/features/verify_safe_transaction/simulation/safe_tx_simulation_screen.dart
Import AddressDetailSheet to enable address detail modals.
Bottom sheet handler & UI helpers
lib/features/verify_safe_transaction/simulation/safe_tx_simulation_screen.dart
Adds _showTokenDetail and helpers _tokenLogo, _inlineTokenSpan, _inlineTappableLabelSpan for tappable, dotted-underlined token/NFT labels and logos.
Token Transfer UI
lib/features/verify_safe_transaction/simulation/safe_tx_simulation_screen.dart
Wrap token logo+symbol in a GestureDetector that opens _showTokenDetail; apply dotted-underline styling to the symbol.
Token Allowance UI
lib/features/verify_safe_transaction/simulation/safe_tx_simulation_screen.dart
Replace inline token icon/text with _inlineTokenSpan in allowance messages so token labels are tappable and dotted-underlined while keeping spender AddressWidget.
Revoked Token Allowance UI
lib/features/verify_safe_transaction/simulation/safe_tx_simulation_screen.dart
Replace inline token icon/text with _inlineTokenSpan in revoked allowance messages to make token labels tappable.
NFT Transfer UI
lib/features/verify_safe_transaction/simulation/safe_tx_simulation_screen.dart
Wrap NFT collection image and collection name/symbol in GestureDetectors that open _showTokenDetail; render collection label with dotted underline.
NFT Allowance UI
lib/features/verify_safe_transaction/simulation/safe_tx_simulation_screen.dart
Use _inlineTappableLabelSpan in NFT allowance messages so collection name/symbol is tappable and dotted-underlined (ALL and non-ALL cases).
Revoked NFT Allowance UI
lib/features/verify_safe_transaction/simulation/safe_tx_simulation_screen.dart
Use _inlineTappableLabelSpan in revoked NFT allowance messages so collection label is tappable and dotted-underlined.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Suggested reviewers

  • sherifahmed990
  • andrewwahid

Poem

🐰 A tap, a click, a detail gleams,
Token addresses flow like digital streams,
Collections shimmer with underlined grace,
Each address revealed in its rightful place,
Safe sim now hops with curiosity’s pace.

🚥 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 describes the primary feature added (tap-to-view token details), but the changes also include similar functionality for NFT collections, which is equally significant but not mentioned.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

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/features/verify_safe_transaction/simulation/safe_tx_simulation_screen.dart`:
- Around line 303-305: Replace the non-keyboard-accessible GestureDetector
usages that wrap token/NFT rows with a Semantics + InkWell pattern so keyboard
and screen-reader users can activate _showTokenDetail; specifically, locate the
widgets that call _showTokenDetail(context, tokenAddress) and the other two
similar GestureDetector instances and wrap the row in Semantics(button: true,
onTapHint: 'Open token details') and an InkWell (or InkResponse) with onTap
calling _showTokenDetail instead of GestureDetector.onTap; ensure the InkWell
contains the same child Row and preserve any visual feedback and hit testing
behavior.
🪄 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: 2e3705a4-c108-40ea-8b2d-59c68de37148

📥 Commits

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

📒 Files selected for processing (1)
  • lib/features/verify_safe_transaction/simulation/safe_tx_simulation_screen.dart

Copy link
Copy Markdown
Member

@andrewwahid andrewwahid left a comment

Choose a reason for hiding this comment

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

LGTM

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

🧹 Nitpick comments (1)
lib/features/verify_safe_transaction/simulation/safe_tx_simulation_screen.dart (1)

466-466: 💤 Low value

Verify intentional font size difference between token and NFT allowances.

Token allowance messages (lines 466, 523) use fontSize: 14, while NFT allowance messages (lines 794, 878) remain at fontSize: 12. If this difference is intentional (e.g., NFT rows already have larger images), that's fine. Otherwise, consider unifying the font sizes for visual consistency.

Also applies to: 523-523, 794-794, 878-878

🤖 Prompt for 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.

In
`@lib/features/verify_safe_transaction/simulation/safe_tx_simulation_screen.dart`
at line 466, The token allowance message uses TextStyle(fontSize: 14, color:
Colors.grey[600], fontWeight: FontWeight.bold) while NFT allowance messages use
fontSize: 12; decide which size should be the standard (14 or 12) and make them
consistent: locate the TextStyle(...) occurrences used for token allowance text
and the NFT allowance rows in safe_tx_simulation_screen.dart and update the
fontSize value in the NFT TextStyle instances (or the token ones) so both token
and NFT allowance messages use the same fontSize; ensure you update all
occurrences (the shown TextStyle(...) instance and the corresponding NFT
TextStyle usages) so visual consistency is preserved.
🤖 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/features/verify_safe_transaction/simulation/safe_tx_simulation_screen.dart`:
- Around line 277-292: _tokenLogo currently uses a hardcoded fontSize (17) and
lacks image error handling; update the widget so the placeholder "?" text scales
with the provided size parameter (e.g., compute fontSize as a fraction of size)
and add an errorBuilder to Image.network to show the same fallback (centered "?"
or the same icon) when the image fails to load; this change will fix overflow
when _tokenLogo is called from _inlineTokenSpan and make behavior consistent
with _buildNFTImageContent.

---

Nitpick comments:
In
`@lib/features/verify_safe_transaction/simulation/safe_tx_simulation_screen.dart`:
- Line 466: The token allowance message uses TextStyle(fontSize: 14, color:
Colors.grey[600], fontWeight: FontWeight.bold) while NFT allowance messages use
fontSize: 12; decide which size should be the standard (14 or 12) and make them
consistent: locate the TextStyle(...) occurrences used for token allowance text
and the NFT allowance rows in safe_tx_simulation_screen.dart and update the
fontSize value in the NFT TextStyle instances (or the token ones) so both token
and NFT allowance messages use the same fontSize; ensure you update all
occurrences (the shown TextStyle(...) instance and the corresponding NFT
TextStyle usages) so visual consistency is preserved.
🪄 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: eae31c68-9511-4539-9cf4-9c20d978e9a6

📥 Commits

Reviewing files that changed from the base of the PR and between f7b4657 and 23068e1.

📒 Files selected for processing (1)
  • lib/features/verify_safe_transaction/simulation/safe_tx_simulation_screen.dart

Comment on lines +277 to +292
Widget _tokenLogo(String logoUri, double size) {
return SizedBox(
width: size,
height: size,
child: ClipRRect(
borderRadius: BorderRadius.circular(70),
child: logoUri == "unknown"
? Container(
alignment: Alignment.center,
color: Colors.grey,
child: const Text("?", style: TextStyle(fontSize: 17, fontWeight: FontWeight.bold)),
)
: Image.network(logoUri),
),
);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Fix hardcoded font size and add error handling to _tokenLogo.

Two issues:

  1. Font size overflow: Line 287 hardcodes fontSize: 17 regardless of the size parameter. When size=14 (called from _inlineTokenSpan line 308), the 17px text overflows the 14×14 container. The font size should scale proportionally with the container.

  2. Missing error handling: Image.network has no errorBuilder. If the image fails to load, the widget shows blank space. This is inconsistent with _buildNFTImageContent (lines 1366–1411), which provides a fallback icon.

🔧 Proposed fix
 Widget _tokenLogo(String logoUri, double size) {
   return SizedBox(
     width: size,
     height: size,
     child: ClipRRect(
-      borderRadius: BorderRadius.circular(70),
+      borderRadius: BorderRadius.circular(size / 2),
       child: logoUri == "unknown"
           ? Container(
               alignment: Alignment.center,
               color: Colors.grey,
-              child: const Text("?", style: TextStyle(fontSize: 17, fontWeight: FontWeight.bold)),
+              child: Text(
+                "?",
+                style: TextStyle(
+                  fontSize: size * 0.68,
+                  fontWeight: FontWeight.bold,
+                ),
+              ),
             )
-          : Image.network(logoUri),
+          : Image.network(
+              logoUri,
+              errorBuilder: (context, error, stackTrace) {
+                return Container(
+                  alignment: Alignment.center,
+                  color: Colors.grey,
+                  child: Icon(
+                    Icons.broken_image,
+                    size: size * 0.6,
+                    color: Colors.grey[600],
+                  ),
+                );
+              },
+            ),
     ),
   );
 }
🤖 Prompt for 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.

In
`@lib/features/verify_safe_transaction/simulation/safe_tx_simulation_screen.dart`
around lines 277 - 292, _tokenLogo currently uses a hardcoded fontSize (17) and
lacks image error handling; update the widget so the placeholder "?" text scales
with the provided size parameter (e.g., compute fontSize as a fraction of size)
and add an errorBuilder to Image.network to show the same fallback (centered "?"
or the same icon) when the image fails to load; this change will fix overflow
when _tokenLogo is called from _inlineTokenSpan and make behavior consistent
with _buildNFTImageContent.

@Sednaoui Sednaoui merged commit 196fa4f into develop May 18, 2026
1 check passed
@Sednaoui Sednaoui deleted the feat/tappable-token-address branch May 18, 2026 13:11
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.

2 participants