Skip to content

refactor(analytics): PR E2 rename addTraitsToUser to identify in NFT detection modals#30499

Merged
NicolasMassart merged 1 commit into
mainfrom
refactor/26686_e2-assets_rename-identify
May 21, 2026
Merged

refactor(analytics): PR E2 rename addTraitsToUser to identify in NFT detection modals#30499
NicolasMassart merged 1 commit into
mainfrom
refactor/26686_e2-assets_rename-identify

Conversation

@NicolasMassart

@NicolasMassart NicolasMassart commented May 21, 2026

Copy link
Copy Markdown
Contributor

Description

Part of the analytics cleanup workstream (#26686).

Renames .addTraitsToUser().identify() in the NFT auto-detection modal components (NFTAutoDetectionModal and CollectibleDetectionModal). Updates the corresponding test file to use the identify override in createMockUseAnalyticsHook.

Files touched:

  • NFTAutoDetectionModal/NFTAutoDetectionModal.tsx — rename .addTraitsToUser.identify
  • CollectibleDetectionModal/index.tsx — rename .addTraitsToUser.identify
  • NFTAutoDetectionModal/NFTAutoDetectionModal.test.tsx — update mock and assertions to use identify

Changelog

CHANGELOG entry: null

Related issues

Closes: #26822
Refs: #26686

Manual testing steps

N/A

Screenshots/Recordings

Before

N/A — no UI changes.

After

N/A — no UI changes.

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, test affected areas)
  • I confirm that this PR addresses what is claimed in the PR title
  • I confirm that I've manually reviewed the changes if not manually tested

…ts files

Renames `.addTraitsToUser()` → `.identify()` in NFTAutoDetectionModal and
CollectibleDetectionModal. Updates NFTAutoDetectionModal.test.tsx assertions
accordingly. Part of analytics cleanup workstream (#26686).

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
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.

@metamaskbotv2 metamaskbotv2 Bot added the team-mobile-platform Mobile Platform team label May 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 95%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are purely an analytics API refactoring: renaming addTraitsToUser to identify from the useAnalytics() hook in two NFT-related modal components (CollectibleDetectionModal and NFTAutoDetectionModal), plus updating the corresponding unit test mocks.

Key observations:

  1. No functional behavior changes - the NFT auto-detection modals work identically; only the analytics method name changed
  2. No navigation, transaction, confirmation, or wallet flow changes
  3. No core controller or Engine changes
  4. The unit tests are updated to match the rename
  5. No E2E tests directly test these analytics calls in NFT detection modals
  6. The change is isolated to analytics trait tracking within NFT detection UI components

This is a low-risk internal refactoring with no user-facing impact. No E2E test tags are needed as no user flows are affected.

Performance Test Selection:
The changes are limited to renaming an analytics method call (addTraitsToUser → identify) in NFT detection modals. There are no UI rendering changes, no data loading changes, no state management changes, and no component structure changes that would affect performance.

View GitHub Actions results

@NicolasMassart NicolasMassart changed the title refactor(analytics): rename addTraitsToUser to identify in NFT detection modals [E2] refactor(analytics): PR E2 rename addTraitsToUser to identify in NFT detection modals May 21, 2026
@sonarqubecloud

Copy link
Copy Markdown

@NicolasMassart NicolasMassart moved this to Needs dev review in PR review queue May 21, 2026
@NicolasMassart NicolasMassart self-assigned this May 21, 2026
@NicolasMassart NicolasMassart marked this pull request as ready for review May 21, 2026 10:16
@NicolasMassart NicolasMassart requested a review from a team as a code owner May 21, 2026 10:16
@NicolasMassart NicolasMassart enabled auto-merge May 21, 2026 11:14
@NicolasMassart NicolasMassart added this pull request to the merge queue May 21, 2026
@github-project-automation github-project-automation Bot moved this from Needs dev review to Review finalised - Ready to be merged in PR review queue May 21, 2026
Merged via the queue into main with commit 29fe5ed May 21, 2026
231 of 281 checks passed
@NicolasMassart NicolasMassart deleted the refactor/26686_e2-assets_rename-identify branch May 21, 2026 12:46
@github-project-automation github-project-automation Bot moved this from Review finalised - Ready to be merged to Merged, Closed or Archived in PR review queue May 21, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators May 21, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.79.0 Issue or pull request that will be included in release 7.79.0 label May 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.79.0 Issue or pull request that will be included in release 7.79.0 size-S team-mobile-platform Mobile Platform team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

PR E2: rename addTraitsToUser to identify in metamask-assets files already on useAnalytics (~2 files)

2 participants