Skip to content

refactor: Updated perps market details header#27316

Merged
brianacnguyen merged 9 commits into
mainfrom
refactor/header-perps-market-details
Mar 12, 2026
Merged

refactor: Updated perps market details header#27316
brianacnguyen merged 9 commits into
mainfrom
refactor/header-perps-market-details

Conversation

@brianacnguyen

@brianacnguyen brianacnguyen commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

Description

Refactors the Perps Market Details screen to use the shared HeaderStandardAnimated component instead of the custom PerpsMarketHeader and navbar options, aligning with patterns used elsewhere (e.g. Perps home, Token Details).

  1. Reason for the change: Market Details used getPerpsMarketDetailsNavbar (navigation.setOptions) and a custom PerpsMarketHeader component; this was inconsistent with other screens that use component-library header primitives and scroll-linked header animation.
  2. Improvement: Replaced PerpsMarketHeader with HeaderStandardAnimated. Title is ${getPerpsDisplaySymbol(market.symbol)}-USD; subtitle is LivePriceHeader (symbol, current price, throttle). Back button, fullscreen (expand) and watchlist (star) actions are passed as endButtonIconProps. Removed the navbar useEffect. Scroll content is now an Animated.ScrollView with scroll passed to the header; a TitleSubpage block at the top (token logo, title, leverage badge, and LivePriceHeader as bottom accessory) drives the title section height via onLayout and useHeaderStandardAnimated. LivePriceHeader text variants were updated to BodySM and price color to Alternative for the compact header context.

Changelog

CHANGELOG entry: null

Related issues

Fixes: https://consensyssoftware.atlassian.net/issues?jql=issueKey%20in%20(DSYS-555%2CDSYS-556%2CDSYS-557%2CDSYS-558)&selectedIssue=DSYS-558

Manual testing steps

Feature: Perps Market Details header

  Scenario: Market Details shows animated header and title section
    Given the app is open and user has access to Perps

    When user opens a market (e.g. ETH-USD) from the Perps list
    Then the screen shows HeaderStandardAnimated with market title (e.g. "ETH-USD") and live price as subtitle
    And the header shows back button, fullscreen (expand) and watchlist (star) actions
    And the scroll area shows TitleSubpage with token logo, title, leverage badge, and live price
    When user scrolls the page
    Then the header animates (collapses/expands) in sync with scroll
    And chart, stats, and rest of content remain usable

Screenshots/Recordings

Before

After

Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2026-03-10.at.15.13.51.mov

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

Medium Risk
Refactors the Perps Market Details header/navigation and scroll handling, which could introduce UI regressions (collapsed header behavior, button actions, layout) on a high-traffic trading screen. No changes to trading/business logic or data handling.

Overview
Refactors the Perps Market Details screen to use the shared HeaderStandardAnimated pattern instead of the bespoke PerpsMarketHeader and navigation.setOptions navbar configuration.

The header is now driven by useHeaderStandardAnimated and an Animated.ScrollView, with a new top-of-page TitleSubpage section (token logo, title, leverage badge, and live price) providing the measured height for the collapse/expand animation; fullscreen and watchlist actions are wired through header icon props.

Updates HeaderStandardAnimated to accept non-string title/subtitle nodes, adjusts LivePriceHeader typography for the compact header, removes the unused getPerpsMarketDetailsNavbar, and extends Perps test IDs/tests to account for duplicated title rendering (header + title section) and new price/change selectors.

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

@brianacnguyen brianacnguyen self-assigned this Mar 11, 2026
@brianacnguyen brianacnguyen requested a review from a team as a code owner March 11, 2026 06:29
@brianacnguyen brianacnguyen added No QA Needed Apply this label when your PR does not need any QA effort. team-design-system All issues relating to design system in Mobile no changelog required No changelog entry is required for this change labels Mar 11, 2026
@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.

@brianacnguyen brianacnguyen requested a review from a team as a code owner March 11, 2026 17:59
@brianacnguyen brianacnguyen requested a review from a team as a code owner March 11, 2026 19:28
@brianacnguyen

Copy link
Copy Markdown
Contributor Author

Skipping sonar since its failing on "duplication" check, which is from similar checks for string type

@brianacnguyen brianacnguyen added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Mar 11, 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.

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

cortisiko
cortisiko previously approved these changes Mar 11, 2026
Comment thread tests/page-objects/Perps/PerpsTabView.ts Outdated
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePerps, SmokeWalletPlatform, SmokeConfirmations
  • Selected Performance tags: @PerformancePreps
  • Risk Level: medium
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

E2E Test Selection:
All changes are confined to Perps UI components (PerpsMarketDetailsView, LivePriceHeader, Perps testIds) plus a shared HeaderStandardAnimated component and Navbar. These directly impact the Perps trading interface, particularly market details and live price display. Perps flows (including Add Funds deposits) require transaction confirmations and are surfaced inside the Trending/Wallet platform area.

According to tag rules:

  • SmokePerps is required because Perps views and components were modified.
  • SmokeWalletPlatform must also run because Perps is embedded within the Trending tab and changes to Perps views affect that section.
  • SmokeConfirmations must run because Perps Add Funds and related flows include on-chain transactions that rely on the confirmation UI.

No controller, Engine, network, identity, or trade/swap logic changes were made, so other tags are not required.

Performance Test Selection:
Changes affect Perps market details and live price header rendering, which are part of the Perps trading experience measured by @PerformancePreps (market loading, add funds flow, and UI responsiveness). No broader app launch, onboarding, swaps, or account list changes were introduced.

View GitHub Actions results

@github-actions

Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
11 value mismatches detected (expected — fixture represents an existing user).
View details

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
9.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@brianacnguyen brianacnguyen enabled auto-merge March 12, 2026 15:53
@brianacnguyen brianacnguyen added this pull request to the merge queue Mar 12, 2026
Merged via the queue into main with commit e0d223c Mar 12, 2026
103 of 104 checks passed
@brianacnguyen brianacnguyen deleted the refactor/header-perps-market-details branch March 12, 2026 21:49
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 12, 2026
@metamaskbot metamaskbot added the release-7.71.0 Issue or pull request that will be included in release 7.71.0 label Mar 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no changelog required No changelog entry is required for this change No QA Needed Apply this label when your PR does not need any QA effort. release-7.71.0 Issue or pull request that will be included in release 7.71.0 size-M skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-design-system All issues relating to design system in Mobile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants