Skip to content

Conversation

@gregfromstl
Copy link
Contributor

@gregfromstl gregfromstl commented Aug 28, 2025


PR-Codex overview

This PR introduces enhancements to the thirdweb checkout widget, allowing it to function without a connected wallet. It also improves UI text for clarity and adds error handling for the widget.

Detailed summary

  • Updated text in WalletFiatSelection for better clarity.
  • Improved error handling in CheckoutWidget with a retry option.
  • Removed unused imports and props in DirectPayment.
  • Simplified wallet connection logic in DirectPayment.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • New Features

    • Checkout widget can now be used without connecting a wallet.
    • Bridge flow shows a clear error message and a Retry action when data fetching fails.
  • Style

    • Updated copy: "Connect Another Wallet" → "Connect a Wallet"; "Use a different wallet to pay" → "Pay with any web3 wallet"; "Buy crypto and bridge in one step" → "Onramp and pay in one step".
  • Chores

    • Added a patch changeset entry for the release.

@gregfromstl gregfromstl requested review from a team as code owners August 28, 2025 00:21
@linear
Copy link

linear bot commented Aug 28, 2025

@changeset-bot
Copy link

changeset-bot bot commented Aug 28, 2025

🦋 Changeset detected

Latest commit: caa9fa9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
thirdweb Patch
@thirdweb-dev/nebula Patch
@thirdweb-dev/wagmi-adapter Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Aug 28, 2025

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

Project Deployment Preview Comments Updated (UTC)
docs-v2 Ready Ready Preview Comment Aug 28, 2025 4:21am
nebula Ready Ready Preview Comment Aug 28, 2025 4:21am
thirdweb_playground Ready Ready Preview Comment Aug 28, 2025 4:21am
thirdweb-www Ready Ready Preview Comment Aug 28, 2025 4:21am
wallet-ui Ready Ready Preview Comment Aug 28, 2025 4:21am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 28, 2025

Walkthrough

Adds a patch changeset; CheckoutWidget now shows an error UI with a retry for bridge-data fetch failures; DirectPayment removes wallet-connection gating and the connectOptions prop and is no longer passed from BridgeOrchestrator; small copy updates in WalletFiatSelection.

Changes

Cohort / File(s) Summary
Release notes
.changeset/eager-loops-fold.md
Adds a patch changeset noting checkout widget can be used without a connected wallet.
Checkout error handling UI
packages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsx
Adds an error state rendering using Container/Text and a ghost-styled Retry Button that calls bridgeDataQuery.refetch(); new UI imports added; no public API changes.
DirectPayment API and usage
packages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsx, packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx
Removes wallet-connection gating and ConnectButton usage; deletes connectOptions from DirectPaymentProps and the DirectPayment parameter list; BridgeOrchestrator no longer passes connectOptions to DirectPayment.
Copy updates
packages/thirdweb/src/react/web/ui/Bridge/payment-selection/WalletFiatSelection.tsx
Updates UI text: "Connect Another Wallet" → "Connect a Wallet"; "Use a different wallet to pay" → "Pay with any web3 wallet"; "Buy crypto and bridge in one step" → "Onramp and pay in one step".

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User
  participant CW as CheckoutWidget
  participant API as Bridge Data API

  U->>CW: Open widget
  CW->>API: fetch bridge data
  alt success
    API-->>CW: data
    CW-->>U: Render normal content
  else error
    API-->>CW: error
    Note right of CW #f9f1d7: New error UI with "Something went wrong." + Retry
    CW-->>U: Show error + Retry Button
    U->>CW: Click Retry
    CW->>API: refetch()
    API-->>CW: data or error
  end
Loading
sequenceDiagram
  autonumber
  participant BO as BridgeOrchestrator
  participant DP as DirectPayment
  participant U as User

  BO->>DP: Init direct payment (without connectOptions)
  Note right of DP #e6f7ff: Always renders primary Button (no ConnectButton)
  U->>DP: Click primary action
  DP-->>BO: onContinue()
  BO-->>U: Proceed to next step
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • TEAM-0000: Entity not found: Issue - Could not find referenced Issue.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b046262 and caa9fa9.

📒 Files selected for processing (1)
  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/WalletFiatSelection.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/WalletFiatSelection.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Unit Tests
  • GitHub Check: Size
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Lint Packages
  • GitHub Check: Build Packages
  • GitHub Check: Analyze (javascript)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch greg/mny-124-allow-proceeding-past-first-payment-widget-page-with-no

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Aug 28, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Aug 28, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
.changeset/eager-loops-fold.md (1)

1-5: Tighten the changeset note for clarity and consistency.

Consider clarifying scope and adding a period.

-Allows using the checkout widget without a wallet connected
+CheckoutWidget: allow using the widget without a wallet connected.
packages/thirdweb/src/react/web/ui/Bridge/payment-selection/WalletFiatSelection.tsx (1)

124-124: Label can be context-aware.

When the user already has connected wallets, “Connect another wallet” is clearer; otherwise “Connect a wallet”.

-                  Connect a Wallet
+                  {connectedWallets.length > 0
+                    ? "Connect another wallet"
+                    : "Connect a wallet"}
packages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsx (1)

427-438: Handle all error states, add a11y, and prevent multiple retries.

  • Also handle locale load failures to avoid spinner lock.
  • Mark error region for assistive tech.
  • Disable Retry during refetch.
-  if (bridgeDataQuery.isError) {
+  if (bridgeDataQuery.isError || localeQuery.isError) {
     content = (
-      <Container flex="column" center="both" gap="md" p="md" py="xl">
+      <Container
+        flex="column"
+        center="both"
+        gap="md"
+        p="md"
+        py="xl"
+        role="alert"
+        aria-live="polite"
+      >
         <Text center size="md" weight={600}>
           Something went wrong.
         </Text>
-        <Button variant="ghost" onClick={() => bridgeDataQuery.refetch()}>
+        <Button
+          variant="ghost"
+          onClick={() => bridgeDataQuery.refetch()}
+          disabled={bridgeDataQuery.isFetching}
+          aria-busy={bridgeDataQuery.isFetching}
+        >
           Retry
         </Button>
       </Container>
     );
   }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between f33d8f1 and b046262.

📒 Files selected for processing (5)
  • .changeset/eager-loops-fold.md (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx (0 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsx (2 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/WalletFiatSelection.tsx (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from @/types or local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial, Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose

Files:

  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/WalletFiatSelection.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)

Files:

  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/WalletFiatSelection.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsx
🧠 Learnings (7)
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : Support for in-app wallets (social/email login)

Applied to files:

  • .changeset/eager-loops-fold.md
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules

Applied to files:

  • .changeset/eager-loops-fold.md
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : Smart wallets with account abstraction

Applied to files:

  • .changeset/eager-loops-fold.md
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Interactive UI that relies on hooks (`useState`, `useEffect`, React Query, wallet hooks).

Applied to files:

  • packages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsx
📚 Learning: 2025-06-06T23:46:08.795Z
Learnt from: MananTank
PR: thirdweb-dev/js#7298
File: apps/dashboard/src/app/nebula-app/move-funds/move-funds.tsx:424-424
Timestamp: 2025-06-06T23:46:08.795Z
Learning: The thirdweb project has an ESLint rule that restricts direct usage of `defineChain`. When it's necessary to use `defineChain` directly, it's acceptable to disable the rule with `// eslint-disable-next-line no-restricted-syntax`.

Applied to files:

  • packages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsx
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{ts,tsx} : Import UI primitives from `@/components/ui/*` (Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps

Applied to files:

  • packages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Reuse core UI primitives; avoid re-implementing buttons, cards, modals.

Applied to files:

  • packages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsx
🧬 Code graph analysis (2)
packages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsx (1)
packages/thirdweb/src/react/web/ui/components/buttons.tsx (1)
  • Button (19-140)
packages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsx (1)
packages/thirdweb/src/react/web/ui/components/text.tsx (1)
  • Text (17-32)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Size
  • GitHub Check: Lint Packages
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: Build Packages
  • GitHub Check: Unit Tests
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (3)
packages/thirdweb/src/react/web/ui/Bridge/CheckoutWidget.tsx (2)

25-29: LGTM: lightweight UI imports.

New UI primitives are within our design system and won’t impact bundle size materially.


427-438: Connect gating removal verified and correctly applied

All checks confirm that connectOptions has been fully removed from the direct payment flow:

  • DirectPaymentProps no longer declares connectOptions (packages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsx)
  • No JSX call sites pass connectOptions to <DirectPayment> anywhere in the codebase
  • In BridgeOrchestrator, the direct payment branch renders <DirectPayment> without forwarding connectOptions

No further changes needed.

packages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsx (1)

179-181: LGTM: proceed CTA always enabled.

Matches the PR objective to proceed without requiring wallet connection.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 28, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 64.06 KB (0%) 1.3 s (0%) 649 ms (+123.47% 🔺) 2 s
thirdweb (cjs) 357.05 KB (0%) 7.2 s (0%) 2.3 s (+6.71% 🔺) 9.5 s
thirdweb (minimal + tree-shaking) 5.73 KB (0%) 115 ms (0%) 135 ms (+844.91% 🔺) 249 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 93 ms (+1730.1% 🔺) 103 ms
thirdweb/react (minimal + tree-shaking) 19.15 KB (0%) 383 ms (0%) 158 ms (+372.64% 🔺) 541 ms

@codecov
Copy link

codecov bot commented Aug 28, 2025

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.54%. Comparing base (f33d8f1) to head (caa9fa9).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...thirdweb/src/react/web/ui/Bridge/DirectPayment.tsx 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7937      +/-   ##
==========================================
+ Coverage   56.53%   56.54%   +0.01%     
==========================================
  Files         904      904              
  Lines       58592    58573      -19     
  Branches     4143     4140       -3     
==========================================
- Hits        33126    33123       -3     
+ Misses      25360    25344      -16     
  Partials      106      106              
Flag Coverage Δ
packages 56.54% <0.00%> (+0.01%) ⬆️
Files with missing lines Coverage Δ
...web/src/react/web/ui/Bridge/BridgeOrchestrator.tsx 7.05% <ø> (+0.02%) ⬆️
...i/Bridge/payment-selection/WalletFiatSelection.tsx 7.19% <ø> (ø)
...thirdweb/src/react/web/ui/Bridge/DirectPayment.tsx 8.08% <0.00%> (-1.01%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gregfromstl gregfromstl added the merge-queue Adds the pull request to Graphite's merge queue. label Aug 28, 2025
Copy link
Contributor Author

Merge activity

  • Aug 28, 4:02 AM UTC: The merge label 'merge-queue' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-queue Adds the pull request to Graphite's merge queue. packages SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants