Skip to content

fix(token-selector): show sell network panel for Rabby with Safe imported - #7890

Merged
elena-zh merged 2 commits into
cowprotocol:developfrom
tenderdeve:fix/7292-safe-rabby-networks-panel
Jul 23, 2026
Merged

elena-zh merged 2 commits into
cowprotocol:developfrom
tenderdeve:fix/7292-safe-rabby-networks-panel

Conversation

@tenderdeve

@tenderdeve tenderdeve commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Closes #7292

When connecting with Rabby using an imported Safe account, the sell token selector did not show the networks panel.

The sell (input) chain panel in useChainPanelState was gated on useIsSmartContractWallet, which is true for Rabby whenever a Safe is imported. That is inconsistent with the rest of the app: both the main network selector (useShouldHideNetworkSelector) and useChainsToSelect only hide network switching for wallets that are actually locked to a single chain (Safe app / Safe via WalletConnect), and explicitly keep it enabled for Rabby.

This switches the panel gate to the same useShouldHideNetworkSelector hook, so the sell networks panel is shown for Rabby+Safe while remaining hidden for a real Safe app / Safe via WC.

Summary by CodeRabbit

  • Bug Fixes
    • Improved network selection behavior based on the selected token field.
    • Network selection is now disabled in the appropriate scenarios while preserving existing yield-related restrictions.

@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

@tenderdeve is attempting to deploy a commit to the cow-dev Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 14fa4bb8-7b12-481c-9244-5a05f9c8a924

📥 Commits

Reviewing files that changed from the base of the PR and between 87a9d50 and ec0b53b.

📒 Files selected for processing (1)
  • apps/cowswap-frontend/src/modules/tokensList/containers/SelectTokenWidget/hooks/useChainPanelState.ts

Walkthrough

The token selector’s chain panel now uses network-selector visibility to determine sell-field availability, replacing smart-contract-wallet-specific gating while preserving the existing YIELD feature-flag behavior.

Changes

Chain panel gating

Layer / File(s) Summary
Network selector visibility gating
apps/cowswap-frontend/src/modules/tokensList/containers/SelectTokenWidget/hooks/useChainPanelState.ts
Uses useShouldHideNetworkSelector for sell-field disablement and retains ENABLE_YIELD_CHAIN_PANEL handling for YIELD trades.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

I’m a bunny guarding chains,
Hiding fewer network panes.
Sell-side paths now show the way,
YIELD still follows flags each day.
Hop, hop—selectors bloom!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: showing the sell network panel for Rabby with an imported Safe.
Description check ✅ Passed The description includes the issue link and explains the behavior change, but it omits the template's To Test and Background sections.
Linked Issues check ✅ Passed The change matches #7292 by switching the sell chain panel gate so Rabby with an imported Safe shows networks.
Out of Scope Changes check ✅ Passed No unrelated code changes are evident beyond the network-panel gating fix and its supporting import/comment updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@elena-zh

Copy link
Copy Markdown
Contributor

@tenderdeve , please rebase the PR to develop

@kernelwhisperer
kernelwhisperer self-requested a review July 23, 2026 10:27

@kernelwhisperer kernelwhisperer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Awesome, thank you!

@kernelwhisperer
kernelwhisperer changed the base branch from main to develop July 23, 2026 10:47
@elena-zh

Copy link
Copy Markdown
Contributor

Hey @tenderdeve , could you please now resolve conflicts? :)

…rted

The sell (input) network panel was hidden for any smart-contract wallet,
which also covered Rabby when a Safe account is imported. That check is
inconsistent with the main network selector and with useChainsToSelect,
both of which use useShouldHideNetworkSelector and only hide network
switching for wallets actually locked to a single chain (Safe app / Safe
via WC), not Rabby. Use the same hook here so the panel is shown.
@kernelwhisperer
kernelwhisperer force-pushed the fix/7292-safe-rabby-networks-panel branch from 603d0d8 to ec0b53b Compare July 23, 2026 10:55
@kernelwhisperer

Copy link
Copy Markdown
Contributor

@elena-zh I rebased it

@vercel

vercel Bot commented Jul 23, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
swap-dev Ready Ready Preview Jul 23, 2026 11:09am

Request Review

@kernelwhisperer
kernelwhisperer requested a review from a team July 23, 2026 11:09
@elena-zh

Copy link
Copy Markdown
Contributor

@elena-zh I rebased it

@kernelwhisperer , thank you so much! I will review it soon then

@elena-zh elena-zh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, thank you!

@elena-zh
elena-zh enabled auto-merge (squash) July 23, 2026 12:48
@elena-zh
elena-zh merged commit f80e6e5 into cowprotocol:develop Jul 23, 2026
13 of 19 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rabby+Safe: show networks panel in the sell token selector

3 participants