Skip to content

Conversation

@gregfromstl
Copy link
Contributor

@gregfromstl gregfromstl commented Aug 27, 2025

Screenshot 2025-08-27 at 16 48 08

PR-Codex overview

This PR focuses on enhancing the payment widget's user experience by incorporating a hasPaymentId feature, which alters the success message and button visibility based on the presence of a payment ID.

Detailed summary

  • Updated copy on payment widgets to reflect payment ID status.
  • Added hasPaymentId prop to SuccessScreen component.
  • Modified success message based on hasPaymentId.
  • Conditionally rendered the "Continue" button in SuccessScreen.
  • Introduced a new story for PaymentId in SuccessScreen stories.

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

Summary by CodeRabbit

  • New Features

    • Added Rainbow wallet to checkout, expanding available wallet options.
  • UI/Behavior

    • Payment success screen: when a payment link is present it shows a "close and return" message and hides the action button; existing transaction and standard flows unchanged.
  • Documentation

    • Added a Storybook example demonstrating the success-screen variant with a payment ID.
  • Chores

    • Added release metadata to trigger a patch/changelog update.

@gregfromstl gregfromstl requested review from a team as code owners August 27, 2025 23:51
@linear
Copy link

linear bot commented Aug 27, 2025

@changeset-bot
Copy link

changeset-bot bot commented Aug 27, 2025

🦋 Changeset detected

Latest commit: c55b29b

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 27, 2025

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

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 27, 2025

Walkthrough

Adds Rainbow wallet to the CheckoutWidget wallets. Adds an optional boolean prop hasPaymentId to SuccessScreen, set by BridgeOrchestrator from paymentLinkId, changing success text and button rendering. Adds a Storybook story demonstrating hasPaymentId.

Changes

Cohort / File(s) Summary
Checkout wallet addition
apps/dashboard/src/app/pay/components/client/PayPageWidget.client.tsx
Inserts createWallet("me.rainbow") into CheckoutWidget connectOptions.wallets; no other logic or prop changes.
Bridge success flow update
packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx, packages/thirdweb/src/react/web/ui/Bridge/payment-success/SuccessScreen.tsx
BridgeOrchestrator passes hasPaymentId={!!paymentLinkId} to SuccessScreen. SuccessScreen adds optional hasPaymentId?: boolean, updates displayed message and hides the action button when true; prior behavior preserved otherwise.
Storybook: SuccessScreen variant
packages/thirdweb/src/stories/Bridge/SuccessScreen.stories.tsx
Adds PaymentId story exporting same args as TransactionPayment with hasPaymentId: true.
Release metadata
.changeset/cuddly-results-play.md
Adds changeset file for a patch release noting "Updates copy on the payment widgets".

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant BO as BridgeOrchestrator
  participant SS as SuccessScreen
  Note right of BO #DDEBF7: computes flag from paymentLinkId
  BO->>SS: render SuccessScreen({ hasPaymentId: !!paymentLinkId, uiOptions, ... })
  alt hasPaymentId == true
    SS->>SS: show "You can now close this page and return to the application."
    SS-->>BO: no action button rendered
  else hasPaymentId == false
    alt uiOptions.mode == "transaction"
      SS->>SS: show "Click continue to execute your transaction."
      SS-->>BO: render action button (continue)
    else
      SS->>SS: show "Your payment has been completed successfully."
      SS-->>BO: render action button (prior label logic)
    end
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes


📜 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 c4af62b and c55b29b.

📒 Files selected for processing (1)
  • .changeset/cuddly-results-play.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .changeset/cuddly-results-play.md
⏰ 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). (6)
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Size
  • GitHub Check: Lint Packages
  • GitHub Check: Analyze (javascript)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch greg/mny-122-change-copy-of-payment-complete-when-using-payment-link

🪧 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.

@graphite-app
Copy link
Contributor

graphite-app bot commented Aug 27, 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.

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Aug 27, 2025
@vercel vercel bot temporarily deployed to Preview – nebula August 27, 2025 23:52 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 August 27, 2025 23:52 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui August 27, 2025 23:52 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground August 27, 2025 23:52 Inactive
@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Aug 27, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Aug 27, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 64.06 KB (0%) 1.3 s (0%) 305 ms (+155.65% 🔺) 1.6 s
thirdweb (cjs) 357.05 KB (0%) 7.2 s (0%) 971 ms (+9.04% 🔺) 8.2 s
thirdweb (minimal + tree-shaking) 5.73 KB (0%) 115 ms (0%) 87 ms (+1319.77% 🔺) 201 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 40 ms (+1719.54% 🔺) 50 ms
thirdweb/react (minimal + tree-shaking) 19.15 KB (0%) 383 ms (0%) 142 ms (+921.46% 🔺) 525 ms

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 (4)
packages/thirdweb/src/react/web/ui/Bridge/payment-success/SuccessScreen.tsx (2)

129-134: Guard against hiding “Continue” copy in transaction mode

If hasPaymentId is accidentally set during "transaction" flows, the message changes and the action button (below) is hidden, potentially blocking progression. Make the payment-ID override apply only when not in "transaction" mode.

Apply:

-          {hasPaymentId
-            ? "You can now close this page and return to the application."
-            : uiOptions.mode === "transaction"
-              ? "Click continue to execute your transaction."
-              : "Your payment has been completed successfully."}
+          {hasPaymentId && uiOptions.mode !== "transaction"
+            ? "You can now close this page and return to the application."
+            : uiOptions.mode === "transaction"
+              ? "Click continue to execute your transaction."
+              : "Your payment has been completed successfully."}

148-152: Don’t hide the primary action in transaction mode

Mirror the copy logic so the button is only hidden when hasPaymentId and not in "transaction" mode.

Apply:

-        {!hasPaymentId && (
+        {!(hasPaymentId && uiOptions.mode !== "transaction") && (
           <Button fullWidth onClick={onDone} variant="accent">
             {uiOptions.mode === "transaction" ? "Continue" : "Done"}
           </Button>
         )}
packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx (1)

392-393: Pass hasPaymentId only for non-transaction flows

Prevents hiding the “Continue” action in transaction mode if a paymentLinkId is present by mistake.

Apply:

-            hasPaymentId={!!paymentLinkId}
+            hasPaymentId={!!paymentLinkId && uiOptions.mode !== "transaction"}
packages/thirdweb/src/stories/Bridge/SuccessScreen.stories.tsx (1)

226-238: Align the PaymentId story with actual pay-link usage

Using TRANSACTION_UI_OPTIONS with hasPaymentId: true hides the primary action and may confuse readers. Use a fund/direct payment UI option and document the behavior.

Apply:

 export const PaymentId: Story = {
   args: {
     client: storyClient,
     completedStatuses: mockBuyCompletedStatuses,
     hasPaymentId: true,
     preparedQuote: simpleBuyQuote,
     theme: "light",
-    uiOptions: TRANSACTION_UI_OPTIONS.contractInteraction,
+    uiOptions: FUND_WALLET_UI_OPTIONS.ethDefault,
   },
   parameters: {
-    backgrounds: { default: "light" },
+    backgrounds: { default: "light" },
+    docs: {
+      description: {
+        story:
+          "Pay-link behavior (hasPaymentId=true): shows close-page message and hides the Continue/Done button.",
+      },
+    },
   },
 };
📜 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 c4af62b.

📒 Files selected for processing (4)
  • apps/dashboard/src/app/pay/components/client/PayPageWidget.client.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/payment-success/SuccessScreen.tsx (4 hunks)
  • packages/thirdweb/src/stories/Bridge/SuccessScreen.stories.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{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:

  • apps/dashboard/src/app/pay/components/client/PayPageWidget.client.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx
  • packages/thirdweb/src/stories/Bridge/SuccessScreen.stories.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/payment-success/SuccessScreen.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

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

Files:

  • apps/dashboard/src/app/pay/components/client/PayPageWidget.client.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/BridgeOrchestrator.tsx
  • packages/thirdweb/src/stories/Bridge/SuccessScreen.stories.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/payment-success/SuccessScreen.tsx
apps/{dashboard,playground-web}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

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
Use NavLink for internal navigation with automatic active states in dashboard and playground apps
Use Tailwind CSS only – no inline styles or CSS modules
Use cn() from @/lib/utils for conditional class logic
Use design system tokens (e.g., bg-card, border-border, text-muted-foreground)
Server Components (Node edge): Start files with import "server-only";
Client Components (browser): Begin files with 'use client';
Always call getAuthToken() to retrieve JWT from cookies on server side
Use Authorization: Bearer header – never embed tokens in URLs
Return typed results (e.g., Project[], User[]) – avoid any
Wrap client-side data fetching calls in React Query (@tanstack/react-query)
Use descriptive, stable queryKeys for React Query cache hits
Configure staleTime/cacheTime in React Query based on freshness (default ≥ 60s)
Keep tokens secret via internal API routes or server actions
Never import posthog-js in server components

Files:

  • apps/dashboard/src/app/pay/components/client/PayPageWidget.client.tsx
**/*.stories.tsx

📄 CodeRabbit inference engine (CLAUDE.md)

For new UI components, add Storybook stories (*.stories.tsx) alongside the code

Files:

  • packages/thirdweb/src/stories/Bridge/SuccessScreen.stories.tsx
🧬 Code graph analysis (1)
packages/thirdweb/src/stories/Bridge/SuccessScreen.stories.tsx (2)
packages/thirdweb/src/stories/utils.tsx (1)
  • storyClient (15-17)
packages/thirdweb/src/stories/Bridge/fixtures.ts (2)
  • simpleBuyQuote (248-308)
  • TRANSACTION_UI_OPTIONS (830-867)
⏰ 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). (2)
  • GitHub Check: Size
  • GitHub Check: Unit Tests
🔇 Additional comments (2)
apps/dashboard/src/app/pay/components/client/PayPageWidget.client.tsx (1)

63-65: Confirmed Rainbow wallet slug
The identifier "me.rainbow" is indeed the correct slug to use with thirdweb’s createWallet() for Rainbow Wallet. (portal.thirdweb.com, docs-v2.thirdweb-preview.com)

packages/thirdweb/src/react/web/ui/Bridge/payment-success/SuccessScreen.tsx (1)

46-50: Prop addition and default look good

Optional hasPaymentId with a default preserves backward compatibility.

Also applies to: 61-62

@codecov
Copy link

codecov bot commented Aug 27, 2025

Codecov Report

❌ Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.53%. Comparing base (f33d8f1) to head (c55b29b).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ct/web/ui/Bridge/payment-success/SuccessScreen.tsx 0.00% 10 Missing ⚠️
...web/src/react/web/ui/Bridge/BridgeOrchestrator.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7936   +/-   ##
=======================================
  Coverage   56.53%   56.53%           
=======================================
  Files         904      904           
  Lines       58592    58600    +8     
  Branches     4143     4141    -2     
=======================================
+ Hits        33126    33131    +5     
- Misses      25360    25363    +3     
  Partials      106      106           
Flag Coverage Δ
packages 56.53% <0.00%> (+<0.01%) ⬆️
Files with missing lines Coverage Δ
...web/src/react/web/ui/Bridge/BridgeOrchestrator.tsx 6.99% <0.00%> (-0.03%) ⬇️
...ct/web/ui/Bridge/payment-success/SuccessScreen.tsx 12.00% <0.00%> (-0.91%) ⬇️

... and 2 files with indirect coverage changes

🚀 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

gregfromstl commented Aug 28, 2025

Merge activity

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

@gregfromstl gregfromstl merged commit 76cfecb into main Aug 28, 2025
23 of 24 checks passed
@gregfromstl gregfromstl deleted the greg/mny-122-change-copy-of-payment-complete-when-using-payment-link branch August 28, 2025 04:03
@graphite-app graphite-app bot removed the merge-queue Adds the pull request to Graphite's merge queue. label Aug 28, 2025
@joaquim-verges joaquim-verges mentioned this pull request Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Dashboard Involves changes to the Dashboard. packages SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants