Skip to content

Conversation

@MananTank
Copy link
Member

@MananTank MananTank commented Oct 17, 2025


PR-Codex overview

This PR enhances error handling in the swap-ui.tsx component by providing a more informative error message when fetching quote details fails.

Detailed summary

  • Added the multiline prop to the component.
  • Updated the error message for preparedResultQuery.error to display preparedResultQuery.error.message if available, defaulting to "Failed to get a quote".
  • Retained existing error messages for buyTokenQuery and sellTokenQuery.

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

Summary by CodeRabbit

  • Bug Fixes
    • Improved error display in the swap widget: error text now shows a more specific message when available, falls back to a generic "Failed to get a quote" message otherwise, and supports multiline wrapping so longer errors are fully visible.

@vercel
Copy link

vercel bot commented Oct 17, 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 Oct 18, 2025 0:13am
nebula Ready Ready Preview Comment Oct 18, 2025 0:13am
thirdweb_playground Ready Ready Preview Comment Oct 18, 2025 0:13am
thirdweb-www Ready Ready Preview Comment Oct 18, 2025 0:13am
wallet-ui Ready Ready Preview Comment Oct 18, 2025 0:13am

💡 Enable Vercel Agent with $100 free credit for automated AI reviews

@linear
Copy link

linear bot commented Oct 17, 2025

@changeset-bot
Copy link

changeset-bot bot commented Oct 17, 2025

⚠️ No Changeset found

Latest commit: ca16ec7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@MananTank MananTank marked this pull request as ready for review October 17, 2025 18:32
@MananTank MananTank requested review from a team as code owners October 17, 2025 18:32
@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Oct 17, 2025
Copy link
Member Author

MananTank commented Oct 17, 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.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 17, 2025

Walkthrough

Error rendering in the Swap widget now displays the API error message when available (using preparedResultQuery.error.message), falling back to "Failed to get a quote". The error Text component now has multiline enabled to allow wrapping.

Changes

Cohort / File(s) Summary
SwapWidget error handling
packages/thirdweb/src/react/web/ui/Bridge/swap-widget/swap-ui.tsx
Use preparedResultQuery.error.message if present, otherwise fallback to "Failed to get a quote". Add multiline prop to the Text component to allow error text wrapping.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description lacks proper completion of the template sections. While the description includes a helpful PR-Codex auto-generated overview that explains the changes (error message updates and multiline prop addition), the template-required sections like "Notes for the reviewer" and "How to test" are not meaningfully filled out—they remain as template comments rather than author-provided guidance. The PR would benefit from explicit reviewer notes and testing instructions to facilitate the review process.
✅ Passed checks (4 passed)
Check name Status Explanation
Title Check ✅ Passed The title "[MNY-275] Surface the error from bridge API in SwapWidget UI" is clear, specific, and directly aligned with the actual changes made. It includes the issue tag and describes the primary change—improving error handling by displaying API error messages in the SwapWidget UI. The title accurately reflects the main objective without vague language.
Linked Issues Check ✅ Passed The pull request directly addresses the objective stated in MNY-275: "Surface the error returned by the quote/bridge API in the SwapWidget UI." The changes implement this by updating the error message rendering to display preparedResultQuery.error.message when available, with a fallback to "Failed to get a quote." The addition of the multiline prop ensures proper formatting of these error messages. The implementation aligns precisely with the requirement to surface API errors to users.
Out of Scope Changes Check ✅ Passed
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch mny-275

📜 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 dad67b8 and ca16ec7.

📒 Files selected for processing (1)
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/swap-ui.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/swap-ui.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). (2)
  • GitHub Check: Size
  • 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.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 17, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 64.51 KB (0%) 1.3 s (0%) 147 ms (+178.95% 🔺) 1.5 s
thirdweb (cjs) 365.68 KB (0%) 7.4 s (0%) 533 ms (+8.68% 🔺) 7.9 s
thirdweb (minimal + tree-shaking) 5.73 KB (0%) 115 ms (0%) 68 ms (+2249.54% 🔺) 182 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 40 ms (+1139.22% 🔺) 51 ms
thirdweb/react (minimal + tree-shaking) 19.13 KB (0%) 383 ms (0%) 54 ms (+1266.84% 🔺) 437 ms

@codecov
Copy link

codecov bot commented Oct 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.90%. Comparing base (b1a7808) to head (ca16ec7).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8277   +/-   ##
=======================================
  Coverage   54.89%   54.90%           
=======================================
  Files         919      919           
  Lines       60622    60622           
  Branches     4126     4116   -10     
=======================================
+ Hits        33278    33282    +4     
+ Misses      27242    27239    -3     
+ Partials      102      101    -1     
Flag Coverage Δ
packages 54.90% <ø> (+<0.01%) ⬆️
see 4 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.

@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 18, 2025

Merge activity

<!--

## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes"

If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000):

## Notes for the reviewer

Anything important to call out? Be sure to also clarify these in your comments.

## How to test

Unit tests, playground, etc.

-->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on improving error handling in the `swap-ui.tsx` component by providing more detailed error messages when fetching data fails.

### Detailed summary
- Added `multiline` property to a component.
- Updated error message for `preparedResultQuery.error` to display the specific error message if available, falling back to "Failed to get a quote".
- Retained existing error messages for `buyTokenQuery` and `sellTokenQuery`.

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

<!-- end pr-codex -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

* **Bug Fixes**
  * Improved error display in the swap widget: error text now shows a more specific message when available, falls back to a generic failure message otherwise, and supports multiline wrapping so longer errors are fully visible to users.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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