feat: TDP new theming AB test - #33249
Conversation
|
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. |
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Why no E2E tags are needed:
Performance Test Selection: |
|



Description
Implements the scoped ambient chart theme A/B test for ASSETS-3619. This PR refines the existing ambient price color treatment (
assetsASSETS3205AbtestAmbientPriceColor) by:error-default(red) for users in Asian markets (JP, KR, HK, TW, CN) and today's exact green for all other countries. When the FF is OFF (control), buttons always show green regardless of geolocation.country_codeis now included in allexperiment_viewedMixpanel events via theuseABTesthook.Control path (FF OFF) is completely preserved — all changes are gated behind
useAmbientColorchecks except the back button neutralization (which is an unconditional improvement).New files
app/util/region/isAsiaGeolocationLocation.ts— utility to check if a geolocation resolves to JP, KR, HK, TW, or CNapp/util/region/isAsiaGeolocationLocation.test.ts— 12 unit testsKey changes
TokenDetailsInlineHeader— removediconColor,useAmbientColorprops; back button always neutralTokenDetailsStickyFooter— replaced ambient-driven button colors with geo-based logic (Asia=red, else=green), gated behinduseAmbientColorPrice.advanced.tsx— passesinitialAmbientColortoIntervalBarSecurityTrustScreen,MarketInsightsView,SecurityTrustEntryCard,AssetOverviewContent— removedisPricePositiveprop propagation;useAmbientColoris now passed through to gate geo-based footer colorsuseABTest— addedcountry_codeto experiment exposure eventsgeolocationController/index.ts(selectors) — addedselectIsUserInAsiareselect selectorChangelog
CHANGELOG entry: Updated token details sticky footer buttons to show red in Asian markets and green elsewhere, removed ambient tinting from the back button, and added ambient color support to interval bar pills
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-3619
Related: https://github.com/Consensys/segment-schema/pull/667
Manual testing steps
Screenshots/Recordings
Before
FF ON - treatment
Screen.Recording.2026-07-15.at.20.31.30.mov
(Legacy chart)
FF OFF - control
https://github.com/user-attachments/assets/77c1caa4-fdd2-4ec4-b9dd-b541f5766f55
(Legacy chart)
After
FF ON (Global) - treatment
Screen.Recording.2026-07-15.at.20.16.47.mov
(Legacy chart)
FF ON (Asia -JP) - treatment
Screen.Recording.2026-07-15.at.20.18.36.mov
(Legacy chart)
FF OFF - control
Screen.Recording.2026-07-15.at.20.23.38.mov
(Legacy chart)
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
User-visible CTA colors depend on geolocation and the ambient FF across multiple screens; mis-detection or gating bugs could show wrong accents, though control path is preserved.
Overview
Refines the ambient price color A/B test: chart direction no longer drives UI, and geolocation drives sticky Buy/Swap styling when treatment is on.
Token details header drops
iconColor/useAmbientColorand ambient-tinted back/share/alert behavior—the back control stays neutral, and header actions show whenever their handlers exist (no waiting on chart direction).Sticky footer (
TokenDetails, Security Trust, Market Insights) removesisPricePositiveplumbing. WithuseAmbientColor+ detected geolocation in JP/KR/TW/CN/HK, primary/secondary CTAs useerror-defaultred; elsewhere they keep the existing green. Control (FF off) stays green. The footer is no longer hidden while chart direction is unresolved.Adds
isAsiaGeolocationLocation,selectIsUserInAsia, and tests.useABTestadds optionalcountry_codeonexperiment_viewedexposure events from detected geolocation.Reviewed by Cursor Bugbot for commit ad793f4. Bugbot is set up for automated code reviews on this repo. Configure here.