Repository navigation
feat(perps): add pro guide to market details - #6902
Conversation
Show the Mixin Perps Pro guide card on perpetual market details when the account has historical contract activity, while keeping the original guide card placement based on current market position state. Wait for initial order sync before falling back to the beginner guide to avoid initial flicker.
|
AI review of |
| PerpetualGuideBottomSheetDialogFragment.TAB_OVERVIEW | ||
| ).show(activity.supportFragmentManager, PerpetualGuideBottomSheetDialogFragment.TAG) | ||
| } | ||
| if (currentPosition == null && hasLoadedOpenPositions && showProGuide != null) { |
There was a problem hiding this comment.
On a cached market with no local perps activity, a failed first order sync leaves showProGuide null, so the page hides the existing “How Perps Works” card indefinitely. The base displayed it as soon as the cached market was available. Track the sync failure and show the beginner guide as a fallback when the local cache has no activity.
| val hasLoadedOpenPositions = openPositions != null | ||
| val closedPositions = allClosedPositions.filter { it.marketId == marketId } | ||
| val hasSyncedOrders = walletId.isEmpty() || walletId in syncedOrderWalletIds | ||
| val showProGuide = resolvePerpsProGuideVisibility( |
There was a problem hiding this comment.
A returning trader with an empty local cache can briefly see “How Perps Works” after the first sync downloads their trade history. The sync flag can reach Compose before Room reruns the activity query, so this decision uses the cached false and then switches to Pro. Read activity after saving the orders and publish that result together with sync completion.
No description provided.