Skip to content

Conversation

@gregfromstl
Copy link
Contributor

@gregfromstl gregfromstl commented Sep 23, 2025


PR-Codex overview

This PR focuses on enhancing the BuyWidget by displaying error messages when transactions fail, improving user feedback during the transaction process.

Detailed summary

  • Updated the Text component in StepRunner.tsx to conditionally render error messages.
  • If an error occurs, it displays the error message or a generic error message.
  • If no error occurs, it shows a message instructing users to keep the window open until transactions complete.

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

Summary by CodeRabbit

  • New Features
    • Bridge flow now shows contextual inline error messages with prominent styling during transactions.
  • Bug Fixes
    • Buy widget surfaces failure error messages for clearer purchase feedback.
    • Step runner displays original guidance when no errors, and switches to the specific error message and danger styling when issues occur.
  • Chores
    • Patch release prepared to deliver these updates.

@gregfromstl gregfromstl requested review from a team as code owners September 23, 2025 23:52
@vercel
Copy link

vercel bot commented Sep 23, 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 Sep 24, 2025 0:28am
nebula Ready Ready Preview Comment Sep 24, 2025 0:28am
thirdweb_playground Ready Ready Preview Comment Sep 24, 2025 0:28am
thirdweb-www Ready Ready Preview Comment Sep 24, 2025 0:28am
wallet-ui Ready Ready Preview Comment Sep 24, 2025 0:28am

@changeset-bot
Copy link

changeset-bot bot commented Sep 23, 2025

🦋 Changeset detected

Latest commit: 64ab8c7

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 23, 2025

Walkthrough

Adds a changeset for a patch release and updates Bridge StepRunner UI to conditionally display either guidance text or an error message with danger styling based on error state.

Changes

Cohort / File(s) Summary
Release notes / Changeset
.changeset/wicked-cycles-attack.md
Adds patch changeset noting BuyWidget will display failure error messages.
Bridge StepRunner UI
packages/thirdweb/src/react/web/ui/Bridge/StepRunner.tsx
Replaces static info text with conditional rendering: shows error message (danger color) when error exists, otherwise shows original guidance text with line breaks.

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant BridgeLogic as Bridge Logic
  participant StepRunner as StepRunner UI

  User->>BridgeLogic: Initiate bridge steps
  BridgeLogic-->>StepRunner: Status update (progress/success)
  alt Error occurs
    BridgeLogic-->>StepRunner: Error(message)
    Note right of StepRunner #ffefef: Renders error text (danger)\nmessage or fallback
  else No error
    Note right of StepRunner #f0fff0: Renders guidance text\n"Keep this window open..."
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description contains the repository template commented out and a helpful PR-Codex summary but does not fill the required template fields: the formatted PR title, issue tag, "Notes for the reviewer", and explicit "How to test" steps are missing, so the description does not meet the repository's template requirements. The provided summary is useful context but does not replace the missing required sections needed for reviewer guidance and testing. Populate the template before merging: set the PR title in the required format (including scope if applicable), add the issue/Linear tag if available, fill "Notes for the reviewer" with important context and risks, and provide explicit "How to test" instructions (manual steps, affected playground routes, or unit/integration tests) so reviewers can validate the change.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Feature: Displays the buy widget error message" succinctly and accurately summarizes the primary change (showing error messages in the BuyWidget/StepRunner) and is clear for reviewers scanning history. It is concise and directly related to the changeset.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/display-buy-widget-error

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • 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 cd22ec7 and 64ab8c7.

📒 Files selected for processing (2)
  • .changeset/wicked-cycles-attack.md (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/StepRunner.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • .changeset/wicked-cycles-attack.md
  • packages/thirdweb/src/react/web/ui/Bridge/StepRunner.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). (7)
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Size
  • GitHub Check: Unit Tests
  • GitHub Check: Build Packages
  • GitHub Check: Lint Packages
  • GitHub Check: Analyze (javascript)

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.

Comment @coderabbitai help to get the list of available commands and usage tips.

@graphite-app
Copy link
Contributor

graphite-app bot commented Sep 23, 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.

@gregfromstl gregfromstl force-pushed the feat/display-buy-widget-error branch from cd22ec7 to 64ab8c7 Compare September 23, 2025 23:57
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 (1)
.changeset/wicked-cycles-attack.md (1)

1-6: Tighten changeset copy; semver looks correct (patch).

  • Patch bump is appropriate for a UI-only change.
  • Wording nit: use imperative and align scope with where it shows (Buy widget via Bridge StepRunner).

Apply:

-Displays the failure error messages on the BuyWidget
+Display failure error messages in the Buy widget (Bridge StepRunner)

Please also confirm that only the thirdweb package changed in this PR.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • 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 db145b5 and cd22ec7.

📒 Files selected for processing (2)
  • .changeset/wicked-cycles-attack.md (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/StepRunner.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

**/*.{ts,tsx}: Use explicit function declarations and explicit return types in TypeScript
Limit each file to one stateless, single‑responsibility function
Re‑use shared types from @/types where applicable
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Prefer composition over inheritance; use utility types (Partial, Pick, etc.)
Lazy‑import optional features and avoid top‑level side‑effects to reduce bundle size

Files:

  • packages/thirdweb/src/react/web/ui/Bridge/StepRunner.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/StepRunner.tsx
packages/thirdweb/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

packages/thirdweb/**/*.{ts,tsx}: Every public symbol must have comprehensive TSDoc with at least one compiling @example and a custom tag (@beta, @internal, @experimental, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
Lazy‑load heavy dependencies inside async paths (e.g., const { jsPDF } = await import("jspdf"))

Files:

  • packages/thirdweb/src/react/web/ui/Bridge/StepRunner.tsx
.changeset/*.md

📄 CodeRabbit inference engine (AGENTS.md)

.changeset/*.md: Each change in packages/* must include a changeset for the appropriate package
Version bump rules: patch for non‑API changes; minor for new/modified public API

Files:

  • .changeset/wicked-cycles-attack.md
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to .changeset/*.md : Version bump rules: patch for non‑API changes; minor for new/modified public API
📚 Learning: 2025-06-10T00:50:20.795Z
Learnt from: MananTank
PR: thirdweb-dev/js#7315
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx:153-226
Timestamp: 2025-06-10T00:50:20.795Z
Learning: In apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx, the updateStatus function correctly expects a complete MultiStepState["status"] object. For pending states, { type: "pending" } is the entire status object. For error states, { type: "error", message: React.ReactNode } is the entire status object. The current code incorrectly spreads the entire step object instead of passing just the status object.

Applied to files:

  • packages/thirdweb/src/react/web/ui/Bridge/StepRunner.tsx
🧬 Code graph analysis (1)
packages/thirdweb/src/react/web/ui/Bridge/StepRunner.tsx (1)
packages/thirdweb/src/react/web/ui/components/text.tsx (1)
  • Text (18-34)
⏰ 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, webpack)
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Size
  • GitHub Check: Unit Tests
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
packages/thirdweb/src/react/web/ui/Bridge/StepRunner.tsx (1)

379-388: Announce errors to screen readers and harden error typing.

Add aria attributes to announce errors and coerce non-Error values to strings; confirm Text accepts role/aria-live and that useStepExecutor's error can be an Error.

-        <Text center color={error ? "danger" : "secondaryText"} size="xs" multiline>
+        <Text
+          center
+          color={error ? "danger" : "secondaryText"}
+          size="xs"
+          multiline
+          role={error ? "alert" : undefined}
+          aria-live={error ? "assertive" : "polite"}
+        >
-          {error ? (
-            error.message || "An error occurred. Please try again."
-          ) : (
+          {error ? (
+            (error instanceof Error ? error.message : String(error)) ||
+            "An error occurred. Please try again."
+          ) : (
             <>
               Keep this window open until all
               <br /> transactions are complete.
             </>
           )}
         </Text>

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 64.07 KB (0%) 1.3 s (0%) 448 ms (+163.02% 🔺) 1.8 s
thirdweb (cjs) 361.6 KB (0%) 7.3 s (0%) 1.6 s (+8.46% 🔺) 8.9 s
thirdweb (minimal + tree-shaking) 5.73 KB (0%) 115 ms (0%) 141 ms (+1581.11% 🔺) 256 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 99 ms (+2370.36% 🔺) 109 ms
thirdweb/react (minimal + tree-shaking) 19.14 KB (0%) 383 ms (0%) 109 ms (+1385.99% 🔺) 492 ms

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

Labels

packages SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants