Skip to content

feat(perps): add pro guide to market details - #6902

Merged
crossle merged 2 commits into
masterfrom
feat/contract-pro-guide
Dec 2, 2026
Merged

crossle merged 2 commits into
masterfrom
feat/contract-pro-guide

Conversation

@SeniorZhai

Copy link
Copy Markdown
Member

No description provided.

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.
@gaotic

gaotic Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

AI review of fd9a946 stopped after 3m 29s: a newer commit was pushed, the PR was closed, or a full review was requested. The latest commit is reviewed next.

@gaotic gaotic Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review · GPT · 1d122a1

Needs fixes before merge. git diff --check, XML parsing, and standalone SQLite and Kotlin checks passed. The targeted Android unit test was blocked during Gradle configuration because Foojay resolver 1.0.0 was unavailable offline.

PerpetualGuideBottomSheetDialogFragment.TAB_OVERVIEW
).show(activity.supportFragmentManager, PerpetualGuideBottomSheetDialogFragment.TAG)
}
if (currentPosition == null && hasLoadedOpenPositions && showProGuide != null) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@crossle
crossle merged commit 36b8e15 into master Dec 2, 2026
1 check failed
@crossle
crossle deleted the feat/contract-pro-guide branch December 2, 2026 06:12
crossle added a commit that referenced this pull request Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants