Skip to content

Conversation

@MananTank
Copy link
Member

@MananTank MananTank commented Jan 12, 2026


PR-Codex overview

This PR introduces a new SelectedTab type for managing tab states in the swap widget and refines various components related to wallet connections and token selections, enhancing the user interface and functionality.

Detailed summary

  • Added SelectedTab type to manage tab states.
  • Updated WalletDotIcon to accept style prop.
  • Enhanced SwapUI and FundWallet to support theme and connectOptions.
  • Refactored DynamicHeight to remove maxHeight prop.
  • Renamed WalletSwitcherConnectionScreen to WalletConnectionScreen.
  • Modified SelectToken to use selectedTab.
  • Implemented mobile and desktop token selection screens.
  • Added YourTokenButton for improved token display.
  • Introduced ScreenHeader for consistent header formatting.

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

Summary by CodeRabbit

Release Notes

  • New Features

    • Tab-based token selection UI with "Your Tokens" and "All Tokens" sections for clearer organization.
    • Multi-chain support for token balance queries and selection.
    • Enhanced wallet connection screens with configurable sizing options.
  • Refactor

    • Reorganized swap widget token and chain selection flows for improved UX structure.
    • Updated wallet connection component architecture and theming integration.

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

@MananTank MananTank requested review from a team as code owners January 12, 2026 16:48
@linear
Copy link

linear bot commented Jan 12, 2026

@changeset-bot
Copy link

changeset-bot bot commented Jan 12, 2026

⚠️ No Changeset found

Latest commit: e38e913

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

@vercel
Copy link

vercel bot commented Jan 12, 2026

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

Project Deployment Review Updated (UTC)
docs-v2 Ready Ready Preview, Comment Jan 12, 2026 5:01pm
nebula Ready Ready Preview, Comment Jan 12, 2026 5:01pm
thirdweb_playground Ready Ready Preview, Comment Jan 12, 2026 5:01pm
thirdweb-www Ready Ready Preview, Comment Jan 12, 2026 5:01pm
wallet-ui Ready Ready Preview, Comment Jan 12, 2026 5:01pm

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Jan 12, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 12, 2026

Walkthrough

This PR refactors the Bridge/Swap widget UI by introducing tab-based navigation, renaming wallet connection components for clarity, and expanding token selection capabilities with new theming and wallet configuration options. Multiple components are restructured to support a multi-tab selection flow instead of single-action interfaces.

Changes

Cohort / File(s) Summary
Wallet Connection Screen Refactoring
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.tsx, packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.tsx
Renamed WalletSwitcherConnectionScreen to WalletConnectionScreen and expanded props with new size ("compact" | "wide") and shouldSetActive fields. Updated WalletManagerScreen to use new component with shouldSetActive={false} and size="compact", plus added activeChain prop.
Tab-Based Chain/Token Selection
packages/thirdweb/src/react/web/ui/Bridge/swap-widget/types.ts, packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-chain.tsx, packages/thirdweb/src/react/web/ui/Bridge/swap-widget/SelectChainButton.tsx
Introduced new SelectedTab discriminated union type to support tab-based navigation. Renamed SelectChainButton to MobileTabSelector with new props selectedTab and onSelect that handle "your-tokens", "all-tokens", and "chain-selector" options. Refactored SelectBridgeChain to use tab-centric API (onSelectTab, selectedTab) and added internal YourTokensButton component for non-mobile rendering.
Extended Token Selection UI
packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-token-ui.tsx, packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx, packages/thirdweb/src/react/web/ui/Bridge/swap-widget/swap-ui.tsx
Expanded SelectToken props to include theme and connectOptions for richer theming and wallet connection configuration. Substantially refactored select-token-ui with new multi-tab UI, wallet connection screen integration, and enhanced token item rendering with chain icons and USD values.
Token Balance Query Enhancement
packages/thirdweb/src/react/web/ui/Bridge/swap-widget/use-tokens.ts
Widened useTokenBalances chainId parameter from number | undefined to number | number[] | undefined and updated URL construction to support multiple chain IDs in a single query. Relaxed activation guard to only require walletAddress.
Component Signature Updates
packages/thirdweb/src/react/web/ui/ConnectWallet/icons/WalletDotIcon.tsx, packages/thirdweb/src/react/web/ui/components/DynamicHeight.tsx
Changed WalletDotIcon from IconFC type to explicit props object { size?: string; style?: React.CSSProperties } and removed color prop dependency. Removed optional maxHeight prop from DynamicHeight component, simplifying its public API.
Modal Style Adjustment
packages/thirdweb/src/react/web/ui/components/Modal.tsx
Added conditional maxHeight constraint to modal container based on size: compact modals use compactModalMaxHeight, wide modals use undefined. Updated DynamicHeight wrapper to no longer pass explicit maxHeight.
Story Updates
packages/thirdweb/src/stories/Bridge/Swap/SelectChain.stories.tsx
Updated all SelectChain story variants to use new SelectedTab type and tab-based props (onSelectTab, selectedTab) instead of chain-based API (onSelectChain, selectedChain).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

🚥 Pre-merge checks | ❌ 3
❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is largely incomplete, containing only the template comment and a PR-Codex auto-generated summary without developer-provided notes on reviewer concerns, testing approach, or detailed implementation rationale. Fill out the template sections: add issue tag (TEAM-0000), provide reviewer notes about breaking changes to public APIs, and document how to test the new Your tokens tab functionality.
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'DO NOT MERGE - Add Your tokens tab' partially relates to the changeset—it references the new 'Your tokens' tab feature, but the 'DO NOT MERGE' prefix is a work-in-progress indicator rather than a descriptive summary of the main change. Remove 'DO NOT MERGE' prefix and use a format like '[SDK] Feature: Add Your tokens tab to swap widget' to clearly describe the primary change and intent.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

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: 2

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/ConnectWallet/screens/WalletSwitcherConnectionScreen.tsx (1)

47-51: Potential inconsistency: useSetupScreen uses hardcoded "compact" instead of props.size.

The size prop is now configurable via props.size, but useSetupScreen still hardcodes size: "compact". This could cause layout inconsistencies when size="wide" is passed to the component.

Proposed fix
   const screenSetup = useSetupScreen({
-    size: "compact",
+    size: props.size,
     wallets: wallets,
     welcomeScreen: undefined,
   });
🤖 Fix all issues with AI agents
In @packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-token-ui.tsx:
- Line 150: The prop binding for showAllWallets currently uses a truthy-or
fallback (props.connectOptions?.showAllWallets || true) which forces true even
when showAllWallets is explicitly false; change the fallback to a
nullish-coalescing fallback (props.connectOptions?.showAllWallets ?? true) so
false is preserved and only undefined/null fall back to true, updating the
expression where showAllWallets is passed into the component.

In @packages/thirdweb/src/react/web/ui/Bridge/swap-widget/use-tokens.ts:
- Around line 80-104: The TODO in select-token-ui.tsx about multi-chainId
filtering must be resolved: either remove the broken multi-chainId feature or
make use-tokens.ts and the consumer compatible with the API. Update
use-tokens.ts (the query building in the hook that sets chainId params) to send
chain IDs in the format the API actually accepts (e.g., a single comma-separated
chainId query value instead of multiple chainId params) and adjust
select-token-ui.tsx to consume the new shape (and delete the `// TODO - this is
not working!!` comment). Ensure the unique symbols to edit are the hook that
builds the URL in use-tokens.ts (the code appending chainId params) and the
component logic in select-token-ui.tsx around the TODO, then test the flow
end-to-end to verify filtering works and remove the TODO before merging.
🧹 Nitpick comments (6)
packages/thirdweb/src/react/web/ui/ConnectWallet/icons/WalletDotIcon.tsx (1)

4-7: Add explicit return type to match TypeScript guidelines and sibling icon patterns.

The function is missing an explicit return type annotation. While the suggested React.ReactElement is valid, other icons in this directory use the IconFC type alias for consistency. However, since WalletDotIcon has different props (with style instead of color), define a proper type alias or use React.JSX.Element for clarity:

Suggested approach
+import type { IconFC } from "./types.js";
+
+type WalletDotIconProps = {
+  size?: string;
+  style?: React.CSSProperties;
+};
+
-export const WalletDotIcon = (props: {
+export const WalletDotIcon = (props: WalletDotIconProps): React.JSX.Element => {
-  size?: string;
-  style?: React.CSSProperties;
-}) => {

Alternatively, inline the return type as : React.JSX.Element without extracting the props type, but ensure consistency with sibling icons where possible.

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

254-303: LGTM!

Consistent with the buy token modal, the sell token modal now also receives theme and connectOptions props. The prop ordering differs slightly from the buy modal (props appear before onClose vs after type), but this is a minor stylistic inconsistency.

Consider aligning prop order for consistency

For maintainability, consider aligning the prop order between buy and sell token modals:

         {modalState.screen === "select-sell-token" && (
           <SelectToken
+            type="sell"
             theme={props.theme}
             connectOptions={props.connectOptions}
+            selections={{
+              buyChainId: props.buyToken?.chainId,
+              sellChainId: props.sellToken?.chainId,
+            }}
+            activeWalletInfo={props.activeWalletInfo}
             onClose={() => {
               setModalState((v) => ({
                 ...v,
                 isOpen: false,
               }));
             }}
             client={props.client}
             selectedToken={props.sellToken}
             currency={props.currency}
             setSelectedToken={(token) => {
               // ...
             }}
-            activeWalletInfo={props.activeWalletInfo}
-            type="sell"
-            selections={{
-              buyChainId: props.buyToken?.chainId,
-              sellChainId: props.sellToken?.chainId,
-            }}
           />
         )}
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.tsx (1)

89-89: Typo in component name: WalletManangerButton should be WalletManagerButton.

Minor typo in the internal component name.

Suggested fix
-function WalletManangerButton(props: {
+function WalletManagerButton(props: {

And update usage at line 89:

-                <WalletManangerButton
+                <WalletManagerButton
packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-chain.tsx (1)

173-177: Missing key attribute on Skeleton elements.

The biome-ignore comment suppresses the lint warning, but using array index as key (or no key at all here) can cause rendering issues if the list changes. Consider using the array index explicitly since these are static placeholders.

Suggested fix
          {props.isPending &&
-           new Array(20).fill(0).map(() => (
-             // biome-ignore lint/correctness/useJsxKeyInIterable: ok
-             <ChainButtonSkeleton />
+           new Array(20).fill(0).map((_, i) => (
+             // biome-ignore lint/suspicious/noArrayIndexKey: static placeholder list
+             <ChainButtonSkeleton key={i} />
            ))}
packages/thirdweb/src/react/web/ui/Bridge/swap-widget/SelectChainButton.tsx (1)

68-92: Consider extracting tab options to a constant for maintainability.

The tab labels "Your Tokens" and "All Tokens" are hardcoded in both Tabs and YourTokensButton (in select-chain.tsx). Consider extracting to a shared constant for consistency.

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

934-1012: Consider extracting duplicate sorting logic into a helper function.

The icon-based sorting logic (tokens with icons first) is duplicated in ChainTokenSelectionScreen (lines 1001-1009, 1028-1036) and YourTokenSelectionScreen (lines 1277-1285). Consider extracting to a shared utility.

Suggested helper
function sortByIconPresence<T extends { icon_uri?: string } | { iconUri?: string }>(tokens: T[]): T[] {
  return [...tokens].sort((a, b) => {
    const aHasIcon = 'icon_uri' in a ? a.icon_uri : a.iconUri;
    const bHasIcon = 'icon_uri' in b ? b.icon_uri : b.iconUri;
    if (aHasIcon && !bHasIcon) return -1;
    if (!aHasIcon && bHasIcon) return 1;
    return 0;
  });
}
📜 Review details

Configuration used: Organization 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 49b80fe and e38e913.

📒 Files selected for processing (14)
  • packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/SelectChainButton.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-chain.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-token-ui.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/swap-ui.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/types.ts
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/use-tokens.ts
  • packages/thirdweb/src/react/web/ui/ConnectWallet/icons/WalletDotIcon.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.tsx
  • packages/thirdweb/src/react/web/ui/components/DynamicHeight.tsx
  • packages/thirdweb/src/react/web/ui/components/Modal.tsx
  • packages/thirdweb/src/stories/Bridge/Swap/SelectChain.stories.tsx
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{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/components/DynamicHeight.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/types.ts
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/swap-ui.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/use-tokens.ts
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-chain.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/icons/WalletDotIcon.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/SelectChainButton.tsx
  • packages/thirdweb/src/react/web/ui/components/Modal.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx
  • packages/thirdweb/src/stories/Bridge/Swap/SelectChain.stories.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-token-ui.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/components/DynamicHeight.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/types.ts
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/swap-ui.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/use-tokens.ts
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-chain.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/icons/WalletDotIcon.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/SelectChainButton.tsx
  • packages/thirdweb/src/react/web/ui/components/Modal.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx
  • packages/thirdweb/src/stories/Bridge/Swap/SelectChain.stories.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-token-ui.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/components/DynamicHeight.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/types.ts
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/swap-ui.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/use-tokens.ts
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-chain.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/icons/WalletDotIcon.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/SelectChainButton.tsx
  • packages/thirdweb/src/react/web/ui/components/Modal.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx
  • packages/thirdweb/src/stories/Bridge/Swap/SelectChain.stories.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-token-ui.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/components/DynamicHeight.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/types.ts
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/swap-ui.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/use-tokens.ts
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-chain.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/icons/WalletDotIcon.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/SelectChainButton.tsx
  • packages/thirdweb/src/react/web/ui/components/Modal.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx
  • packages/thirdweb/src/stories/Bridge/Swap/SelectChain.stories.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-token-ui.tsx
**/*.stories.tsx

📄 CodeRabbit inference engine (CLAUDE.md)

Add Storybook stories (*.stories.tsx) alongside new UI components for documentation

Files:

  • packages/thirdweb/src/stories/Bridge/Swap/SelectChain.stories.tsx
**/*.stories.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • packages/thirdweb/src/stories/Bridge/Swap/SelectChain.stories.tsx
🧬 Code graph analysis (8)
packages/thirdweb/src/react/web/ui/Bridge/swap-widget/types.ts (1)
packages/thirdweb/src/bridge/types/Chain.ts (1)
  • BridgeChain (42-42)
packages/thirdweb/src/react/web/ui/Bridge/swap-widget/use-tokens.ts (1)
packages/thirdweb/src/utils/domains.ts (1)
  • getThirdwebBaseUrl (103-109)
packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-chain.tsx (2)
packages/thirdweb/src/exports/thirdweb.ts (1)
  • ThirdwebClient (25-25)
packages/thirdweb/src/react/web/ui/Bridge/swap-widget/types.ts (1)
  • SelectedTab (160-162)
packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx (2)
packages/thirdweb/src/react/web/ui/ConnectWallet/icons/WalletDotIcon.tsx (1)
  • WalletDotIcon (4-24)
packages/thirdweb/src/react/core/design-system/index.ts (1)
  • iconSize (166-176)
packages/thirdweb/src/react/web/ui/components/Modal.tsx (2)
packages/thirdweb/src/react/web/ui/ConnectWallet/constants.ts (1)
  • compactModalMaxHeight (15-15)
packages/thirdweb/src/react/web/ui/components/DynamicHeight.tsx (1)
  • DynamicHeight (8-23)
packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx (1)
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.tsx (1)
  • WalletConnectionScreen (37-86)
packages/thirdweb/src/stories/Bridge/Swap/SelectChain.stories.tsx (2)
packages/thirdweb/src/react/web/ui/Bridge/swap-widget/types.ts (1)
  • SelectedTab (160-162)
packages/thirdweb/src/react/web/ui/Bridge/swap-widget/SwapWidget.tsx (1)
  • SwapWidgetContainer (276-295)
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.tsx (1)
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.tsx (2)
  • WalletConnectionScreenProps (14-35)
  • WalletConnectionScreen (37-86)
⏰ 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: Unit Tests
  • GitHub Check: Size
  • GitHub Check: Lint Packages
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Build Packages
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (19)
packages/thirdweb/src/react/web/ui/components/DynamicHeight.tsx (1)

8-22: Clean simplification of the component's responsibility.

The removal of the maxHeight prop and the extra wrapper div is a good refactor. The component now has a single responsibility—observing and animating height transitions—while height constraints are handled by the parent container. This reduces coupling and improves maintainability.

packages/thirdweb/src/react/web/ui/components/Modal.tsx (2)

102-105: Constraint moved appropriately to the container level.

The maxHeight constraint is now correctly applied at the DialogContent level for compact modals. This works well with the updated DynamicHeight component, which handles smooth height transitions while the container enforces the height limit.


131-135: No issues found — DynamicHeight usage is consistent with the updated API.

All usages of DynamicHeight within the thirdweb package are already aligned with the updated signature that accepts only children. The Modal.tsx component correctly uses the component without the maxHeight prop, consistent with all other usages in the codebase.

packages/thirdweb/src/react/web/ui/ConnectWallet/icons/WalletDotIcon.tsx (1)

8-23: LGTM!

The SVG implementation follows best practices:

  • Uses fill="currentColor" to inherit color from CSS, eliminating the need for a dedicated color prop
  • Properly includes role="presentation" for accessibility
  • The viewBox provides intrinsic sizing when explicit dimensions aren't provided
packages/thirdweb/src/react/web/ui/Bridge/swap-widget/types.ts (1)

159-162: LGTM!

The SelectedTab discriminated union type is well-structured with a clear type discriminator. This cleanly models the tab-based navigation pattern introduced by this PR.

packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx (2)

214-231: LGTM!

The theme and connectOptions props are correctly passed to SelectToken, aligning with the expanded component API. This enables themed styling and wallet-connection configuration within the token selection modal.


650-650: Verify the removal of the color prop from WalletDotIcon.

The WalletDotIcon component no longer receives a color prop. Based on the component's implementation which uses fill="currentColor", the icon will inherit color from the parent's CSS color property. Ensure this is the intended behavior and that the parent container (Container with color="secondaryText") provides the correct color styling.

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

207-252: LGTM!

The theme and connectOptions props are correctly passed to the SelectToken component for the buy token modal, enabling themed styling and wallet-connection configuration.

packages/thirdweb/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx (2)

16-16: LGTM!

The import is correctly updated to use the renamed WalletConnectionScreen component from the same module path.


241-264: LGTM!

The component usage is correctly updated with the new required props:

  • shouldSetActive={false} - appropriate for payment selection where the connected wallet shouldn't automatically become the active wallet
  • size="compact" - matches the modal size context

The remaining props are passed through correctly.

packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.tsx (2)

14-35: LGTM!

The type rename from WalletSwitcherConnectionScreenProps to WalletConnectionScreenProps and the addition of size and shouldSetActive props make the API more flexible and align with the broader wallet connection flow refactoring.


77-79: LGTM!

The new props shouldSetActive and size are correctly passed through to ConnectModalContent, completing the API extension.

packages/thirdweb/src/stories/Bridge/Swap/SelectChain.stories.tsx (1)

19-39: LGTM - Stories correctly updated for tab-based API.

The stories properly demonstrate the new SelectedTab type and onSelectTab/selectedTab props. The initial state { type: "your-tokens" } aligns with the type definition.

packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.tsx (1)

54-66: LGTM - WalletConnectionScreen integration is correct.

The explicit shouldSetActive={false} and size="compact" props are appropriately omitted from the type and passed directly. The manual setActive(w) call in onSelect ensures proper wallet activation flow.

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

268-304: LGTM - YourTokensButton component is well-structured.

The component correctly mirrors the ChainButton styling pattern and properly displays the WalletDotIcon with optical alignment adjustment.

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

17-66: LGTM - MobileTabSelector correctly handles tab states.

The component properly branches rendering based on selectedTab.type and the onSelect callback uses appropriate string literals for navigation actions. The "all-tokens" → "chain" semantic mapping in the Tabs component is correctly handled.

packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-token-ui.tsx (3)

448-620: LGTM - YourTokenButton component with chain icon overlay.

The component correctly displays token info with a chain icon overlay for multi-chain context. The positioning and styling are well-implemented.


1404-1424: LGTM - ScreenHeader component is a clean extraction.

The component provides consistent header styling across screens. The conditional description rendering is correctly implemented.


1239-1245: Remove outdated TODO comment — chainId array parameter is properly supported.

The useTokenBalances hook already supports array chainIds. The type signature declares chainId: number | number[] | undefined (use-tokens.ts:80), and the implementation correctly handles arrays by iterating and appending each chainId to the URL search parameters (lines 97–100). The code at line 1244 is functioning as intended.

Likely an incorrect or invalid review comment.

appMetadata={props.connectOptions?.appMetadata}
connectLocale={connectLocaleEn}
recommendedWallets={props.connectOptions?.recommendedWallets}
showAllWallets={props.connectOptions?.showAllWallets || true}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Bug: || true always evaluates to true, use ?? true instead.

The expression props.connectOptions?.showAllWallets || true will always be true because || performs a truthy check. If showAllWallets is explicitly false, it will still evaluate to true.

Proposed fix
-        showAllWallets={props.connectOptions?.showAllWallets || true}
+        showAllWallets={props.connectOptions?.showAllWallets ?? true}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
showAllWallets={props.connectOptions?.showAllWallets || true}
showAllWallets={props.connectOptions?.showAllWallets ?? true}
🤖 Prompt for AI Agents
In @packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-token-ui.tsx at
line 150, The prop binding for showAllWallets currently uses a truthy-or
fallback (props.connectOptions?.showAllWallets || true) which forces true even
when showAllWallets is explicitly false; change the fallback to a
nullish-coalescing fallback (props.connectOptions?.showAllWallets ?? true) so
false is preserved and only undefined/null fall back to true, updating the
expression where showAllWallets is passed into the component.

Comment on lines +80 to +104
chainId: number | number[] | undefined;
}) {
return useQuery({
queryKey: ["bridge/v1/wallets", options],
enabled: !!options.chainId && !!options.walletAddress,
enabled: !!options.walletAddress,
queryFn: async () => {
if (!options.chainId || !options.walletAddress) {
if (!options.walletAddress) {
throw new Error("invalid options");
}
const baseUrl = getThirdwebBaseUrl("bridge");
const isDev = baseUrl.includes("thirdweb-dev");
const url = new URL(
`https://api.${isDev ? "thirdweb-dev" : "thirdweb"}.com/v1/wallets/${options.walletAddress}/tokens`,
);
url.searchParams.set("chainId", options.chainId.toString());

// Set chainId param(s) if provided
if (options.chainId !== undefined) {
if (Array.isArray(options.chainId)) {
for (const id of options.chainId) {
url.searchParams.append("chainId", id.toString());
}
} else {
url.searchParams.set("chainId", options.chainId.toString());
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

cat -n packages/thirdweb/src/react/web/ui/Bridge/swap-widget/use-tokens.ts | head -120

Repository: thirdweb-dev/js

Length of output: 4506


🏁 Script executed:

rg "bridge/v1/wallets" -A 5 -B 5 packages/thirdweb/src/

Repository: thirdweb-dev/js

Length of output: 2283


🏁 Script executed:

grep -r "chainId" packages/thirdweb/src/react/web/ui/Bridge/swap-widget/use-tokens.ts -B 2 -A 2

Repository: thirdweb-dev/js

Length of output: 1022


🏁 Script executed:

rg "useTokenBalances" -A 3 -B 3 packages/thirdweb/src/react/web/ui/Bridge/ | head -100

Repository: thirdweb-dev/js

Length of output: 2718


🏁 Script executed:

fd "use-tokens.ts" -x wc -l {}

Repository: thirdweb-dev/js

Length of output: 132


🏁 Script executed:

cat -n packages/thirdweb/src/react/web/ui/Bridge/swap-widget/use-tokens.ts | sed -n '75,130p'

Repository: thirdweb-dev/js

Length of output: 2396


🏁 Script executed:

cat -n packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-token-ui.tsx | grep -A 10 -B 2 "useTokenBalances"

Repository: thirdweb-dev/js

Length of output: 1283


🏁 Script executed:

cat -n packages/thirdweb/src/react/web/ui/Bridge/swap-widget/use-tokens.ts | head -80

Repository: thirdweb-dev/js

Length of output: 2690


🏁 Script executed:

ast-grep --pattern 'export function useTokenBalances' packages/thirdweb/src/react/web/ui/Bridge/swap-widget/use-tokens.ts

Repository: thirdweb-dev/js

Length of output: 41


🏁 Script executed:

rg "TODO - this is not working" packages/thirdweb/src/react/web/ui/Bridge/ -B 5 -A 5

Repository: thirdweb-dev/js

Length of output: 1256


🏁 Script executed:

rg "chainId.*map" packages/thirdweb/src/react/web/ui/Bridge/swap-widget/ -B 3 -A 3

Repository: thirdweb-dev/js

Length of output: 802


🏁 Script executed:

git log -p --all -S "TODO - this is not working" -- packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-token-ui.tsx | head -100

Repository: thirdweb-dev/js

Length of output: 41


🏁 Script executed:

rg "allTokensQuery" packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-token-ui.tsx -A 10 -B 2

Repository: thirdweb-dev/js

Length of output: 3219


🏁 Script executed:

cat -n packages/thirdweb/src/react/web/ui/Bridge/swap-widget/select-token-ui.tsx | sed -n '1239,1280p'

Repository: thirdweb-dev/js

Length of output: 1626


🏁 Script executed:

rg "v1/wallets.*tokens" packages/thirdweb/ -B 3 -A 3 | head -50

Repository: thirdweb-dev/js

Length of output: 828


Remove or resolve the TODO comment in select-token-ui.tsx before merging.

The implementation in useTokenBalances appears syntactically correct for handling array chainIds (lines 96–104), but the consuming code in select-token-ui.tsx:1244 has an explicit TODO comment: // TODO - this is not working!! on the exact feature being reviewed. This indicates the multi-chainId filtering is known to be broken—either the API does not accept multiple chainId query parameters, or there is an unresolved bug in the flow.

Either investigate and fix the underlying issue, or remove the broken feature before shipping.

🤖 Prompt for AI Agents
In @packages/thirdweb/src/react/web/ui/Bridge/swap-widget/use-tokens.ts around
lines 80 - 104, The TODO in select-token-ui.tsx about multi-chainId filtering
must be resolved: either remove the broken multi-chainId feature or make
use-tokens.ts and the consumer compatible with the API. Update use-tokens.ts
(the query building in the hook that sets chainId params) to send chain IDs in
the format the API actually accepts (e.g., a single comma-separated chainId
query value instead of multiple chainId params) and adjust select-token-ui.tsx
to consume the new shape (and delete the `// TODO - this is not working!!`
comment). Ensure the unique symbols to edit are the hook that builds the URL in
use-tokens.ts (the code appending chainId params) and the component logic in
select-token-ui.tsx around the TODO, then test the flow end-to-end to verify
filtering works and remove the TODO before merging.

@codecov
Copy link

codecov bot commented Jan 12, 2026

Codecov Report

❌ Patch coverage is 1.77580% with 885 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.58%. Comparing base (0382d42) to head (e38e913).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...eact/web/ui/Bridge/swap-widget/select-token-ui.tsx 0.59% 669 Missing ⚠️
...c/react/web/ui/Bridge/swap-widget/select-chain.tsx 1.01% 98 Missing ⚠️
...ct/web/ui/Bridge/swap-widget/SelectChainButton.tsx 4.21% 91 Missing ⚠️
.../src/react/web/ui/Bridge/swap-widget/use-tokens.ts 0.00% 11 Missing ⚠️
...es/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx 0.00% 3 Missing ⚠️
...b/ui/Bridge/payment-selection/PaymentSelection.tsx 25.00% 3 Missing ⚠️
...nectWallet/screens/Details/WalletManagerScreen.tsx 0.00% 3 Missing ⚠️
...ges/thirdweb/src/react/web/ui/components/Modal.tsx 40.00% 3 Missing ⚠️
...react/web/ui/ConnectWallet/icons/WalletDotIcon.tsx 33.33% 2 Missing ⚠️
...tWallet/screens/WalletSwitcherConnectionScreen.tsx 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8620      +/-   ##
==========================================
- Coverage   53.02%   52.58%   -0.45%     
==========================================
  Files         924      924              
  Lines       61726    62244     +518     
  Branches     4035     4032       -3     
==========================================
- Hits        32730    32729       -1     
- Misses      28898    29417     +519     
  Partials       98       98              
Flag Coverage Δ
packages 52.58% <1.77%> (-0.45%) ⬇️
Files with missing lines Coverage Δ
...dweb/src/react/web/ui/components/DynamicHeight.tsx 84.37% <100.00%> (-2.81%) ⬇️
...react/web/ui/ConnectWallet/icons/WalletDotIcon.tsx 5.88% <33.33%> (-0.37%) ⬇️
...tWallet/screens/WalletSwitcherConnectionScreen.tsx 11.53% <33.33%> (+0.42%) ⬆️
...es/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx 6.21% <0.00%> (-0.03%) ⬇️
...b/ui/Bridge/payment-selection/PaymentSelection.tsx 6.89% <25.00%> (-0.07%) ⬇️
...nectWallet/screens/Details/WalletManagerScreen.tsx 13.81% <0.00%> (-0.19%) ⬇️
...ges/thirdweb/src/react/web/ui/components/Modal.tsx 91.01% <40.00%> (-1.11%) ⬇️
.../src/react/web/ui/Bridge/swap-widget/use-tokens.ts 9.21% <0.00%> (-1.09%) ⬇️
...ct/web/ui/Bridge/swap-widget/SelectChainButton.tsx 8.57% <4.21%> (-8.10%) ⬇️
...c/react/web/ui/Bridge/swap-widget/select-chain.tsx 6.75% <1.01%> (-1.63%) ⬇️
... and 1 more
🚀 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 Jan 12, 2026

size-limit report 📦

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

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