Skip to content

refactor: migrate BaseAccountDetails and SmartAccountModal#29766

Merged
gantunesr merged 11 commits into
mainfrom
gar/refactor/mul-1689/part-2
May 26, 2026
Merged

refactor: migrate BaseAccountDetails and SmartAccountModal#29766
gantunesr merged 11 commits into
mainfrom
gar/refactor/mul-1689/part-2

Conversation

@gantunesr
Copy link
Copy Markdown
Member

@gantunesr gantunesr commented May 5, 2026

Description

Part 2 of 2 for MUL-1689. Base branch: gar/refactor/mul-1689/part-1 (merge part 1 first, or rebase this branch onto main after part 1 lands and retarget to main).

Migrates the Account Details shell and related tests from app/component-library to @metamask/design-system-react-native:

  • BaseAccountDetails/index.tsx — design-system HeaderBase (titleTestID for title queries), startButtonIconProps for back, AvatarAccount with mapping from settings AvatarAccountType to AvatarAccountVariant, Text / Icon with semantic tokens.
  • BaseAccountDetails/styles.ts — remove obsolete text color style now covered by TextColor.
  • SmartAccountModal.tsx — design-system HeaderBase, Text, nested learn-more Text with TextColor.InfoDefault.
  • Tests — narrower AvatarAccountType import path; HardwareAccountDetails header title assertion uses the same header-title test id as design-system HeaderBase.

Depends on part 1 for a consistent Account Details tree.

Changelog

CHANGELOG entry: null

Related issues

Refs: https://consensyssoftware.atlassian.net/browse/MUL-1689

Manual testing steps

Feature: Multichain Account Details (shell and modal, part 2)

  Scenario: Account details header and back navigation
    Given the user opened Multichain Account Details from the accounts flow
    When the header shows the account name
    Then the back control returns to the previous screen without layout regressions

  Scenario: Smart Account modal from account details
    Given an EVM account with Smart Account entry available
    When the user opens the Smart Account modal
    Then the modal title and description render and Learn more opens the webview flow as before

Screenshots/Recordings

Simulator Screenshot - iPhone 16 - 2026-05-19 at 17 19 07 Simulator Screenshot - iPhone 16 - 2026-05-19 at 17 20 09

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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

Low Risk
UI-only component swap with preserved navigation, test IDs, and avatar mapping; no auth or credential logic changes in this diff.

Overview
Migrates the multichain Account Details shell (BaseAccountDetails) and Smart Account modal from app/component-library to @metamask/design-system-react-native, keeping behavior and test IDs aligned with the previous UI.

BaseAccountDetails now uses design-system HeaderBase with titleTestID header-title and startButtonIconProps for back (replacing ButtonLink + Icon), AvatarAccount with a toAvatarAccountVariant bridge from settings AvatarAccountType, and Text / Icon with TextVariant, FontWeight, TextColor, and IconColor instead of theme-driven styles. Row styling drops the local text color rule in favor of tokens.

SmartAccountModal follows the same header pattern and updates body copy to design-system Text, including learn-more styling via TextColor.InfoDefault.

Related unit tests import AvatarAccountType from the narrower path and assert the header title via header-title where the legacy HEADERBASE_TITLE_TEST_ID constant was removed.

Reviewed by Cursor Bugbot for commit 92afdd3. Bugbot is set up for automated code reviews on this repo. Configure here.

gantunesr and others added 2 commits May 5, 2026 18:05
…n system (MUL-1689)

Migrate AccountInfo, ExportCredentials, SmartAccount, and SmartAccountNetworkList
from component-library to @metamask/design-system-react-native. Update SmartAccount
unit test Icon import.

Part 1 of 2 for MUL-1689.

Co-authored-by: Cursor <cursoragent@cursor.com>
…l (MUL-1689)

Migrate BaseAccountDetails and SmartAccountModal to design-system HeaderBase,
AvatarAccount, Text, and Icon. Align tests with design-system Header title test id
and narrower AvatarAccountType imports.

Part 2 of 2 for MUL-1689; stack on gar/refactor/mul-1689/part-1.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gantunesr gantunesr self-assigned this May 5, 2026
@metamaskbotv2 metamaskbotv2 Bot added the team-accounts-framework Accounts team label May 5, 2026
@github-actions github-actions Bot added the size-M label May 5, 2026
Import Skeleton from components-temp so Jest/E2E disable animations
per PR #29765 review (Cursor Bugbot).

Co-authored-by: Cursor <cursoragent@cursor.com>
@gantunesr gantunesr changed the title refactor(multichain): migrate BaseAccountDetails and SmartAccountModal (MUL-1689) refactor: migrate BaseAccountDetails and SmartAccountModal May 7, 2026
Base automatically changed from gar/refactor/mul-1689/part-1 to main May 14, 2026 12:40
@gantunesr gantunesr marked this pull request as ready for review May 19, 2026 21:27
@gantunesr gantunesr requested a review from a team as a code owner May 19, 2026 21:27
@gantunesr gantunesr added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label May 20, 2026
Copy link
Copy Markdown
Contributor

@ccharly ccharly left a comment

Choose a reason for hiding this comment

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

LGTM (not tested)

@gantunesr gantunesr added this pull request to the merge queue May 25, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 25, 2026
@gantunesr gantunesr added this pull request to the merge queue May 26, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 26, 2026
@gantunesr gantunesr enabled auto-merge May 26, 2026 17:14
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeWalletPlatform
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 82%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are UI component refactoring in the MultichainAccounts/AccountDetails area, migrating from internal component library to @metamask/design-system-react-native. Key changes include:

  1. BaseAccountDetails/index.tsx: Replaced internal Text, Icon, Avatar, HeaderBase, ButtonLink with design system equivalents. The HeaderBase API changed from startAccessory (with ButtonLink) to startButtonIconProps - this affects how the back button is rendered. The BACK_BUTTON testID (AccountDetailsIds.BACK_BUTTON) is preserved, so E2E tests should still find it.

  2. SmartAccountModal.tsx: Similar refactoring with HeaderBase API change.

  3. styles.ts: Removed 'text' style (now using TextColor.TextAlternative directly).

SmokeAccounts is selected because:

  • tests/smoke/accounts/wallet-details.spec.ts directly uses AccountDetails page object (tapEditWalletName, tapBackButton) which interacts with the modified BaseAccountDetails component
  • tests/smoke/accounts/reveal-secret-recovery-phrase.spec.ts also uses SmokeAccounts tag
  • The AccountDetails back button behavior is tested via AccountDetails.tapBackButton()

SmokeWalletPlatform is selected because:

  • It covers multi-SRP wallet architecture and account management flows that navigate through AccountDetails
  • SmokeAccounts description says 'When changes touch multi-SRP architecture, account list, or SRP export flows, also select SmokeWalletPlatform'

The changes are purely cosmetic/refactoring with no business logic changes, but the HeaderBase API change could affect how the back button renders and is interacted with in E2E tests. Risk is medium because the testIDs are preserved but the underlying component structure changed.

Performance Test Selection:
These are purely UI component refactoring changes (migrating from internal component library to design system components). No performance-sensitive code paths are affected - no list rendering changes, no data loading changes, no state management changes, no app startup changes. Performance tests are not warranted.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

@gantunesr gantunesr added this pull request to the merge queue May 26, 2026
Merged via the queue into main with commit 750c884 May 26, 2026
184 of 198 checks passed
@gantunesr gantunesr deleted the gar/refactor/mul-1689/part-2 branch May 26, 2026 20:44
@github-actions github-actions Bot locked and limited conversation to collaborators May 26, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.80.0 Issue or pull request that will be included in release 7.80.0 label May 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.80.0 Issue or pull request that will be included in release 7.80.0 size-M team-accounts-framework Accounts team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants