fix(swaps): scroll bridge to top from trending token details#27928
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. |
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.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Tag selection rationale:
Not selected:
Performance Test Selection: |
|
✅ E2E Fixture Validation — Schema is up to date |
|




Description
This fixes #27843, where opening Swap from a trending token details page could land the user back on Bridge with the view still scrolled down and the prefilled form off-screen. The fix adds a minimal
scrollToTopOnNavroute param for that navigation path and hasBridgeViewconsume it once on focus so token-details Swap entry points return with the swap form visible at the top.Changelog
CHANGELOG entry: Fixed a bug that kept the swap screen scrolled down after opening Swap from a trending token details page.
Related issues
Fixes: #27843
Manual testing steps
Screenshots/Recordings
Before
N/A
After
N/A
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Low risk: adds a one-time navigation flag that triggers a
ScrollView.scrollToon focus and clears itself; scope is limited to swaps/bridge navigation and related tests.Overview
Fixes a navigation UX bug where returning to
BridgeViewfrom Token Details (notably trending tokens) could leave the unified swap form scrolled off-screen.This introduces a
scrollToTopOnNavroute param inuseSwapBridgeNavigation, hasBridgeViewconsume it viauseFocusEffectto scroll the mainScrollViewtoy=0and thensetParamsto clear the flag, and updates Token Details swap entry points (including sticky footer and buy/sell handlers) to request this behavior. Tests were updated/added to cover the new param propagation and one-time clearing.Written by Cursor Bugbot for commit 86c6e2d. This will update automatically on new commits. Configure here.