Skip to content

feat(carousel): enhance analytics tracking for carousel interactions#30458

Merged
baptiste-marchand merged 3 commits into
mainfrom
fix/banner-name-in-analytics
May 21, 2026
Merged

feat(carousel): enhance analytics tracking for carousel interactions#30458
baptiste-marchand merged 3 commits into
mainfrom
fix/banner-name-in-analytics

Conversation

@baptiste-marchand

@baptiste-marchand baptiste-marchand commented May 20, 2026

Copy link
Copy Markdown
Contributor

Description

Changelog

CHANGELOG entry:

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/GE-245

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

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

Medium Risk
Adjusts when and how carousel analytics events fire (display/select naming and frequency), which can impact engagement metrics and downstream dashboards. UI/navigation behavior is mostly unchanged but click handler signature changes touch multiple components.

Overview
Updates carousel analytics so Banner Display is emitted only when a non-empty slide becomes the current card (instead of for every visible slide), and standardizes event name to use variableName with fallback to Contentful id.

Refactors slide click handling to pass the full CarouselSlide object through StackCard/props and uses the derived analytics name for Banner Select (including Solana-specific action properties), and adds targeted unit tests covering the new display/select tracking behavior.

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

@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.

@github-actions github-actions Bot added the pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. label May 20, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit edbf0aa. Configure here.


///: BEGIN:ONLY_INCLUDE_IF(solana)
const isSolanaBanner = slideId === 'solana';
const isSolanaBanner = slideName === 'solana';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Analytics name used for Solana business logic check

Medium Severity

The isSolanaBanner check uses slideName from getSlideAnalyticsName(slide), which returns variableName || id. This means a slide with a falsy variableName but id === 'solana' would trigger the Solana redirect via Engine.setSelectedAddress, even though applyLocalNavigation (which checks getSlideVariableName, i.e. only variableName) would not have configured Solana navigation for it. Every other slide-type check in the file ('fund', 'solana', 'empty') consistently uses getSlideVariableName. The isSolanaBanner check controls business logic (account switching), not just analytics, so it needs getSlideVariableName(slide) instead of the analytics-fallback variant.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit edbf0aa. Configure here.

samir-acle
samir-acle previously approved these changes May 20, 2026
@baptiste-marchand baptiste-marchand added no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed and removed pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. labels May 20, 2026
@baptiste-marchand baptiste-marchand added pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. type-bug Something isn't working and removed pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. type-bug Something isn't working labels May 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
The changes are confined to the Carousel UI component used on the Wallet home screen. The modifications are:

  1. Internal API refactoring: onSlideClick callback now passes the full CarouselSlide object instead of individual (slideId, navigation) parameters
  2. Analytics tracking fix: now only tracks the current displayed slide (not all visible slides), skips empty cards, and uses variableName with fallback to id
  3. Helper functions added for cleaner slide property access
  4. New unit tests added to cover the fixed analytics behavior

The Carousel is rendered in app/components/Views/Wallet/index.tsx (main wallet home). No E2E tests directly test the Carousel component or its analytics events. The functional behavior (navigation, dismissal, display logic) is unchanged - only analytics tracking and internal API are modified.

SmokeWalletPlatform is selected as a conservative measure since the Carousel is part of the wallet home screen, and any regression in the component could affect the wallet view. No other tags are needed as this is a focused UI component change with no impact on confirmations, accounts, networks, swaps, or other feature areas.

No direct E2E tests exist for the Carousel component itself, so the risk of breaking existing tests is minimal. The changes are low-risk internal refactoring with improved unit test coverage.

Performance Test Selection:
The changes are analytics tracking refactoring and internal API cleanup in the Carousel component. There are no changes to rendering logic, list performance, data loading, or any performance-sensitive paths. The analytics fix (tracking only current slide vs all visible slides) could slightly reduce event volume but has no meaningful performance impact on UI rendering or app responsiveness.

View GitHub Actions results

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.47619% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.13%. Comparing base (66f0cb2) to head (860e897).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
app/components/UI/Carousel/index.tsx 90.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #30458      +/-   ##
==========================================
- Coverage   82.13%   82.13%   -0.01%     
==========================================
  Files        5488     5488              
  Lines      147743   147748       +5     
  Branches    33969    33970       +1     
==========================================
+ Hits       121353   121357       +4     
+ Misses      18084    18082       -2     
- Partials     8306     8309       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud

Copy link
Copy Markdown

@baptiste-marchand baptiste-marchand added this pull request to the merge queue May 21, 2026
Merged via the queue into main with commit de49370 May 21, 2026
185 of 192 checks passed
@baptiste-marchand baptiste-marchand deleted the fix/banner-name-in-analytics branch May 21, 2026 09:59
@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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants