Skip to content

fix: match segment schema location enum#24842

Merged
infiniteflower merged 8 commits into
mainfrom
swaps-3774-swaps-button-click-event-location
Jan 20, 2026
Merged

fix: match segment schema location enum#24842
infiniteflower merged 8 commits into
mainfrom
swaps-3774-swaps-button-click-event-location

Conversation

@infiniteflower
Copy link
Copy Markdown
Contributor

@infiniteflower infiniteflower commented Jan 16, 2026

Description

This PR:

  1. Removes some unneeded
  2. Matches location enum with what's in the Segment schema to prevent dropped properties
  3. Removes a duplicate event emission

Changelog

CHANGELOG entry: null

Related issues

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

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

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

Updates swaps/bridge navigation and analytics to match Segment schema and simplify tracking.

  • Rename SwapBridgeNavigationLocation values (TabBarMain View, TokenDetailsToken View); update usages in AssetOverview, UrlAutocomplete, Wallet, WalletActions, TradeWalletActions, and related tests
  • Adjust analytics: Main View treated as navbar (omit action_position), Token View/Rewards tracked as asset details; keep consolidated ACTION_BUTTON_CLICKED + SWAP_BUTTON_CLICKED in hook
  • Remove duplicate SWAP_BUTTON_CLICKED emission from WalletActions (now handled in hook)
  • Set useOpenSwaps default location to Token View; update tests accordingly

Written by Cursor Bugbot for commit 8e1fc15. This will update automatically on new commits. 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.

@metamaskbot metamaskbot added the team-swaps-and-bridge Swaps and Bridge team label Jan 16, 2026
@infiniteflower infiniteflower added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Jan 19, 2026
@infiniteflower
Copy link
Copy Markdown
Contributor Author

Skipping Sonar Cloud as it's looking at old code.

@infiniteflower infiniteflower force-pushed the swaps-3774-swaps-button-click-event-location branch from 6e6945d to 92c0b5c Compare January 19, 2026 17:14
@infiniteflower infiniteflower marked this pull request as ready for review January 19, 2026 19:16
@infiniteflower infiniteflower requested review from a team as code owners January 19, 2026 19:16
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

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 2 potential issues.

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeTrade, SmokeWalletPlatform, SmokeCard
  • Risk Level: low
  • AI Confidence: 85%
click to see 🤖 AI reasoning details

This PR is a refactoring change that renames enum values in SwapBridgeNavigationLocation:

  • TabBarMainView
  • TokenDetailsTokenView
  • Removes unused Swaps enum value

All usages across the codebase have been updated to use the new names. The changes are purely cosmetic/naming changes with no functional impact on the swap/bridge navigation logic.

The affected components include:

  1. useSwapBridgeNavigation hook - core swap/bridge navigation
  2. WalletActions.tsx - also removes duplicate analytics tracking (now handled in hook)
  3. TradeWalletActions.tsx - wallet trade actions
  4. Wallet/index.tsx - main wallet view
  5. AssetOverview.tsx - token details view
  6. useOpenSwaps.ts - Card swap functionality
  7. UrlAutocomplete/index.tsx - browser autocomplete

The risk is low because:

  • No logic changes, only enum value renaming
  • All usages have been updated consistently
  • Unit tests have been updated to reflect new values
  • The analytics tracking removal in WalletActions is a cleanup (tracking moved to hook)

Selected tags cover the main affected areas:

  • SmokeTrade: Swap/bridge navigation is core to trading functionality
  • SmokeWalletPlatform: Wallet views and actions are affected
  • SmokeCard: Card hooks use the swap navigation

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
D Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@infiniteflower infiniteflower added this pull request to the merge queue Jan 20, 2026
Merged via the queue into main with commit d3e5ee1 Jan 20, 2026
86 of 87 checks passed
@infiniteflower infiniteflower deleted the swaps-3774-swaps-button-click-event-location branch January 20, 2026 15:57
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 20, 2026
@metamaskbot metamaskbot added the release-7.63.0 Issue or pull request that will be included in release 7.63.0 label Jan 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.63.0 Issue or pull request that will be included in release 7.63.0 size-S skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-swaps-and-bridge Swaps and Bridge team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants