Repository navigation
feat(trade): replace swap recommendations with categorized list - #6868
SeniorZhai wants to merge 8 commits into
Conversation
|
AI review done for Quality: Needs a fix before merge. A standalone Kotlin check reproduced the remaining regression, and the latest merge introduced no additional PR-specific defects.
|
| text = inputText, | ||
| title = stringResource(id = R.string.swap_send), | ||
| readOnly = false, | ||
| autoFocus = autoFocus, |
There was a problem hiding this comment.
Scrolling away from the amount field and back reopens the keyboard and hides the recommendations.
TradeLayout is now the trade_layout lazy item, and each market row is its own item, so the amount field is disposed once it leaves the viewport. autoFocus stays true for the whole screen: TradeFragment.shouldAutoFocusAmount() sets it when Simple Trade opens with an input or output asset, and observeTradeMarketSelection() sets it again when a market is picked. Nothing clears it. On the next composition, InputContent's LaunchedEffect(autoFocus) in InputTextField.kt calls requestFocus() and keyboardController.show(). onFocusChanged then sets isSendFocused, and shouldShowSwapRecommendedMarketCards drops the list because the field is focused or the keyboard is visible.
Treat autofocus as one-shot in state that survives disposal of this item (SwapContent, or autoFocusAmount on TradeFragment). Clear it after the first focus request, and set it again only for an explicit action such as selecting a market.
…ed-market-list # Conflicts: # app/src/main/java/one/mixin/android/ui/home/web3/trade/SwapContent.kt
There was a problem hiding this comment.
AI review · GPT + Grok · 56cd75d
No confirmed regressions in the changes since the previous review. Whitespace checks passed for both diff ranges. Compilation and trade unit tests were blocked during Gradle setup by the unavailable wrapper distribution and an uncached Foojay plugin in the offline fallback.
…ed-market-list # Conflicts: # app/src/main/java/one/mixin/android/ui/home/web3/trade/SwapContent.kt # app/src/main/java/one/mixin/android/ui/home/web3/trade/SwapRecommendedMarketCards.kt
There was a problem hiding this comment.
AI review · Codex · d92145c
Whitespace checks passed for both diff ranges. Android compilation and the targeted unit tests were blocked during Gradle setup because the wrapper distribution was unavailable and the Foojay plugin was missing from the offline cache.
|
|
||
| val spotTrending = MarketPageMapper | ||
| .spotMarkets(markets = trendingMarkets, fallbackMarkets = allMarkets) | ||
| .filter { market -> market.coinId !in stockCoinIds } |
There was a problem hiding this comment.
Swap drops stocks from Trending, Top Gainers, and Top Losers even when the shared category feed returns them. Market now preserves those entries after #6904, and the old Swap cards showed them too. A standalone Kotlin check reproduced a stock-only Trending feed disappearing entirely from Swap. Preserve the feed’s membership in these tabs while keeping the dedicated Stocks tab.
There was a problem hiding this comment.
AI review · Codex · 05beafb
The latest commit only merges the Perps guide from master, so the previous finding still applies. Both diff whitespace checks passed. Android compilation and the targeted unit tests were blocked because the Foojay Gradle plugin was unavailable offline.
|
|
||
| val spotTrending = MarketPageMapper | ||
| .spotMarkets(markets = trendingMarkets, fallbackMarkets = allMarkets) | ||
| .filter { market -> market.coinId !in stockCoinIds } |
There was a problem hiding this comment.
This still removes stocks from Trending, Top Gainers, and Top Losers even when the shared feed includes them. A standalone Kotlin check against this head showed that stock-only feeds leave Swap with just the Stocks tab. Preserve the feed membership in those three tabs while keeping the dedicated Stocks tab.
No description provided.