-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix: PerpsMarketList navigation, and performance optimizations in TabList cp-7.59.0 #22341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
app/components/UI/Perps/Views/PerpsMarketListView/PerpsMarketListView.tsx
Outdated
Show resolved
Hide resolved
…n PerpsMarketListView - Introduced a flag to ignore programmatic scroll events in the `handleScroll` function to avoid unintended feedback loops. - Updated the scroll handling logic to set the flag before programmatic scrolling and clear it after the animation completes, ensuring smoother tab transitions.
676156d to
c224cda
Compare
|
Hello @abretonc7s @gambinish , I've just tested this locally and when I click on "See all" next to "Explore stocks and commodities", it seems to redirect me to a screen with no assets. I'd expect to see a list of stocks and commodities on the screen Simulator.Screen.Recording.-.iPhone.16e.-.2025-11-10.at.12.19.47.mov |
- Removed lazy loading logic for tab content, ensuring all tabs render their content consistently. - Updated comments for clarity regarding the swipeable tab content structure. - Enhanced readability and maintainability of the component by streamlining the rendering process.
fix_tablist.mp4 |
|


Description
Navigating from a subsection in the PerpHomeScreen should navigate to the proper tab in the MarketList. This PR also introduces some performance optimizations in the horizontal scroll view by memoizing list items to reduce the memory footprint, leading to a snappier behavior.
If we want further optimizations, we can remove swipe navigation, in favor of just pressing the tabs and leaning into lazy loading more.
Changelog
CHANGELOG entry: Fix PerpsMarketList navigation and improve performance on swipeable list view
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/TAT-2039
Manual testing steps
Screenshots/Recordings
Screen.Recording.2025-11-07.at.10.40.56.AM.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Routes "See all" to the correct market tab and refactors MarketListView with swipe/tab sync fixes, simplified filtering, and memoized row items for better performance.
PerpsHomeView: passmarketType="stocks_and_commodities"to Stocks & Commodities section.PerpsMarketTypeSection: supportmarketType="stocks_and_commodities"; on "See All" navigate withdefaultMarketTypeFilterset to providedmarketType.displayMarketsapplying sub-filter only onstocks_and_commodities; replace checks/usages fromfilteredMarkets→displayMarkets.getFilteredMarketsForTab/MarketTypeTabContentandtabsToRender.isScrollingProgrammaticallyguard; syncScrollViewposition on tab change; handle scroll to updatemarketTypeFilterwithout feedback loops.stocks_and_commoditiesand legacyequity/commodity.displayMarkets.length.PerpsMarketRowItem: export asReact.memoto reduce re-renders.PerpsMarketTypeSection.test.tsxto expect specificdefaultMarketTypeFilter.PerpsMarketRowItem.test.tsxrerenders to pass new props copies.Written by Cursor Bugbot for commit 5921889. This will update automatically on new commits. Configure here.