feat: add tab navigation for market, limit, and recurring views - #34803
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. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #34803 +/- ##
==========================================
+ Coverage 85.15% 85.16% +0.01%
==========================================
Files 6448 6452 +4
Lines 175600 175668 +68
Branches 43607 43619 +12
==========================================
+ Hits 149526 149603 +77
+ Misses 15902 15899 -3
+ Partials 10172 10166 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🧪 Flaky unit test detectionRun history flaky detectionHistorical failure rate is a hint, not proof — review each suggestion in context. See the flaky-test-detection skill for the full pattern reference and manual audit workflow. Failures / runs sampled per window:
AI-detected flaky patterns
|
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 3439b80. Configure here.
⚡ Performance Test Results
✅ All tests passed · 2 tests · 1 device 📱 Devices tested (1)Android: Google Pixel 8 Pro (v14.0) ✅ Passed Tests (2)
Branch: |
|
|
|
||
| const BridgeMarketViewContent = ({ | ||
| latestSourceBalance, | ||
| }: BridgeMarketViewContentProps) => { |
There was a problem hiding this comment.
this file is copied as is from BridgeView/index.ts without changes.




Description
The Bridge/Swaps view is being extended to support new order types (Limit Order, Recurring Buy) alongside the existing Market order flow. Previously,
BridgeViewrendered a single, monolithic ~1000-line component containing all Market-order UI directly, with no place to slot in additional order-type screens.This PR introduces a tab system so the Bridge/Swaps screen can host multiple order-type views, gated individually behind feature flags so Limit and Recurring can ship to production disabled and be enabled independently once ready:
BridgeView/index.tsxinto a newBridgeMarketViewcomponent (and colocatedBridgeMarketView.styles.ts/.utils.ts/BridgeMarketViewFooter, renamed from theirBridgeView.*counterparts).BridgeView/index.tsxas a thin tab host: it renders aHeaderStandard, aTabsBar(from the sharedcomponent-library/components-temp/Tabs), and swaps betweenBridgeMarketView, the newBridgeLimitOrderView, andBridgeRecurringBuyViewplaceholder screens based on the selected tab.startTransitionto decouple the immediate tab-press visual feedback (selectedTab) from the more expensive content swap (renderedTab), avoiding dropped frames on tab press.app/components/UI/Bridge/selectors/featureFlags/index.tswithselectBridgeLimitOrderTabEnabledFlagandselectBridgeRecurringBuyTabEnabledFlag. Each selector prefers the remote LaunchDarkly flag (swapsLimitOrder/swapsRecurringBuy, shaped{ enabled: boolean }) when present and falls back to a local env override (MM_BRIDGE_LIMIT_ORDER_TAB_ENABLED/MM_BRIDGE_RECURRING_BUY_TAB_ENABLED, added to.js.env.example) for local development.BridgeLimitOrderViewandBridgeRecurringBuyVieware currently empty placeholder screens (just a themed container with a test ID) since the underlying order-type functionality doesn't exist yet — this PR only lands the navigation shell.bridge.tabs.market/bridge.tabs.limit/bridge.tabs.recurringstrings tolocales/languages/en.json.tests/component-view/presets/bridge.tscomponent-view preset to set both new remote flags to{ enabled: true }by default so existing tab-behavior component-view tests exercise all three tabs; tests covering the disabled state override them back to{ enabled: false }.Changelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/SWAPS-4902
Manual testing steps
Screenshots/Recordings
Before
N/A — no screenshot captured for this description. The Bridge/Swaps screen previously showed the Market order form only, with no tabs bar.
After
N/A — no screenshot captured for this description. Recommended: attach a recording of the Bridge/Swaps screen with
MM_BRIDGE_LIMIT_ORDER_TAB_ENABLED=trueandMM_BRIDGE_RECURRING_BUY_TAB_ENABLED=true, showing the tabs bar and switching between Market/Limit/Recurring.Pre-merge author checklist
app/components/UI/Bridge/selectors/featureFlags/index.test.tsand newdescribe('tabs', ...)cases inBridgeView.view.test.tsxcovering tab switching, labels, and content swapping.BridgeLimitOrderViewandBridgeRecurringBuyVieware untested directly since they are empty placeholder containers with no logic; their rendering is covered indirectly by theBridgeView.view.test.tsxtab tests.BridgeTabKey.Performance checks (if applicable)
SwapViewLoadedtracing in the Market flow is preserved unchanged inBridgeMarketView.For performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Touches the main Bridge/Swaps entry screen and quote/reset lifecycle on tab changes, but Limit/Recurring are empty placeholders behind flags defaulting off; market behavior is largely a move/refactor with new navigation shell.
Overview
Refactors Bridge/Swaps from a single monolithic screen into a tab host with Market, Limit, and Recurring views. Existing market swap/bridge UI moves into
BridgeMarketView(footer/utils/styles renamed fromBridgeView.*);BridgeViewnow only renders the header, optionalTabsBar, and the active tab.Limit and Recurring are placeholder screens behind
swapsLimitOrder/swapsRecurringBuyremote flags (withMM_BRIDGE_*env fallbacks). When only Market is enabled, the tabs bar is hidden. Tab switches usestartTransitionfor snappy highlights vs. heavier content swaps; leaving Market clears amounts andBridgeControllerquote polling viaresetBridgeTokenInputswhile keeping selected tokens. Slippage settings in the header show only on Market.Reviewed by Cursor Bugbot for commit 3439b80. Bugbot is set up for automated code reviews on this repo. Configure here.