Skip to content

feat(transfer): network indicator + switcher (explicit chain, no silent testnet)#412

Merged
jhfnetboy merged 1 commit into
masterfrom
feat/transfer-network-switcher
Jul 2, 2026
Merged

feat(transfer): network indicator + switcher (explicit chain, no silent testnet)#412
jhfnetboy merged 1 commit into
masterfrom
feat/transfer-network-switcher

Conversation

@jhfnetboy

Copy link
Copy Markdown
Member

The transfer page never showed which chain it's on — it silently assumed Sepolia. Adds a NetworkSwitcher (top-right, always visible): active network + Testnet badge, dropdown of networks. Transfers run only on Sepolia today (the whole AA stack is Sepolia-only), so OP Mainnet is shown 'Coming soon' (phase-2 target) instead of offering a switch that would fail (selecting it toasts). Real switching wires in here when mainnet lands. tsc+lint green; next build verified on master (/transfer static).

…nt testnet)

The transfer page never showed which chain it was on, silently assuming Sepolia. Add a
NetworkSwitcher (top-right, always visible): shows the active network with a Testnet badge,
and a dropdown listing networks. Transfers run only on Sepolia today (the whole AA stack —
KMS/DVT/paymaster/contracts — is Sepolia-only), so OP Mainnet is shown as 'Coming soon'
(phase-2 target) rather than offering a switch that would fail; selecting it toasts. Wire
real switching here when mainnet lands.

tsc + lint green.
@jhfnetboy jhfnetboy requested a review from fanhousanbu as a code owner July 2, 2026 05:51
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@clestons clestons left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review: #412 — feat(transfer): NetworkSwitcher

让 transfer 页的活跃网络不再隐式,正确处理了"只有 Sepolia 可用"的当前状态。

NetworkSwitcher.tsx

click-outside 用 pointerdown(触摸友好),effect 仅在 open 时注册,removeEventListener cleanup 正确 ✓
NETWORKS.find(...) ?? NETWORKS[0] — 未知 chainId 降级为 Sepolia ✓
OP Mainnet 标 disabled={!n.available},按钮灰化 + "Coming soon" 标签传达意图清晰 ✓
disabled 阻止 onClick,所以 select() 里的 toast 对 OP Mainnet 不可达 — 但视觉反馈已足够,toast 是未来移除 disabled 时的兜底,无害 ✓
z-50 保证下拉不被遮挡 ✓

transfer/page.tsx

addressBookAPI import 保留(#400 WIP 未合并,master 上该 export 仍存在)✓
<NetworkSwitcher /> 放在 flex justify-end mb-3,布局无破坏 ✓

APPROVE

轮次 执行者 裁决
R1 Sonnet 4.6 APPROVE(无阻塞问题)

@jhfnetboy jhfnetboy merged commit 6ce8205 into master Jul 2, 2026
14 checks passed
@jhfnetboy jhfnetboy deleted the feat/transfer-network-switcher branch July 2, 2026 09:32
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 2, 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.

2 participants