Skip to content

Conversation

@joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Dec 4, 2025


PR-Codex overview

This PR focuses on modifying the SwapWidget component by skipping the swap review step when coming from the swap widget, streamlining the user experience during token swaps.

Detailed summary

  • Removed the handleError function and its usage.
  • Skipped the PaymentDetails component in the swap process.
  • Changed the screen ID transition from "2:preview" to "3:execute" directly.
  • Adjusted the back navigation to return to "1:swap-ui".

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

Summary by CodeRabbit

  • Changes
    • Simplified swap widget workflow by removing the payment details review screen. Users now proceed directly from swap selection to execution.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Dec 4, 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 Dec 4, 2025 3:26am
nebula Ready Ready Preview Comment Dec 4, 2025 3:26am
thirdweb_playground Ready Ready Preview Comment Dec 4, 2025 3:26am
thirdweb-www Ready Ready Preview Comment Dec 4, 2025 3:26am
wallet-ui Ready Ready Preview Comment Dec 4, 2025 3:26am

@changeset-bot
Copy link

changeset-bot bot commented Dec 4, 2025

🦋 Changeset detected

Latest commit: c73b607

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

This PR includes changesets to release 4 packages
Name Type
thirdweb Patch
@thirdweb-dev/nebula Patch
@thirdweb-dev/wagmi-adapter Patch
wagmi-inapp 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 Dec 4, 2025

Walkthrough

The changeset removes the payment review/preview screen from the swap widget's user flow, enabling direct navigation from the swap UI to the execution stage. Associated error handling callbacks and payment tracking for the preview step are eliminated. A changeset entry documents this adjustment.

Changes

Cohort / File(s) Summary
Release Metadata
.changeset/floppy-carrots-own.md
Documents patch version for thirdweb package with note: "Skip swap review step when coming from swap widget."
Swap Widget Flow
packages/thirdweb/src/react/web/ui/Bridge/swap-widget/SwapWidget.tsx
Removes the 2:preview screen (PaymentDetails UI) and associated error handling callback. Navigation flow changed from swap-ui → preview → execute to swap-ui → execute. Removes trackPayEvent call and updates back navigation from execute screen to point to swap-ui instead of preview.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

  • Verify all navigation paths are correctly updated, particularly back buttons and entry/exit points in the execute screen
  • Confirm error handling behavior without the dedicated handleError callback—ensure parent components or error boundaries handle issues appropriately
  • Test the direct flow transition from swap-ui to execute to catch any missing state or context dependencies the preview step previously handled
  • Validate that removal of trackPayEvent doesn't impact analytics or metrics collection elsewhere in the flow

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete. It lacks the required PR template structure including an issue tag, notes for reviewers, and testing instructions. Only PR-Codex overview is provided. Complete the PR description following the template: add the Linear issue tag (TEAM-0000 format), add notes for reviewers, and specify how to test the changes.
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 accurately and specifically describes the main change: skipping the swap review step in the swap widget. It directly matches the primary objective documented in the PR.
✨ 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 Skip_swap_review_step_when_coming_from_swap_widget

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.

@joaquim-verges joaquim-verges marked this pull request as ready for review December 4, 2025 03:14
@joaquim-verges joaquim-verges requested review from a team as code owners December 4, 2025 03:14
@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Dec 4, 2025
Copy link
Member Author

joaquim-verges commented Dec 4, 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.

@joaquim-verges joaquim-verges changed the title Skip swap review step when coming from swap widget [SDK] Skip swap review step when coming from swap widget Dec 4, 2025
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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/thirdweb/src/react/web/ui/Bridge/swap-widget/SwapWidget.tsx (1)

146-153: onError callback and error screen are unreachable in current implementation

SwapWidgetProps.onError (line 153) is declared but never invoked. The StepRunner component (lines 403–432) is instantiated without an onError handler—only onBack, onCancel, and onComplete are passed. Nothing calls setScreen({ id: "error", ... }), leaving the ErrorBanner branch (lines 456–470) and the error screen state variant (line 317) as dead code.

If a swap fails during execution, no error callback fires and no error UI displays, breaking documented error-handling behavior for integrators.

Pass an onError handler to StepRunner that invokes props.onError?.(error, screen.preparedQuote) and sets the screen to { id: "error", error, preparedQuote: screen.preparedQuote }.

🧹 Nitpick comments (2)
packages/thirdweb/src/react/web/ui/Bridge/swap-widget/SwapWidget.tsx (2)

367-401: Direct jump from SwapUI to 3:execute matches “skip review” flow; consider analytics coverage

Line 389 changes the onSwap handler to set id: "3:execute" directly, which aligns with the goal of skipping the review/preview step when coming from the swap widget. If you still need a signal for “user confirmed swap” distinct from execution, consider adding a replacement tracking event here since the previous preview-level tracking was removed.


304-307: Remove 2:preview from SwapWidgetScreen union to reflect new flow

The SwapWidgetScreen type (Lines 304-307) still includes the "2:preview" variant even though the preview UI and transitions have been removed, and no remaining code sets or checks for that state. Dropping this variant would keep the type aligned with the actual state machine and avoid confusion for future maintainers.

For example:

 type SwapWidgetScreen =
-  | { id: "1:swap-ui" }
-  | Join<{ id: "2:preview" }, SelectionInfo>
-  | Join<{ id: "3:execute" }, SelectionInfo>
+  | { id: "1:swap-ui" }
+  | Join<{ id: "3:execute" }, SelectionInfo>
📜 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 e0ee69b and c73b607.

📒 Files selected for processing (2)
  • .changeset/floppy-carrots-own.md (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/SwapWidget.tsx (3 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 TypeScript 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 in TypeScript
Avoid any and unknown in TypeScript unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial, Pick, etc.) in TypeScript

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

Files:

  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/SwapWidget.tsx
packages/thirdweb/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

packages/thirdweb/src/**/*.{ts,tsx}: Comment only ambiguous logic in SDK code; avoid restating TypeScript in prose
Load heavy dependencies inside async paths to keep initial bundle lean (e.g. const { jsPDF } = await import("jspdf");)

Lazy-load heavy dependencies inside async paths to keep the initial bundle lean (e.g., const { jsPDF } = await import('jspdf');)

Files:

  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/SwapWidget.tsx
**/*.{js,jsx,ts,tsx,json}

📄 CodeRabbit inference engine (AGENTS.md)

Biome governs formatting and linting; its rules live in biome.json. Run pnpm fix & pnpm lint before committing, ensure there are no linting errors

Files:

  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/SwapWidget.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Lazy-import optional features; avoid top-level side-effects

Files:

  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/SwapWidget.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). (9)
  • GitHub Check: Vercel Agent Review
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Size
  • GitHub Check: Unit Tests
  • GitHub Check: Lint Packages
  • GitHub Check: Build Packages
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
.changeset/floppy-carrots-own.md (1)

1-5: Changeset format and message are clear.

The YAML frontmatter and description follow the standard Changesets convention. The message accurately reflects the PR objective of skipping the swap review step.

Please confirm that the patch version bump is appropriate given the removal of the handleError function and changes to the swap widget flow. If handleError is part of a public API contract, this may warrant a minor version bump instead.

packages/thirdweb/src/react/web/ui/Bridge/swap-widget/SwapWidget.tsx (1)

3-3: Import list correctly trimmed to used hooks

Line 3 now only imports useEffect, useRef, and useState, which matches actual usage in this file and avoids unused-import lint noise.

@codecov
Copy link

codecov bot commented Dec 4, 2025

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8496      +/-   ##
==========================================
- Coverage   54.63%   54.62%   -0.01%     
==========================================
  Files         920      920              
  Lines       61142    61142              
  Branches     4145     4140       -5     
==========================================
- Hits        33402    33397       -5     
- Misses      27638    27643       +5     
  Partials      102      102              
Flag Coverage Δ
packages 54.62% <ø> (-0.01%) ⬇️
see 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.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2025

size-limit report 📦

Path Size
@thirdweb-dev/nexus (esm) 105.66 KB (0%)
@thirdweb-dev/nexus (cjs) 319.47 KB (0%)

@joaquim-verges joaquim-verges merged commit 859032d into main Dec 4, 2025
25 of 27 checks passed
@joaquim-verges joaquim-verges deleted the Skip_swap_review_step_when_coming_from_swap_widget branch December 4, 2025 03:23
@joaquim-verges joaquim-verges mentioned this pull request Dec 4, 2025
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.

2 participants