fix: wallet/trades UX + SEO + commit Next.js 16 routing migration

Pre-launch audit findings (frontend):

- trades: unlock private history in-page. TradesPageClient only read a CACHED
  view envelope, so a connected user who hadn't visited Settings first saw
  "load settings once to unlock" with no way forward. Added an explicit
  "Unlock trade history" button that mints the view envelope via
  getOrCreateViewEnvelope (one signature, no gas) and reloads — no detour.
- wagmi: broaden connector from injected({target:'metaMask'}) to generic
  injected(). The MetaMask pin made Rabby / Coinbase ext / Brave / Frame / OKX
  and non-MetaMask browsers fail to connect. wagmi v2 EIP-6963 discovery covers
  all injected wallets; still uses the native provider path (not the MM SDK).
- sitemap: drop /settings. It was emitted in sitemap.xml while robots.ts
  disallows it — a self-contradicting crawler signal. Private pages stay out
  of both.
- docs: note the app runs on port 3001 (package.json), not 3000. The CLAUDE.md
  verify sweep targeted 3000 and would have reported every page as down.
- routing: COMMIT the Next.js 16 migration that was sitting uncommitted —
  delete middleware.ts, add root proxy.ts (next-intl createMiddleware), update
  next-env.d.ts. Vercel deploys from git, so leaving proxy.ts untracked would
  have shipped the old routing. `next build` confirms "Proxy (Middleware)" is
  active and all routes compile. tsc clean.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
k
2026-05-29 14:34:51 +08:00
parent d50c05b120
commit 3a113aaa8f
6 changed files with 101 additions and 53 deletions
+9 -7
View File
@@ -7,13 +7,15 @@ export const chains = [mainnet] as const
export const config = createConfig({
chains,
connectors: [
injected({
target: 'metaMask',
// Use the native injected provider path in desktop browsers.
// This avoids the MetaMask SDK account-sync bug we hit in the
// in-app browser and keeps connect to a single requestAccounts flow.
shimDisconnect: false,
}),
// Generic injected connector — NOT pinned to target:'metaMask'. Pinning to
// MetaMask made every other injected wallet (Rabby, Coinbase Wallet ext,
// Brave, Frame, Trust, OKX…) fail to connect, and broke in browsers where
// window.ethereum isn't MetaMask. wagmi v2 auto-discovers all injected
// wallets via EIP-6963 (multiInjectedProviderDiscovery, on by default), so
// a generic injected() connector covers them. This still uses the native
// injected provider path (NOT the MetaMask SDK), so it avoids the SDK
// account-sync bug that motivated the original pin.
injected({ shimDisconnect: false }),
],
transports: {
[mainnet.id]: http(),