Skip to content

Conversation

@runway-github
Copy link
Contributor

@runway-github runway-github bot commented Oct 24, 2025

Description

Render wallet and account name if the recipient is an imported account,
else render the truncated wallet address if the recipient is an external
account. We also introduced some refactoring to make us scale the
QuestDetailsCard by extracting UI and business logic to separate
components.

Changelog

CHANGELOG entry: Render wallet and account name if the recipient is an
imported account, else render the truncated wallet address if the
recipient is an external account.

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/SWAPS-3311

Manual testing steps

  Scenario: user views bridge quote with wallet and account name
    Given user is on bridge quote details screen
    And recipient is set to "Account 1" in "Wallet 1"

    When bridge quote details are displayed
    Then recipient row shows "Wallet 1 / Account 1"


  Scenario: user views bridge quote with external address as recipient
    Given user is on bridge quote details screen
    And recipient is set to external address "0x1234567890123456789012345678901234567890"

    When bridge quote details are displayed
    Then recipient row shows shortened address "0x12345...67890"

  Scenario: user opens recipient selector
    Given user is on bridge quote details screen
    And recipient is set to "Account 1"

    When user taps recipient selector button
    Then recipient selector modal opens

  Scenario: user views swap quote details
    Given user is performing a swap (not a bridge)
    And swap quote details are displayed

    When bridge recipient row renders
    Then recipient row is not displayed


  Scenario: user views bridge quote with no recipient address
    Given user is on bridge quote details screen
    And no recipient address is available

    When bridge quote details are displayed
    Then recipient row shows "Select recipient" placeholder
    And no shortened address is displayed

Screenshots/Recordings

Before

After

image

image

image

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the
    app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described
    in the ticket it closes and includes the necessary testing evidence such
    as recordings and or screenshots.

Note

Introduces a dedicated recipient row component powered by a new hook to display wallet/account names or a shortened external address, and wires it into QuoteDetailsCard with updated tests and snapshots.

  • Bridge UI:
    • Recipient row extraction: Move recipient display from QuoteDetailsCard to components/QuoteDetailsRecipientKeyValueRow/QuoteDetailsRecipientKeyValueRow with dedicated styles.
    • New hook: Add hooks/useRecipientDisplayData to resolve recipient display name, wallet name, and address (supports multichain and external addresses).
    • QuoteDetailsCard:
      • Remove inline recipient logic/selectors and insert QuoteDetailsRecipientKeyValueRow.
      • Minor import cleanup; no behavioral changes to other rows.
  • Tests:
    • Add tests for QuoteDetailsRecipientKeyValueRow and useRecipientDisplayData.
    • Update QuoteDetailsCard test mocks and snapshots to reflect new recipient row structure.

Written by Cursor Bugbot for commit f3be9c4. This will update automatically on new commits. Configure here.

2fcd667

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

Render wallet and account name if the recipient is an imported account,
else render the truncated wallet address if the recipient is an external
account. We also introduced some refactoring to make us scale the
`QuestDetailsCard` by extracting UI and business logic to separate
components.

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: Render wallet and account name if the recipient is an
imported account, else render the truncated wallet address if the
recipient is an external account.

Fixes: https://consensyssoftware.atlassian.net/browse/SWAPS-3311

```gherkin
  Scenario: user views bridge quote with wallet and account name
    Given user is on bridge quote details screen
    And recipient is set to "Account 1" in "Wallet 1"

    When bridge quote details are displayed
    Then recipient row shows "Wallet 1 / Account 1"

  Scenario: user views bridge quote with external address as recipient
    Given user is on bridge quote details screen
    And recipient is set to external address "0x1234567890123456789012345678901234567890"

    When bridge quote details are displayed
    Then recipient row shows shortened address "0x12345...67890"

  Scenario: user opens recipient selector
    Given user is on bridge quote details screen
    And recipient is set to "Account 1"

    When user taps recipient selector button
    Then recipient selector modal opens

  Scenario: user views swap quote details
    Given user is performing a swap (not a bridge)
    And swap quote details are displayed

    When bridge recipient row renders
    Then recipient row is not displayed

  Scenario: user views bridge quote with no recipient address
    Given user is on bridge quote details screen
    And no recipient address is available

    When bridge quote details are displayed
    Then recipient row shows "Select recipient" placeholder
    And no shortened address is displayed
```

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

<!-- [screenshots/recordings] -->

<!-- [screenshots/recordings] -->

<img width="786" height="293" alt="image"
src="https://github.com/user-attachments/assets/179c99cb-1f5a-4451-9929-6519e9a60d31"
/>

<img width="786" height="293" alt="image"
src="https://github.com/user-attachments/assets/20409fb5-ca18-40e6-ac0b-92bf9ac02750"
/>

<img width="786" height="293" alt="image"
src="https://github.com/user-attachments/assets/3ac89b42-a9c9-454e-9a60-e89018319fb2"
/>

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Extracts the recipient row from QuoteDetailsCard into a dedicated
component powered by a new hook to display wallet/account names or a
shortened external address, and updates tests/snapshots.
>
> - **Bridge UI**:
> - **Recipient Row**: Replaces inline recipient logic in
`QuoteDetailsCard` with `QuoteDetailsRecipientKeyValueRow`, which
navigates to the recipient selector and hides on swaps.
> - Displays `walletName / accountName` for internal accounts or a
shortened address for external recipients.
> - **Hooks**:
> - Adds `useRecipientDisplayData` (`hooks/useRecipientDisplayData`) to
derive `destinationDisplayName`, `destinationWalletName`, and
`destinationAccountAddress` using multichain selectors and feature flag.
> - **Styles**:
> - Adds `QuoteDetailsRecipientKeyValueRow.styles.ts` for layout and
text truncation.
> - **Tests**:
> - Adds unit tests for `QuoteDetailsRecipientKeyValueRow` and
`useRecipientDisplayData`.
> - Updates `QuoteDetailsCard.test.tsx` mocks (multichain selectors) and
snapshots to reflect new recipient row structure.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
7db0035. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@runway-github runway-github bot requested a review from a team as a code owner October 24, 2025 18:00
@github-actions
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label Oct 24, 2025
accountNameText: {
flexShrink: 0,
minWidth: 0,
},
Copy link

Choose a reason for hiding this comment

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

Bug: Text Overflow in Single-Line Component

The accountNameText style uses flexShrink: 0, which prevents long wallet and account names from truncating. This can cause text overflow and layout issues, especially when the component expects a single line.

Fix in Cursor Fix in Web

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size-L team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants