Skip to content

fix(perps): standardize long and short CTA colors - #36472

Open
nikki-p-h-12 wants to merge 7 commits into
mainfrom
cursor/fix-perps-cta-colors-7270
Open

nikki-p-h-12 wants to merge 7 commits into
mainfrom
cursor/fix-perps-cta-colors-7270

Conversation

@nikki-p-h-12

@nikki-p-h-12 nikki-p-h-12 commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Standardizes the Perps directional trade actions so Long always uses success/default with a success/inverse label and Short always uses error/default with an error/inverse label, in both light and dark mode.

Previously these CTAs were driven by the concluded TAT-1937 A/B test, which served either white buttons (control) or pastel muted-tint buttons (colors). The pastel treatment is what was reported. The experiment is now retired so a remote assignment can no longer restore either incorrect treatment.

Surfaces updated:

Surface Element
PerpsMarketDetailsView (Lite) Long / Short footer
PerpsOrderBookView Long / Short footer
MarketInsightsView (Perps context) Long / Short footer
PerpsOrderView Place-order CTA
PerpsTradeScreen (trade sheet) Submit CTA
PerpsProOrderForm (Pro) Place-order CTA only

A shared PerpsDirectionButton now owns this mapping so the two colors are defined once instead of per screen.

The Pro Long / Short direction selector is deliberately left as-is on main (muted tint on the selected side). It is a segmented selector rather than a CTA, so it is out of scope for this change.

Changelog

CHANGELOG entry: Fixed Long and Short button colors across Perps Lite and Pro experiences

Related issues

Refs: User-reported Perps Long/Short CTA color inconsistency

Manual testing steps

Feature: Perps directional CTA colors

  Scenario: Long and Short colors on Perps surfaces
    Given the user opens a Perps market in Lite or Pro mode
    When the user views the Long and Short actions
    Then Long uses success/default with a success/inverse label
    And Short uses error/default with an error/inverse label
    And both hold in light and dark mode

  Scenario: Pro direction selector is unchanged
    Given the user opens the Pro order form
    When the user switches between Long and Short
    Then the selector keeps its existing muted-tint styling from main

Screenshots/Recordings

Each surface is rendered from the real components with react-native-web in headless Chromium, using the app's bundled Inter fonts, design-system icons, theme tokens, stylesheets, and en.json copy. before is main with the reported pastel colors variant, and after is this branch. The Pro order form is the actual PerpsProOrderForm component rendered from both main and this branch, with its direction selector identical in both. Market data is static sample HYPE values because no live feed runs in the renderer.

Perps market details (Lite)

Perps market details (Lite), before and after, light and dark

Perps order book

Perps order book, before and after, light and dark

Perps order view, Long and Short

Perps order view, Long and Short, before and after, light and dark

Perps trade bottom sheet — fully rounded design-system pill corners

Perps trade bottom sheet, before and after, light and dark

Market insights (Perps)

Market insights (Perps), before and after, light and dark

Perps Pro order form, Long and Short

Perps Pro order form, Long and Short, before and after, light and dark

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android — all four Perps Appium shards passed on this branch
  • I've tested with a power user scenario — N/A
  • I've instrumented key operations with Sentry traces for production performance metrics — N/A

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.
Open in Web Open in Cursor 

Co-authored-by: nikki-p-h-12 <nikki-p-h-12@users.noreply.github.com>
Co-authored-by: nikki-p-h-12 <nikki-p-h-12@users.noreply.github.com>
@cursor
cursor Bot deployed to build-e2e September 18, 2026 08:52 Active
Co-authored-by: nikki-p-h-12 <nikki-p-h-12@users.noreply.github.com>
@cursor
cursor Bot deployed to build-e2e September 18, 2026 10:27 Active
@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.

@sonarqubecloud

Copy link
Copy Markdown

@nikki-p-h-12
nikki-p-h-12 marked this pull request as ready for review October 4, 2026 13:31
@nikki-p-h-12
nikki-p-h-12 requested review from a team as code owners October 4, 2026 13:31

@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 ccdf10e. Configure here.

testID={PerpsOrderViewSelectorsIDs.PLACE_ORDER_BUTTON}
>
{placeOrderLabel}
</PerpsDirectionButton>

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.

Leftover order CTA still rendered

High Severity

PerpsDirectionButton was added as the place-order CTA, but the retired TAT-1937 branch is still below it. That leftover tree still reads buttonColorVariant and deleted BUTTON_COLOR_VARIANTS / PERPS_BUTTON_COLOR_AB_TEST_KEY exports, and it would render a second PLACE_ORDER_BUTTON.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ccdf10e. Configure here.

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Smart E2E Test Selection

Selected E2E tags

SmokePerps
SmokeConfirmations
SmokeWalletPlatform

Selected Performance tags: @PerformancePreps

AI Confidence: 88

E2E reasoning

Expand to read

This PR removes the TAT-1937 A/B test (Long/Short Button Color Test) and introduces a new PerpsDirectionButton component that hardcodes green/long and red/short colors. The changes affect:

  1. SmokePerps (primary): The place-order button in PerpsOrderView, PerpsOrderBookView, PerpsMarketDetailsView, PerpsProOrderForm, and PerpsTradeScreen is replaced from ButtonSemantic to PerpsDirectionButton. This is the critical CTA for placing perps trades. An open PR review comment also flags a potential leftover branch in PerpsOrderView.tsx that could render a second PLACE_ORDER_BUTTON, making this higher risk.

  2. SmokeWalletPlatform (secondary): MarketInsightsView now uses PerpsDirectionButton for its Long/Short buttons. MarketInsights is part of the Trending tab (SmokeWalletPlatform). Changes to Perps views embedded in Trending affect this tag.

  3. SmokeConfirmations (required dependency): Per the SmokePerps tag description, "Add Funds deposits are on-chain transactions" — when selecting SmokePerps, also select SmokeConfirmations.

The A/B test infrastructure changes (removing BUTTON_COLOR_AB_TEST_ANALYTICS_MAPPING from the analytics registry, marking the feature flag as Deprecated) are cleanup-only and don't affect other flows. No network, authentication, or wallet core changes are present, so other smoke tags are not warranted.

Performance reasoning

Expand to read

The PR modifies the place-order button rendering in multiple Perps views (PerpsOrderView, PerpsOrderBookView, PerpsMarketDetailsView, PerpsProOrderForm, PerpsTradeScreen). The new PerpsDirectionButton replaces ButtonSemantic with a custom component. While the change is primarily cosmetic/behavioral (color hardcoding vs A/B test), the button is rendered in performance-sensitive Perps trading views. The @PerformancePreps tag covers perps market loading, position management, add funds flow, and order execution — all of which involve the modified button component.

View run

@github-actions github-actions Bot added the risk:high AI analysis: high risk label Oct 4, 2026
Co-authored-by: nikki-p-h-12 <nikki-p-h-12@users.noreply.github.com>
@cursor
cursor Bot deployed to build-e2e October 4, 2026 13:45 Active
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

⚠️ Performance Test Results

ℹ️ Performance test results are currently non-blocking and will not block this PR.

❌ 1 test failed · 2 tests · 1 device

📱 Devices tested (1)

Android: Google Pixel 8 Pro (v14.0)

❌ Failed Tests (1)

🔬 App profiling vs main is included under each failed scenario that has a prior baseline.

@mm-perps-engineering-team

Perps open position and close it

Platform Device Reason Recording
Android Google Pixel 8 Pro (v14.0) no_performance_metrics 📹 Watch

🔬 App profiling check · Current run 37206410727 · Baseline (last run on main (scenario also failing)) run 37144708353 @ 8eac44c

⚠️ No green baseline on main — comparing against the latest usable profiling.

Summary: ⚠️ 2 metrics over +10%: CPU max (+2.45 (+10.6%)), Slow frames (+4.35 (+60.5%))

ℹ️ API calls unavailable: Network logs API error: Bad Request

Full metric table (+10% variance rules)

Disclaimer — allowed variance: a +10% margin over the baseline is permitted.

  • If Current <= Baseline + 10%, treated as acceptable noise.
  • If Current > Baseline + 10%, Current and variance % are highlighted with ⚠️.
Metric Baseline Current Δ
CPU avg 7.28% 6.16% -1.12 (-15.4%)
CPU max 23.19% 25.64% +2.45 (+10.6%) ⚠️
Memory avg 785.88 MB 765.78 MB -20.1 (-2.6%)
Memory max 1003.62 MB 977.88 MB -25.74 (-2.6%)
Slow frames 7.19% 11.54% +4.35 (+60.5%) ⚠️
Frozen frames 0% 0% 0 (0%)
ANRs 0 0 0 (0%)
Issues 2 2 0 (0%)
Critical issues 2 2 0 (0%)
App size 403.41 MB 403.28 MB -0.13 (0%)
✅ Passed Tests (1)
Test Platform Device Duration Team Recording
Perps add funds Android Google Pixel 8 Pro (v14.0) 8.04s @mm-perps-engineering-team 📹 Watch

Branch: cursor/fix-perps-cta-colors-7270 · Build: E2E · Commit: 1b51179 · View full run

This branch was successfully deployed

1 active deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:high AI analysis: high risk size-L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants