Repository navigation
Privy - #437
Open
Olaleye-Blessing wants to merge 6 commits into
Open
Privy#437Olaleye-Blessing wants to merge 6 commits into
Olaleye-Blessing wants to merge 6 commits into
Conversation
✅ Deploy Preview for dapper-sundae-ae0873 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Wagmi is now bridged through @privy-io/wagmi so Privy manages wallet
connections (embedded wallets, its own login modal covering
MetaMask/Coinbase/WalletConnect/etc) instead of RainbowKit's connect
flow. LoginButton now opens Privy's login modal; LogoutButton also
calls Privy's logout(); "Change network" uses wagmi's useSwitchChain.
@privy-io/wagmi's createConfig silently drops any custom `connectors`
array (it wants to own connector management exclusively), and its
WagmiProvider unconditionally clears the connector registry whenever
Privy has no active wallet -- both of which broke Safe{Wallet} support,
since a Safe session never goes through Privy's login flow. Fixed by
splitting each wagmi config in two: a Privy-managed one (no static
connectors) for normal use, and a plain wagmi one with our full
RainbowKit connector list (including "safe") used only when the app is
running inside an iframe. Verified with a real headless-browser test
that the "safe" connector survives in that branch. QueryClientProvider
now wraps WagmiProvider (not the other way around) -- Privy's internal
reconnect logic needs it as an ancestor.
Also fixed, discovered while getting this to actually boot:
- A pre-existing transitive dependency conflict (@privy-io/react-auth
-> x402 -> an old @coinbase/cdp-sdk / @gemini-wallet/core pinning an
incompatible viem) that broke both Turbopack and webpack builds.
Fixed via a scoped pnpm override rather than a blanket viem pin,
since @safe-global/safe-apps-sdk genuinely needs viem@^1.
- viem bumped to the exact version @privy-io/wagmi's peer dep wants.
Bump @breadcoop/ui 1.0.23 -> 2.0.2: our usage (Body/Caption/Heading*/
LiftedButton/Logo/Footer) is API-compatible, verified via full
typecheck/lint/build. Deliberately not adopting its new
ConnectedUserProvider/BreadUIKitProvider -- that version's user-state
shape drops the chainConfig/feature-flags data our app threads through
useConnectedUser everywhere, so it's not a drop-in replacement.
The new @breadcoop/ui's barrel file re-exports its navbar/auth/
connected-user submodules (Privy/wagmi/RainbowKit-heavy) without
declaring sideEffects:false, so bundlers couldn't tree-shake them out
even though we only import Logo/Body/LiftedButton -- added
`@breadcoop/ui` to next.config.js's optimizePackageImports, which
brought every route's bundle size back down (slightly below the
pre-bump baseline, in fact).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The library now declares sideEffects:false, which fixed tree-shaking for most routes on its own. Kept optimizePackageImports though: verified by removing it and rebuilding that the Home route's specific import mix still doesn't tree-shake cleanly without it (~306kB vs ~526kB First Load JS), while other routes are fine either way. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Olaleye-Blessing
force-pushed
the
privy
branch
from
September 17, 2026 05:53
1c7b6c6 to
15b370b
Compare
Olaleye-Blessing
marked this pull request as ready for review
September 17, 2026 05:56
Ports the Safe-transaction-status portion of PR #415 onto privy: a dedicated SafeTransactionModal (PENDING/WAITING/CONFIRMED/REJECTED/ EXPIRED views with signer-progress tracking and a 30-min expiry), a persistent nav SafeIndicatorBadge while a Safe is connected, and the SafeTransactionWatcher that polls getBySafeTxHash so SAFE_SUBMITTED transactions no longer get stuck "in process" forever. Deliberately not ported from #415: - The nav account-widget (balance chip/avatar) diff -- privy's account-menu.tsx already has this, shipped separately via "Show bread balance in the navbar", using the newer semantic Tailwind color tokens. #415's version would have regressed that to hardcoded hex colors. - @privy-io/react-auth ^3.27.2 + 2 NEXT_PUBLIC_PRIVY_* env vars -- leftover from since-reverted commits on #415, zero actual usages anywhere in its diff. - The blo ^1.1.1 -> ^1.2.0 bump -- only consumer was the skipped account-menu.tsx diff. Also fixes a real bug found while integrating: #415 added SafeTransactionWatcher but never mounted it anywhere (not in TransactionsContext.tsx, not in the new modal) -- so SAFE_SUBMITTED transactions would still never resolve despite the new watcher existing. Wired it into TransactionsContext.tsx alongside the existing TransactionWatcher, mirroring that component's pattern. Verified: tsc --noEmit, next lint, and a full production build all clean. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Ports PR #425's "fund your embedded wallet -> auto-bake BREAD" feature onto privy's existing Privy-bridged wagmi plumbing, deliberately without adopting #425's own auth-plumbing rewrite (see below for why). Flow: sign in -> embedded wallet (Privy) -> FundOnSignIn nudges funding if empty -> FundWallet modal offers 3 options (fund from a connected browser wallet / Privy on-ramp / LiFi bridge) -> xDAI auto-bakes to BREAD via ButteredBread's payable mint(receiver), a gas-sponsored embedded-wallet tx (Privy's own paymaster, dashboard config only -- no custom relayer). New: src/app/components/fund-wallet/{FundButton,FundFromWallet, FundOnSignIn,FundWallet,useFundFromConnectedWallet}, nav/ privy-deposit-button.tsx, core/hooks/{useAutoBakeBread,useSponsoredTx, useWatchFundedXdai}. Wired PrivyDepositButton into account-menu.tsx's balance chip and <FundOnSignIn /> into layout.tsx (keeping the RainbowKit styles.css import -- privy still needs RainbowKit for the Safe-iframe wagmi config, unlike #425 which removed it entirely). Real bug fixed while porting: useWatchFundedXdai (the block-polling auto-bake watcher) was only invoked inside FundWallet, so it only ran while that modal was mounted -- an on-ramp or bridge deposit landing after the user closed the modal would never auto-bake. Moved it to FundOnSignIn (mounted globally in layout.tsx) so it runs for the embedded wallet's whole session, and removed the modal-scoped call entirely rather than running both (two independent watcher instances racing on the same balance increase would have double-minted BREAD). Also hardened for privy's "users-without-wallets" embedded-wallet policy (kept as-is; #425 used "all-users", not adopted): FundWallet's on-ramp button and FundFromWallet's submit button now also disable when there's no embedded wallet, with a clear message, instead of only surfacing a thrown error after the user fills in an amount. Also ported (Safe{Wallet}-support and dead-code cleanup, not deposit specific): Swap.tsx/VotingPowerPanel.tsx's RainbowKit useChainModal -> wagmi useSwitchChain swap (mirrors what login-button.tsx already does on privy); LPVaultTransactionModal.tsx/WithdrawTransaction.tsx's Safe-multisig-aware submission support; ButteredBread.ts's ERC20InsufficientBalance ABI entry (error-decoding support). Cleaned up VaultPanel.tsx's leftover debug console.logs and dead commented imports, and removed CastVote.tsx's confirmed-dead useChainModal import (referenced only in a comment). Deliberately NOT ported from #425 (see plan doc for full reasoning): - AppProvider.tsx/WagmiProviderWrapper.tsx/getConfig.ts/privyConfig.ts rewrite -- #425 removes RainbowKit entirely and never replaces Safe {Wallet} connector support, silently orphaning useAutoConnect's isSafe detection (always false, since no config ever registers a "safe" connector). privy's iframe-conditional dual-config keeps RainbowKit specifically to preserve that, verified with a real headless-browser iframe test in an earlier session. - login-button.tsx rewrite -- privy's already uses usePrivy().login(). - @privy-io/react-auth/@privy-io/wagmi version bumps -- #425 never solved the x402->viem transitive dependency duplication privy fixed via a scoped pnpm-workspace.yaml override; adopting newer versions wasn't obviously safer without redoing that work. - netlify.toml/next.config.js Node-heap and @farcaster/mini-app-solana workarounds -- band-aids for the above unfixed viem duplication. Confirmed privy doesn't need them: a clean build succeeds without either, both before and after this change. - createOnLogin: "all-users" -- kept privy's "users-without-wallets". - WithdrawTransaction.tsx's silent-catch error handling -- privy didn't have the earlier error-surfacing fix for this file either (issue #408, branch fix-wallet-connect-lp-issue, never merged to development), so this isn't a regression from where privy already stood; left as its own separate follow-up per user decision. Verified: tsc --noEmit, next lint, a full production build (bundle sizes stayed flat), and a live dev-server pass over / and /governance/lp-vaults with no new console errors. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Ports PR #445's hero redesign: SolidarityHero replaces the old headline+swap-widget block on the homepage with an auto-fading 3-image carousel (HeroImageCarousel, respects prefers-reduced-motion), a circulated-BREAD-in-USD headline with Distributed/Supporters/APY stat chips (reusing the existing hero data hooks/query keys so TanStack dedupes), and a "Support fund" CTA (SupportFundButton) that opens Privy login when signed out or the Fund-your-account deposit module (#425's FundWallet, ported in the previous commit) when signed in. Placeholder images at public/hero/hero-{1,2,3}.png -- flagged by the PR as temporary, need the real photos. page.tsx's diff didn't apply cleanly (a grid-layout tweak landed on this branch after #445's diff was generated) -- applied the hero swap manually; confirmed via the diff that no other part of page.tsx was touched. This removes the inline swap/bake widget from the homepage top, replaced by the hero CTA -- a real product change, not just a visual refresh. Real bug fixed while porting, found via a full production build: first attempt showed `/`'s First Load JS jump from ~306kB to ~1.47MB. Root cause: FundWallet.tsx statically imports Bridge (the LiFi widget, large) and Privy's useFundWallet on-ramp hook (which pulls in Solana support code from Privy's chain-agnostic SDK) -- both previously loaded on demand elsewhere (see SwapWrapper's next/dynamic pattern for NewSwap), but SupportFundButton being unconditionally rendered on the homepage made this reachable eagerly. Fixed in two parts: - FundWallet.tsx: Bridge is now dynamic()-imported, only loaded when the user clicks "Bridge crypto". - Made FundWallet itself a dynamic() import at all three of its call sites (SupportFundButton, PrivyDepositButton, FundOnSignIn) rather than a static one, since webpack/Next's automatic chunk-splitting wasn't deduping a module reachable from multiple independent entry points into the shared bundle as hoped -- it created a route-specific chunk for `/` instead. Making it lazy everywhere sidesteps that heuristic entirely: the on-ramp/Solana code now only loads once a user actually opens the Fund modal, regardless of entry point. Result: `/` back down to ~358kB (the remaining ~52kB over the 306kB pre-hero baseline is the new hero component code itself). Verified: tsc --noEmit, next lint, three full production builds (tracking the bundle-size fix), and a live dev-server pass over / with no new console errors and the hero rendering correctly (carousel, fallback headline figure, stat chips). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- next.config.js: disable Sentry source-map GENERATION on non-production builds (dryRun only skips upload); this is the memory hog that OOMs the CI/Netlify build (exit 134) on the Privy/wagmi/LiFi graph. - CI: give the Next Build step a 6144MB heap for headroom. - Hero headline now uses font-breadDisplay font-[900] (same font + weight as the "We decide, together." heading, text-h2) instead of body font-bold. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Sep 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.