-
Notifications
You must be signed in to change notification settings - Fork 159
refactor(tokenselector): 13 - add support for disabled chain IDs in token selection logic #6627
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
base: feat/token-selector-12
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Сеть назначения не доступна для выбранной исходной сети"
elena-zh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @fairlighteth , works as described, thanks.
However, then I don't get why don't we show the list of all chains in the Buy token selector. Not available should be disabled there.
All chains from Sell token field: 
All chains in the Buy token field.

I do understand that the list is returned by sdk, however, if we implement this logic, it would be nice to have the same list of networks everywhere.
Anyways, it should be another task.
…n chain selection
|
@elena-zh thank you for reviewing. I've refactored this now. We now show the full app-supported chain list in the BUY selector. But we now pre-check routes, and disable non-bridgeable targets (with proper tooltips/loading shimmer states) so BUY matches SELL’s list while blocking unreachable chains. Previously you'd click on a BUY chain and it would show that no routes exist. Now when you open the BUY token selector it pre-checks are routes and disables the chains: Screen.Recording.2025-12-09.at.16.51.53.mov
|
elena-zh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, @fairlighteth , thank you!!
Resolved conflicts in ChainsSelector by keeping branch-13's structure with disabledChainIds/loadingChainIds features.

Summary
disabled set.
defaultChainIdstays coherent when the selected target is invalid.Clarification
Mobile chain sliding selector tooltip on tap of a non-supported chain


To Test
BUY selector on a bridge-supported source (e.g., Ethereum):
BUY selector on a non-bridgeable source (e.g., Sepolia):
Same-chain swap:
defaultChainIdfalls back sensibly if the stored target is invalid.SELL selector:
i18n:
Background
Expose all chains for BUY while preventing selection when no bridge route is available from the current source (via bridge targets + route pre-check), and reflect that state in the UI across desktop/mobile.