Skip to content

Conversation

@fairlighteth
Copy link
Contributor

@fairlighteth fairlighteth commented Dec 5, 2025

Summary

  • BUY selector now shows all app-supported chains but disables targets that aren’t bridgeable from the current source; the source remains enabled for same-chain swaps. Route availability is pre-checked and merged into the
    disabled set.
  • SELL selector unchanged: still driven by the wallet/app-supported list.
  • Desktop and mobile chain selectors surface disabled and loading states (blocked clicks, shimmer on loading, tooltip/title for unsupported targets).
  • Destination filtering remains scoped to app-supported chains; defaultChainId stays coherent when the selected target is invalid.
  • Disabled tooltip string is localized (es-ES, ru-RU).

Clarification

  • BUY (output): full app-supported list, with disabled targets when not bridgeable from the current source (bridge destinations + route checks); source chain is injected if absent.
  • SELL (input): wallet/app-supported list, independent of bridge data.

Screenshot 2025-12-05 at 18 10 44Screenshot 2025-12-05 at 18 10
50

Mobile chain sliding selector tooltip on tap of a non-supported chain
Screenshot 2025-12-06 at 09 18 33
Screenshot 2025-12-06 at 09 19 29

To Test

  1. BUY selector on a bridge-supported source (e.g., Ethereum):

    • All app-supported chains render; bridgeable targets are enabled.
    • Non-bridgeable targets are disabled only if the source/destination isn’t supported or route check fails.
    • Selection works for enabled targets.
  2. BUY selector on a non-bridgeable source (e.g., Sepolia):

    • List shows all chains; non-source chains disabled, source enabled.
    • Disabled chains show the tooltip “This destination is not supported for this source chain.”
    • Disabled clicks do nothing; source selection persists.
  3. Same-chain swap:

    • Source chain is present/enabled; defaultChainId falls back sensibly if the stored target is invalid.
  4. SELL selector:

    • Behavior unchanged; wallet/app-supported chains only.
  5. i18n:

    • Disabled tooltip appears in es-ES and ru-RU translations.

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.

@vercel
Copy link

vercel bot commented Dec 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
cowfi Ready Ready Preview Dec 15, 2025 10:36am
explorer-dev Ready Ready Preview Dec 15, 2025 10:36am
swap-dev Ready Ready Preview Dec 15, 2025 10:36am
widget-configurator Ready Ready Preview Dec 15, 2025 10:36am
2 Skipped Deployments
Project Deployment Review Updated (UTC)
cosmos Ignored Ignored Dec 15, 2025 10:36am
sdk-tools Ignored Ignored Preview Dec 15, 2025 10:36am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 5, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/token-selector-13

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

Choose a reason for hiding this comment

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

"Сеть назначения не доступна для выбранной исходной сети"

Copy link
Contributor

@elena-zh elena-zh left a 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: image

All chains in the Buy token field.
image

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.

@fairlighteth
Copy link
Contributor Author

@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
Screenshot 2025-12-09 at 16 53 50

@fairlighteth fairlighteth requested a review from elena-zh December 9, 2025 16:56
Copy link
Contributor

@elena-zh elena-zh left a 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants