Skip to content

Conversation

@nickewansmith
Copy link
Contributor

@nickewansmith nickewansmith commented Nov 10, 2025

Description

Added support for proper display of hip3 and other DEX assets by stripping prefixes from asset symbols throughout the Perps UI.

  • Added getPerpsDisplaySymbol() in marketUtils.ts
  • Strips DEX prefixes (e.g., hip3:, xyz:) from asset symbols
  • Returns clean symbol for display (e.g., hip3:BTCBTC)

Utils:

  • transactionTransforms.ts - Strip prefixes in transaction subtitles (fills, orders, funding)

Hooks:

  • usePerpsToasts.tsx - Clean asset names in toast notifications

Components:

  • PerpsAmountDisplay.tsx - Display token symbols without prefixes

  • PerpsOrderHeader.tsx - Show clean asset names in order titles

  • PerpsOpenOrderCard.tsx - Format symbols in order cards

  • PerpsRecentActivityList.tsx - Display clean symbols in activity list

  • Hip3 assets now display as BTC instead of hip3:BTC

  • Stock/commodity assets show as TSLA instead of xyz:TSLA

  • Consistent, clean asset naming across entire Perps UI

  • Regular assets (BTC, ETH, SOL) remain unchanged

Changelog

CHANGELOG entry: null

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/TAT-2043
Fixes: #22439

Manual testing steps

Feature: Hip3 Asset Name Display

  Background:
    Given the system uses getPerpsDisplaySymbol() to format asset names

  Scenario: Strip DEX prefix from hip3 assets
    Given a hip3 asset with symbol "hip3:BTC"
    When displaying the asset name
    Then show "BTC"

  Scenario: Keep regular asset names unchanged
    Given a regular asset with symbol "BTC"
    When displaying the asset name
    Then show "BTC"

Screenshots/Recordings

Before

After

Simulator.Screen.Recording.-.iPhone.17.Pro.-.2025-11-10.at.17.29.14.mp4

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

Standardizes Perps asset symbols by stripping DEX prefixes (e.g., hip3:, xyz:) via getPerpsDisplaySymbol across UI, toasts, and transaction transforms, with comprehensive tests.

  • Utils:
    • Add getPerpsDisplaySymbol in marketUtils to strip DEX prefixes from symbols for display.
    • Apply in transactionTransforms to clean subtitle for fills, orders, and funding items.
  • Hooks:
    • Update usePerpsToasts to use cleaned symbols in all toast subtitles and errors.
  • Components:
    • PerpsOrderHeader, PerpsAmountDisplay, PerpsOpenOrderCard, PerpsRecentActivityList, PerpsClosePositionView, PerpsOrderView: replace raw symbols with getPerpsDisplaySymbol in titles, labels, and amounts.
  • Tests:
    • Add/expand coverage to assert prefix stripping (HIP-3/DEX) and unchanged regular symbols across the updated components, hooks, and utils.

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

gambinish and others added 14 commits November 7, 2025 10:02
…n PerpsMarketListView

- Introduced a flag to ignore programmatic scroll events in the `handleScroll` function to avoid unintended feedback loops.
- Updated the scroll handling logic to set the flag before programmatic scrolling and clear it after the animation completes, ensuring smoother tab transitions.
- Removed lazy loading logic for tab content, ensuring all tabs render their content consistently.
- Updated comments for clarity regarding the swipeable tab content structure.
- Enhanced readability and maintainability of the component by streamlining the rendering process.
Added support for proper display of hip3 and other DEX assets by stripping prefixes from asset symbols throughout the Perps UI.

- Added `getPerpsDisplaySymbol()` in `marketUtils.ts`
- Strips DEX prefixes (e.g., `hip3:`, `xyz:`) from asset symbols
- Returns clean symbol for display (e.g., `hip3:BTC` → `BTC`)

**Utils:**
- `transactionTransforms.ts` - Strip prefixes in transaction subtitles (fills, orders, funding)

**Hooks:**
- `usePerpsToasts.tsx` - Clean asset names in toast notifications

**Components:**
- `PerpsAmountDisplay.tsx` - Display token symbols without prefixes
- `PerpsOrderHeader.tsx` - Show clean asset names in order titles
- `PerpsOpenOrderCard.tsx` - Format symbols in order cards
- `PerpsRecentActivityList.tsx` - Display clean symbols in activity list

- Hip3 assets now display as `BTC` instead of `hip3:BTC`
- Stock/commodity assets show as `TSLA` instead of `xyz:TSLA`
- Consistent, clean asset naming across entire Perps UI
- Regular assets (BTC, ETH, SOL) remain unchanged
@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.

@nickewansmith nickewansmith marked this pull request as ready for review November 10, 2025 23:27
@nickewansmith nickewansmith requested a review from a team as a code owner November 10, 2025 23:27
@nickewansmith nickewansmith added team-perps Perps team and removed team-earn labels Nov 10, 2025
Copy link
Contributor

@dylanbutler1 dylanbutler1 left a comment

Choose a reason for hiding this comment

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

I don't see getPerpsDisplaySymbol or any changes to marketUtils in this PR - forgot to add a file?

@nickewansmith
Copy link
Contributor Author

I don't see getPerpsDisplaySymbol or any changes to marketUtils in this PR - forgot to add a file?

@dylanbutler1 the util method is already there, I did not add it, but there were no tests for it.

@nickewansmith nickewansmith added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Nov 11, 2025
style={styles.activityAmount}
>
{item.subtitle}
{getPerpsDisplaySymbol(item.subtitle)}
Copy link

Choose a reason for hiding this comment

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

Bug: Redundant Subtitle Transformation

getPerpsDisplaySymbol is called on item.subtitle, but the subtitle is already processed by getPerpsDisplaySymbol in the transform functions (transformFillsToTransactions, transformOrdersToTransactions, transformFundingToTransactions). This double-processing is redundant and could cause issues if the subtitle format changes or contains colons for other reasons. The subtitle should be displayed directly without additional transformation.

Fix in Cursor Fix in Web

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
75.0% Coverage on New Code (required ≥ 80%)
17.1% Duplication on New Code (required ≤ 10%)

See analysis details on SonarQube Cloud

@nickewansmith nickewansmith added this pull request to the merge queue Nov 11, 2025
Merged via the queue into main with commit 09ce116 Nov 11, 2025
85 of 86 checks passed
@nickewansmith nickewansmith deleted the TAT-2043-multiple-screens-refer-to-xyz-xyz-100-instead-of-xyz-100-3 branch November 11, 2025 05:45
@github-actions github-actions bot locked and limited conversation to collaborators Nov 11, 2025
@metamaskbot metamaskbot added the release-7.60.0 Issue or pull request that will be included in release 7.60.0 label Nov 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.60.0 Issue or pull request that will be included in release 7.60.0 size-L skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-perps Perps team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multiple screens refer to "xyz:XYZ100" instead of XYZ100

6 participants