Skip to content

Conversation

@MananTank
Copy link
Member

@MananTank MananTank commented Sep 17, 2025


PR-Codex overview

This PR focuses on adding tw- class names to various UI components in the thirdweb package for better styling control and consistency.

Detailed summary

  • Added tw- class names to Spinner, Modal, ConnectModal, OTPInput, and various other components.
  • Updated CSS styles in global.css for debugging purposes.
  • Modified test selectors to match new class names.
  • Enhanced InputSelectionUI and WalletTypeRowButton with new class properties.
  • Improved UI consistency across screens like ReceiveFunds, SendFunds, and ConnectingScreen by adding specific tw- classes.
  • Updated ConnectButton, DetailsModal, and other components to utilize new class names for better styling.

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

Summary by CodeRabbit

  • New Features
    • Added tw- prefixed CSS hooks across Connect UI, transaction, OTP, scan, social, swap, and send/receive screens and modals for easier theming.
    • Several components now accept className for targeted styling (e.g., modals, headers, containers, wallet buttons, inputs, selectors).
  • Documentation
    • Added guidance on overriding styles and new Storybook examples for ConnectEmbed (including className/style and wide modal variants).
  • Tests
    • Updated Send Funds button selector in tests.
  • Chores
    • Added patch-level changeset entry for the package.

@linear
Copy link

linear bot commented Sep 17, 2025

@changeset-bot
Copy link

changeset-bot bot commented Sep 17, 2025

🦋 Changeset detected

Latest commit: e882c09

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 Sep 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 Sep 17, 2025 9:09pm
nebula Ready Ready Preview Comment Sep 17, 2025 9:09pm
thirdweb_playground Ready Ready Preview Comment Sep 17, 2025 9:09pm
thirdweb-www Ready Ready Preview Comment Sep 17, 2025 9:09pm
wallet-ui Ready Ready Preview Comment Sep 17, 2025 9:09pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 17, 2025

Walkthrough

Patch introduces tw- CSS class hooks across Connect UI, modals, buttons, and screens. Adds a simple cls utility. Several UI components accept new optional className props; Modal now requires className. Removes lazy/Suspense for in-app wallet selection. Adds Storybook stories and a commented CSS debug block.

Changes

Cohort / File(s) Summary
Changeset
.changeset/nice-owls-double.md
Adds patch-level changeset for introducing tw- CSS classes in Connect UI.
Storybook & Global CSS
packages/thirdweb/.storybook/global.css, packages/thirdweb/src/stories/ConnectEmbed.stories.tsx
Adds commented debug outline rule; introduces ConnectEmbed stories including variations and decorator with ConnectButton.
Utility
packages/thirdweb/src/react/web/utils/cls.ts
New cls(...classes) helper to merge class names, ignoring non-strings.
Core Modal & Basics (API updates)
packages/thirdweb/src/react/web/ui/components/Modal.tsx, packages/thirdweb/src/react/web/ui/components/basic.tsx, packages/thirdweb/src/react/web/ui/components/modalElements.tsx
Modal now requires className and merges with base; ModalHeader and Container accept optional className; BackButton adds tw-back-button.
Core UI Elements
packages/thirdweb/src/react/web/ui/components/OTPInput.tsx, .../components/Spinner.tsx
Adds tw-otp-input-container and tw-spinner class hooks.
Connect Embed
packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx
Uses cls; forwards className and style to loading container; documentation comment added.
Modals: Class hooks
.../ui/ConnectWallet/Modal/ConnectModal.tsx, .../ui/TransactionButton/TransactionModal.tsx, .../ui/Bridge/swap-widget/swap-ui.tsx, .../ui/ConnectWallet/ConnectButton.tsx
Adds modal-specific classes: tw-modal__connect-wallet, tw-modal__view-transaction, tw-modal__swap-widget, tw-modal__sign-in; doc block in ConnectButton.
Network Selector (API update)
.../ui/ConnectWallet/NetworkSelector.tsx
Adds optional className to content props; applies tw-modal__switch-network to modal; passes class to container.
Wallet Selection (logic path simplified)
.../ui/ConnectWallet/WalletSelector.tsx, .../ui/ConnectWallet/WalletEntryButton.tsx, .../ui/ConnectWallet/WalletTypeRowButton.tsx, .../ui/ConnectWallet/Modal/AllWalletsUI.tsx
Removes lazy/Suspense for in-app wallet UI; adds class hooks across containers/buttons; WalletEntryButton and WalletTypeRowButton accept optional className; AllWalletsUI adds list item/outer classes.
Connect Wallet Details & Screens
.../ui/ConnectWallet/Details.tsx, .../ui/ConnectWallet/screens/ReceiveFunds.tsx, .../ui/ConnectWallet/screens/SendFunds.tsx, .../ui/ConnectWallet/screens/TokenSelector.tsx, .../ui/ConnectWallet/screens/SignatureScreen.tsx
Adds numerous tw- class hooks to buttons, containers, titles, inputs; updates send button class; no logic changes.
Wallet Shared Screens
.../wallets/shared/ConnectWalletSocialOptions.tsx, .../wallets/shared/ConnectingScreen.tsx, .../wallets/shared/GuestLogin.tsx, .../wallets/shared/OTPLoginUI.tsx, .../wallets/shared/ScanScreen.tsx, .../wallets/shared/SocialLogin.tsx
Adds class hooks to social options, connecting, guest login, OTP, scan, and social login screens; adds data-status on some titles; behavior unchanged.
In-App Wallet Input (API update)
.../wallets/in-app/InputSelectionUI.tsx
Adds optional className prop and forwards to container.
Tests
.../ui/ConnectWallet/screens/SendFunds.test.tsx
Updates selector to button.tw-send-funds-button.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant ConnectButton
  participant ConnectModal
  participant WalletSelector
  participant InAppWalletSelectionUI

  User->>ConnectButton: Click
  ConnectButton->>ConnectModal: Open (tw-modal__connect-wallet)
  ConnectModal->>WalletSelector: Render
  Note over WalletSelector: New: direct import/render<br/>(lazy/Suspense removed)
  WalletSelector->>InAppWalletSelectionUI: Render in-app path
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Pre-merge checks and finishing touches

❌ Failed checks (3 warnings)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning While most edits are presentational "tw-" class additions and a small cls helper (in-scope), the PR also removes the lazy/Suspense loading path in WalletSelector (statically importing InAppWalletSelectionUI) and makes Modal.className a required prop, both of which alter runtime behavior or public signatures and therefore appear out-of-scope for a pure styling change. Either revert or justify the WalletSelector lazy-load removal with performance/behavior tests and restore the Suspense fallback if needed, and make Modal.className optional (or update all call sites and document the breaking change) before merging.
Description Check ⚠️ Warning The PR body includes a useful PR-Codex overview and a detailed summary of files changed, but it leaves the repository template sections commented out and does not provide explicit "Notes for the reviewer" or concrete "How to test" steps as required by the template. Please populate the template's "Notes for the reviewer" and "How to test" sections with concrete testing steps (unit test commands, playground steps, or manual reproduction steps) and call out any areas reviewers should focus on (notably the Modal API change and WalletSelector lazy-load removal).
Docstring Coverage ⚠️ Warning Docstring coverage is 62.07% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title "[BLD-286] SDK: add stable classNames to elements in Connect UI" is concise, references the linked issue, and accurately summarizes the primary change (adding "tw-" class names across Connect UI components), so it is clear and appropriate for scanability.
Linked Issues Check ✅ Passed The changes directly implement the linked issue [BLD-286]: a main modal class ("tw-modal") is applied in Modal, connect-specific modal classes (e.g., "tw-modal__connect-wallet", "tw-modal__wallet-details") are added, and CTA/button classes are added across connect UI files, satisfying the coding objectives; however the PR also introduces related public API shifts (notably adding Modal.className as a prop) that should be documented.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bld-286

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.

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

MananTank commented Sep 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.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 17, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 63.96 KB (0%) 1.3 s (0%) 318 ms (+111.65% 🔺) 1.6 s
thirdweb (cjs) 361.44 KB (0%) 7.3 s (0%) 1.5 s (+3.86% 🔺) 8.8 s
thirdweb (minimal + tree-shaking) 5.73 KB (0%) 115 ms (0%) 132 ms (+1670.97% 🔺) 247 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 77 ms (+1564.2% 🔺) 87 ms
thirdweb/react (minimal + tree-shaking) 19.15 KB (0%) 383 ms (0%) 87 ms (+366.38% 🔺) 470 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: 3

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/Details.tsx (1)

739-749: Add rel="noopener noreferrer" to external links opened with target="_blank"

Anchor opens a new tab without rel, which risks reverse‑tabnabbing — add rel="noopener noreferrer".

File: packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx (lines 739-749)

-              <MenuLink
+              <MenuLink
                 className="tw-request-testnet-funds-button"
                 as="a"
                 href={
                   chainFaucetsQuery.faucets ? chainFaucetsQuery.faucets[0] : "#"
                 }
+                rel="noopener noreferrer"
                 style={{
                   color: "inherit",
                   textDecoration: "none",
                 }}
                 target="_blank"
               >
  • Also missing rel on other target="_blank" usages: packages/thirdweb/src/react/web/ui/ConnectWallet/TransactionsScreen.tsx, packages/thirdweb/src/react/web/ui/ConnectWallet/WalletSelector.tsx, packages/thirdweb/src/react/web/ui/ConnectWallet/PoweredByTW.tsx, packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/TOS.tsx, packages/thirdweb/src/react/web/ui/ConnectWallet/screens/StartScreen.tsx, and the Link in Details.tsx (around line 1248).
🧹 Nitpick comments (19)
packages/thirdweb/src/react/web/ui/components/Spinner.tsx (1)

25-25: Allow consumers to append classes; merge with cls.

Hardcoding a single class blocks future className extension. Add an optional className prop and compose with tw-spinner.

Apply this diff in place:

-      className="tw-spinner"
+      className={cls("tw-spinner", props.className)}

And also apply outside this hunk:

@@
-import { StyledCircle, StyledSvg } from "../design-system/elements.js";
+import { StyledCircle, StyledSvg } from "../design-system/elements.js";
+import { cls } from "../../utils/cls.js";
@@
-export const Spinner: React.FC<{
+export const Spinner: React.FC<{
   size: keyof typeof iconSize;
   style?: React.CSSProperties;
   color?: keyof Theme["colors"];
+  className?: string;
 }> = (props) => {
packages/thirdweb/.storybook/global.css (1)

14-17: Scope the debug outline to an opt‑in attribute to avoid accidental wide impact.

Keep it commented, or scope it to Storybook root with an attribute to prevent accidental check‑ins:

/* Debug TW hooks only when enabled on root */
/* [data-debug-tw] [class*="tw-"] { outline: 1px dotted yellow !important; } */
packages/thirdweb/src/react/web/ui/ConnectWallet/ConnectButton.tsx (2)

164-176: Docs: advise scoping overrides under the root hook.

Recommend scoping CSS to .tw-connect-wallet to reduce bleed:

.tw-connect-wallet .tw-back-button { background-color: red !important; }

368-386: Use cls instead of manual concatenation to avoid stray spaces and keep consistency.

Current concatenation can yield double spaces and diverges from the new cls helper.

Apply these diffs in place:

-    const combinedClassName = `${props.connectButton?.className || ""} ${TW_CONNECT_WALLET}`;
+    const combinedClassName = cls(props.connectButton?.className, TW_CONNECT_WALLET);
-    const combinedClassName = `${props.connectButton?.className || ""} ${TW_CONNECT_WALLET}`;
+    const combinedClassName = cls(props.connectButton?.className, TW_CONNECT_WALLET);
-      const combinedClassName = `${props.connectButton?.className || ""} ${TW_CONNECT_WALLET}`;
+      const combinedClassName = cls(props.connectButton?.className, TW_CONNECT_WALLET);

Also add the import at the top (outside this hunk):

+import { cls } from "../../utils/cls.js";

Also applies to: 475-508, 515-531

packages/thirdweb/src/react/web/ui/components/OTPInput.tsx (1)

24-24: Expose className and compose with tw- hook.

Let consumers extend styles and use the shared cls helper.

Apply this change in place:

-    <OTPInputContainer className="tw-otp-input-container">
+    <OTPInputContainer className={cls("tw-otp-input-container", props.className)}>

And apply outside this hunk:

@@
-import { Container } from "./basic.js";
+import { Container } from "./basic.js";
+import { cls } from "../../utils/cls.js";
@@
-export function OTPInput(props: {
+export function OTPInput(props: {
   digits: number;
   isInvalid?: boolean;
   value: string;
   setValue: (value: string) => void;
   onEnter: () => void;
+  className?: string;
 }) {

Optional tidy (keeps prop aligned with behavior):

-      <InputOTP
-        maxLength={6}
+      <InputOTP
+        maxLength={props.digits}
packages/thirdweb/src/react/web/ui/components/modalElements.tsx (1)

29-33: Add accessible label to the back button.

Improves a11y for screen readers.

-    <IconButton
+    <IconButton
       className="tw-back-button"
       onClick={props.onClick}
+      aria-label="Back"
       style={{ transform: "translateX(-25%)", ...props.style }}
       type="button"
     >
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/ReceiveFunds.tsx (1)

60-63: Namespace the button hook under the screen to avoid collisions.

Aligns with BEM‑ish pattern used elsewhere (tw-send-funds-screen__*).

-      <WalletAddressContainer
-        onClick={onCopy}
-        className="tw-copy-address-button"
-      >
+      <WalletAddressContainer
+        onClick={onCopy}
+        className="tw-receive-funds-screen__copy-address-button"
+      >
packages/thirdweb/src/react/web/utils/cls.ts (1)

11-13: Tighten types and ignore empty strings.

This matches common clsx semantics without adding a dep.

-export function cls(...classes: (string | unknown)[]) {
-  return classes.filter((v) => typeof v === "string").join(" ");
-}
+export function cls(
+  ...classes: Array<string | false | null | undefined>
+): string {
+  return classes.filter((v): v is string => typeof v === "string" && v.length > 0).join(" ");
+}
packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx (2)

165-176: Doc note: caution against overusing !important

Good guidance. Consider adding one line advising users to scope overrides under a stable root class (see next comment) before resorting to !important.


283-287: Add a stable root hook class to EmbedContainer in both states

Right now the loading branch has a hook (tw-widget-loading), but the steady-state container only forwards props.className. Add a stable base like tw-connect-embed to both branches so downstream CSS doesn’t have to pass a className just to target the root.

@@
-            <EmbedContainer
-              modalSize={modalSize}
-              className={cls("tw-widget-loading", props.className)}
-              style={props.style}
-            >
+            <EmbedContainer
+              modalSize={modalSize}
+              className={cls("tw-connect-embed tw-widget-loading", props.className)}
+              style={props.style}
+            >
@@
-    <EmbedContainer
-      className={props.className}
+    <EmbedContainer
+      className={cls("tw-connect-embed", props.className)}
       modalSize={modalSize}
       style={props.style}
     >

Also applies to: 445-447

packages/thirdweb/src/react/web/wallets/shared/OTPLoginUI.tsx (2)

253-258: Make error messages screen-reader friendly

Add ARIA to announce errors without user focus changes.

-                <Text
+                <Text
+                  role="alert"
+                  aria-live="polite"
                   center
                   color="danger"
                   size="sm"
                   className="tw-invalid-code-text"
                 >
@@
-                <Text
+                <Text
+                  role="alert"
+                  aria-live="polite"
                   center
                   color="danger"
                   size="sm"
                   className="tw-screen-error"
                 >
@@
-                <Text
+                <Text
+                  role="alert"
+                  aria-live="polite"
                   center
                   color="danger"
                   size="sm"
                   className="tw-screen-error"
                 >
@@
-                <Text
+                <Text
+                  role="alert"
+                  aria-live="polite"
                   center
                   color="danger"
                   size="sm"
                   className="tw-screen-error"
                 >

Also applies to: 268-272, 281-286, 323-327


353-359: Expose disabled state for accessibility on Resend

The click handler is omitted during countdown, but the control isn’t announced as disabled. Add aria-disabled (and optionally data-countdown) for clarity.

-              <LinkButton
+              <LinkButton
                 onClick={countdown === 0 ? sendEmailOrSms : undefined}
                 style={{
                   cursor: countdown > 0 ? "default" : "pointer",
                   opacity: countdown > 0 ? 0.5 : 1,
                 }}
                 className="tw-resend-button"
+                aria-disabled={countdown > 0}
+                data-countdown={countdown}
                 type="button"
               >
packages/thirdweb/src/react/web/wallets/shared/ScanScreen.tsx (1)

75-102: Minor a11y: reflect disabled and announce failures

  • Copy Link: expose disabled state via ARIA when URI is missing.
  • Failed title: announce via ARIA to assistive tech.
-            <Button
+            <Button
               className="tw-copy-link-button"
               disabled={props.qrCodeUri === undefined}
               onClick={() => {
@@
               style={{
                 cursor: props.qrCodeUri === undefined ? "default" : "pointer",
                 fontSize: "12px",
                 opacity: props.qrCodeUri === undefined ? 0.5 : 1,
               }}
+              aria-disabled={props.qrCodeUri === undefined}
               variant="link"
             >
@@
-            <Text
+            <Text
+              role="alert"
+              aria-live="polite"
               center
               color="primaryText"
               size="lg"
               className="tw-screen-title"
               data-status="failed"
             >

Also applies to: 132-138

packages/thirdweb/src/react/web/wallets/shared/ConnectingScreen.tsx (1)

73-80: Announce connection status changes to screen readers

Add aria-live for dynamic status, and role=status for semantic intent.

-          <Text
+          <Text
+            role="status"
+            aria-live="polite"
             center
             color="primaryText"
             size="lg"
             weight={600}
             className="tw-screen-title"
             data-status={props.errorConnecting ? "failed" : "in-progress"}
           >
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/SignatureScreen.tsx (1)

171-181: Align title hook with others and remove trailing whitespace

Add data-status to the title (failed vs in-progress) and drop the extra space.

-              <Text
+              <Text
                 center
                 color="primaryText"
                 size="lg"
-                className="tw-screen-title"
+                className="tw-screen-title"
+                data-status={status === "failed" ? "failed" : "in-progress"}
               >
                 {status === "failed"
                   ? error || locale.signingScreen.failedToSignIn
-                  : locale.signingScreen.inProgress}{" "}
+                  : locale.signingScreen.inProgress}
               </Text>
packages/thirdweb/src/react/web/ui/Bridge/swap-widget/swap-ui.tsx (1)

199-203: Confirm Modal merges base and custom classes

Assuming Modal composes className with its base (e.g., "tw-modal"), this hook is good. If it replaces the base, please merge with cls to avoid losing default styles.

If needed, ensure Modal does:

className={cls("tw-modal", props.className)}
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/SendFunds.test.tsx (1)

61-62: Tests: consider adding data-testid as a fallback

Selector update is fine. To decouple tests from styling hooks, also expose a data-testid on the button and query it here as primary, keeping the class selector as a secondary check.

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

149-150: Add a stable base class to the content container

Forwarding className is good. For consistency with the PR goal (“stable class hooks”), also include a default base class and merge via cls.

Apply:

-    <Container className={props.className}>
+    <Container className={cls("tw-network-selector", props.className)}>

And add the import:

+import { cls } from "../../utils/cls.js";

Also applies to: 368-369

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

26-26: Expose and forward className (nice); add a default base hook

Forwarding is correct. Recommend adding an always-present base class for stable targeting in addition to consumer overrides.

+import { cls } from "../../utils/cls.js";
...
-    <WalletButtonEl
-      className={props.className}
+    <WalletButtonEl
+      className={cls("tw-wallet-entry-button", props.className)}
       data-active={props.isActive}

Also applies to: 60-61

📜 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 0e3f346 and e882c09.

📒 Files selected for processing (32)
  • .changeset/nice-owls-double.md (1 hunks)
  • packages/thirdweb/.storybook/global.css (1 hunks)
  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/swap-ui.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/ConnectWallet/ConnectButton.tsx (2 hunks)
  • packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx (10 hunks)
  • packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx (2 hunks)
  • packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx (3 hunks)
  • packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectModal.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/ConnectWallet/NetworkSelector.tsx (3 hunks)
  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletEntryButton.tsx (2 hunks)
  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletSelector.tsx (8 hunks)
  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletTypeRowButton.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/ReceiveFunds.tsx (2 hunks)
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/SendFunds.test.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/SendFunds.tsx (7 hunks)
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/SignatureScreen.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/TokenSelector.tsx (2 hunks)
  • packages/thirdweb/src/react/web/ui/TransactionButton/TransactionModal.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/components/Modal.tsx (3 hunks)
  • packages/thirdweb/src/react/web/ui/components/OTPInput.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/components/Spinner.tsx (1 hunks)
  • packages/thirdweb/src/react/web/ui/components/basic.tsx (4 hunks)
  • packages/thirdweb/src/react/web/ui/components/modalElements.tsx (1 hunks)
  • packages/thirdweb/src/react/web/utils/cls.ts (1 hunks)
  • packages/thirdweb/src/react/web/wallets/in-app/InputSelectionUI.tsx (2 hunks)
  • packages/thirdweb/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx (9 hunks)
  • packages/thirdweb/src/react/web/wallets/shared/ConnectingScreen.tsx (3 hunks)
  • packages/thirdweb/src/react/web/wallets/shared/GuestLogin.tsx (1 hunks)
  • packages/thirdweb/src/react/web/wallets/shared/OTPLoginUI.tsx (8 hunks)
  • packages/thirdweb/src/react/web/wallets/shared/ScanScreen.tsx (5 hunks)
  • packages/thirdweb/src/react/web/wallets/shared/SocialLogin.tsx (1 hunks)
  • packages/thirdweb/src/stories/ConnectEmbed.stories.tsx (1 hunks)
🧰 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 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/swap-widget/swap-ui.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectModal.tsx
  • packages/thirdweb/src/react/web/wallets/shared/SocialLogin.tsx
  • packages/thirdweb/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx
  • packages/thirdweb/src/react/web/ui/TransactionButton/TransactionModal.tsx
  • packages/thirdweb/src/react/web/ui/components/modalElements.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/SendFunds.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/SignatureScreen.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/SendFunds.test.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx
  • packages/thirdweb/src/react/web/ui/components/Modal.tsx
  • packages/thirdweb/src/react/web/utils/cls.ts
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/TokenSelector.tsx
  • packages/thirdweb/src/react/web/wallets/shared/ConnectingScreen.tsx
  • packages/thirdweb/src/react/web/ui/components/OTPInput.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/ConnectButton.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx
  • packages/thirdweb/src/react/web/ui/components/Spinner.tsx
  • packages/thirdweb/src/react/web/wallets/shared/GuestLogin.tsx
  • packages/thirdweb/src/react/web/wallets/shared/OTPLoginUI.tsx
  • packages/thirdweb/src/stories/ConnectEmbed.stories.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletSelector.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletTypeRowButton.tsx
  • packages/thirdweb/src/react/web/wallets/shared/ScanScreen.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/ReceiveFunds.tsx
  • packages/thirdweb/src/react/web/wallets/in-app/InputSelectionUI.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/NetworkSelector.tsx
  • packages/thirdweb/src/react/web/ui/components/basic.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletEntryButton.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/swap-widget/swap-ui.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectModal.tsx
  • packages/thirdweb/src/react/web/wallets/shared/SocialLogin.tsx
  • packages/thirdweb/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx
  • packages/thirdweb/src/react/web/ui/TransactionButton/TransactionModal.tsx
  • packages/thirdweb/src/react/web/ui/components/modalElements.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/SendFunds.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/SignatureScreen.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/SendFunds.test.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx
  • packages/thirdweb/src/react/web/ui/components/Modal.tsx
  • packages/thirdweb/src/react/web/utils/cls.ts
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/TokenSelector.tsx
  • packages/thirdweb/src/react/web/wallets/shared/ConnectingScreen.tsx
  • packages/thirdweb/src/react/web/ui/components/OTPInput.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/ConnectButton.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx
  • packages/thirdweb/src/react/web/ui/components/Spinner.tsx
  • packages/thirdweb/src/react/web/wallets/shared/GuestLogin.tsx
  • packages/thirdweb/src/react/web/wallets/shared/OTPLoginUI.tsx
  • packages/thirdweb/src/stories/ConnectEmbed.stories.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletSelector.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletTypeRowButton.tsx
  • packages/thirdweb/src/react/web/wallets/shared/ScanScreen.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/ReceiveFunds.tsx
  • packages/thirdweb/src/react/web/wallets/in-app/InputSelectionUI.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/NetworkSelector.tsx
  • packages/thirdweb/src/react/web/ui/components/basic.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletEntryButton.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/swap-widget/swap-ui.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectModal.tsx
  • packages/thirdweb/src/react/web/wallets/shared/SocialLogin.tsx
  • packages/thirdweb/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx
  • packages/thirdweb/src/react/web/ui/TransactionButton/TransactionModal.tsx
  • packages/thirdweb/src/react/web/ui/components/modalElements.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/SendFunds.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/SignatureScreen.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/SendFunds.test.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx
  • packages/thirdweb/src/react/web/ui/components/Modal.tsx
  • packages/thirdweb/src/react/web/utils/cls.ts
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/TokenSelector.tsx
  • packages/thirdweb/src/react/web/wallets/shared/ConnectingScreen.tsx
  • packages/thirdweb/src/react/web/ui/components/OTPInput.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/ConnectButton.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx
  • packages/thirdweb/src/react/web/ui/components/Spinner.tsx
  • packages/thirdweb/src/react/web/wallets/shared/GuestLogin.tsx
  • packages/thirdweb/src/react/web/wallets/shared/OTPLoginUI.tsx
  • packages/thirdweb/src/stories/ConnectEmbed.stories.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletSelector.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletTypeRowButton.tsx
  • packages/thirdweb/src/react/web/wallets/shared/ScanScreen.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/ReceiveFunds.tsx
  • packages/thirdweb/src/react/web/wallets/in-app/InputSelectionUI.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/NetworkSelector.tsx
  • packages/thirdweb/src/react/web/ui/components/basic.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletEntryButton.tsx
**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.test.{ts,tsx}: Place tests alongside code: foo.tsfoo.test.ts
Use real function invocations with stub data in tests; avoid brittle mocks
Use Mock Service Worker (MSW) for fetch/HTTP call interception in tests
Keep tests deterministic and side-effect free
Use FORKED_ETHEREUM_CHAIN for mainnet interactions and ANVIL_CHAIN for isolated tests

**/*.test.{ts,tsx}: Co‑locate tests as foo.test.ts(x) next to the implementation
Use real function invocations with stub data; avoid brittle mocks
Use MSW to intercept HTTP calls for network interactions; mock only hard‑to‑reproduce scenarios
Keep tests deterministic and side‑effect free; use Vitest

Files:

  • packages/thirdweb/src/react/web/ui/ConnectWallet/screens/SendFunds.test.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/nice-owls-double.md
**/*.stories.tsx

📄 CodeRabbit inference engine (CLAUDE.md)

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

Files:

  • packages/thirdweb/src/stories/ConnectEmbed.stories.tsx
🧠 Learnings (26)
📓 Common learnings
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Combine class names via `cn`, expose `className` prop if useful.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Interactive UI that relies on hooks (`useState`, `useEffect`, React Query, wallet hooks).
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{tsx} : Expose `className` prop on root element of components for overrides

Applied to files:

  • packages/thirdweb/src/react/web/ui/Bridge/swap-widget/swap-ui.tsx
  • packages/thirdweb/src/react/web/ui/components/modalElements.tsx
  • packages/thirdweb/src/react/web/ui/components/Modal.tsx
  • packages/thirdweb/src/react/web/ui/components/OTPInput.tsx
  • packages/thirdweb/src/react/web/wallets/shared/GuestLogin.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletTypeRowButton.tsx
  • packages/thirdweb/src/react/web/wallets/in-app/InputSelectionUI.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/NetworkSelector.tsx
  • packages/thirdweb/src/react/web/ui/components/basic.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletEntryButton.tsx
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : Support for in-app wallets (social/email login)

Applied to files:

  • packages/thirdweb/src/react/web/wallets/shared/SocialLogin.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletSelector.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Add `className` to the root element of every component for external overrides.

Applied to files:

  • packages/thirdweb/src/react/web/ui/components/modalElements.tsx
  • packages/thirdweb/src/react/web/ui/components/Modal.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletTypeRowButton.tsx
  • packages/thirdweb/src/react/web/ui/components/basic.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Interactive UI that relies on hooks (`useState`, `useEffect`, React Query, wallet hooks).

Applied to files:

  • packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx
  • packages/thirdweb/src/react/web/wallets/shared/OTPLoginUI.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletSelector.tsx
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to apps/{dashboard,playground}/**/*.tsx : Expose a `className` prop on the root element of every component

Applied to files:

  • packages/thirdweb/src/react/web/ui/components/Modal.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletTypeRowButton.tsx
  • packages/thirdweb/src/react/web/ui/components/basic.tsx
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to apps/{dashboard,playground}/**/*.{ts,tsx} : Merge class names with `cn()` from `@/lib/utils` for conditional classes

Applied to files:

  • packages/thirdweb/src/react/web/utils/cls.ts
  • packages/thirdweb/src/react/web/ui/components/basic.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Combine class names via `cn`, expose `className` prop if useful.

Applied to files:

  • packages/thirdweb/src/react/web/utils/cls.ts
  • packages/thirdweb/src/react/web/ui/components/basic.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Merge class names with `cn` from `@/lib/utils` to keep conditional logic readable.

Applied to files:

  • packages/thirdweb/src/react/web/utils/cls.ts
  • packages/thirdweb/src/react/web/ui/components/basic.tsx
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : Unified `Wallet` and `Account` interfaces in wallet architecture

Applied to files:

  • packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Stick to design-tokens: background (`bg-card`), borders (`border-border`), muted text (`text-muted-foreground`) etc.

Applied to files:

  • packages/thirdweb/src/react/web/ui/ConnectWallet/ConnectButton.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx
📚 Learning: 2025-07-02T20:04:53.982Z
Learnt from: MananTank
PR: thirdweb-dev/js#7505
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/webhook-metrics.tsx:40-40
Timestamp: 2025-07-02T20:04:53.982Z
Learning: The Spinner component imported from "@/components/ui/Spinner/Spinner" in the dashboard accepts a className prop, not a size prop. The correct usage is <Spinner className="size-4" />, not <Spinner size="sm" />. The component defaults to "size-4" if no className is provided.

Applied to files:

  • packages/thirdweb/src/react/web/ui/components/Spinner.tsx
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to apps/{dashboard,playground}/**/*.stories.tsx : Add Storybook stories (`*.stories.tsx`) alongside new UI components

Applied to files:

  • packages/thirdweb/src/stories/ConnectEmbed.stories.tsx
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to **/*.stories.tsx : For new UI components, add Storybook stories (`*.stories.tsx`) alongside the code

Applied to files:

  • packages/thirdweb/src/stories/ConnectEmbed.stories.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/components/*.{stories,test}.{tsx,ts} : Provide a Storybook story (`MyComponent.stories.tsx`) or unit test alongside the component.

Applied to files:

  • packages/thirdweb/src/stories/ConnectEmbed.stories.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Anything that consumes hooks from `tanstack/react-query` or thirdweb SDKs.

Applied to files:

  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletSelector.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : When you need access to browser APIs (localStorage, window, IntersectionObserver etc.).

Applied to files:

  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletSelector.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/components/*.client.tsx : Client components must start with `'use client';` before imports.

Applied to files:

  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletSelector.tsx
📚 Learning: 2025-07-31T16:17:42.753Z
Learnt from: MananTank
PR: thirdweb-dev/js#7768
File: apps/playground-web/src/app/navLinks.ts:1-1
Timestamp: 2025-07-31T16:17:42.753Z
Learning: Configuration files that import and reference React components (like icon components from lucide-react) need the "use client" directive, even if they primarily export static data, because the referenced components need to be executed in a client context when used by other client components.

Applied to files:

  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletSelector.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Pages requiring fast transitions where data is prefetched on the client.

Applied to files:

  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletSelector.tsx
📚 Learning: 2025-05-30T17:14:25.332Z
Learnt from: MananTank
PR: thirdweb-dev/js#7227
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/OpenEditionMetadata.tsx:26-26
Timestamp: 2025-05-30T17:14:25.332Z
Learning: The ModuleCardUIProps interface already includes a client prop of type ThirdwebClient, so when components use `Omit<ModuleCardUIProps, "children" | "updateButton">`, they inherit the client prop without needing to add it explicitly.

Applied to files:

  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletSelector.tsx
  • packages/thirdweb/src/react/web/ui/ConnectWallet/NetworkSelector.tsx
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to apps/{dashboard,playground}/**/*.{ts,tsx} : Client Components must start with `'use client'`; handle interactivity with hooks and browser APIs

Applied to files:

  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletSelector.tsx
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to apps/{dashboard,playground}/**/*.{ts,tsx} : Import UI primitives from `@/components/ui/_` (e.g., Button, Input, Tabs, Card)

Applied to files:

  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletSelector.tsx
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to 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

Applied to files:

  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletSelector.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Always import from the central UI library under `@/components/ui/*` – e.g. `import { Button } from "@/components/ui/button"`.

Applied to files:

  • packages/thirdweb/src/react/web/ui/ConnectWallet/WalletSelector.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Use the `container` class with a `max-w-7xl` cap for page width consistency.

Applied to files:

  • packages/thirdweb/src/react/web/ui/components/basic.tsx
🧬 Code graph analysis (16)
packages/thirdweb/src/react/web/wallets/shared/SocialLogin.tsx (1)
packages/thirdweb/src/react/web/ui/components/basic.tsx (1)
  • Container (80-193)
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/SendFunds.tsx (1)
packages/thirdweb/src/react/web/ui/components/basic.tsx (1)
  • Container (80-193)
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/SignatureScreen.tsx (1)
packages/thirdweb/src/react/web/ui/components/text.tsx (1)
  • Text (18-34)
packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx (2)
packages/thirdweb/src/react/core/design-system/index.ts (1)
  • spacing (174-186)
packages/thirdweb/src/react/web/ui/components/buttons.tsx (1)
  • Button (26-157)
packages/thirdweb/src/react/web/ui/components/Modal.tsx (1)
packages/thirdweb/src/react/web/utils/cls.ts (1)
  • cls (11-13)
packages/thirdweb/src/react/web/wallets/shared/ConnectingScreen.tsx (2)
packages/thirdweb/src/react/web/ui/components/basic.tsx (1)
  • Container (80-193)
packages/thirdweb/src/react/web/ui/components/text.tsx (1)
  • Text (18-34)
packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx (1)
packages/thirdweb/src/react/web/ui/components/basic.tsx (1)
  • Container (80-193)
packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx (1)
packages/thirdweb/src/react/web/utils/cls.ts (1)
  • cls (11-13)
packages/thirdweb/src/react/web/wallets/shared/GuestLogin.tsx (1)
packages/thirdweb/src/react/web/ui/components/basic.tsx (1)
  • Container (80-193)
packages/thirdweb/src/react/web/wallets/shared/OTPLoginUI.tsx (2)
packages/thirdweb/src/react/web/ui/components/basic.tsx (1)
  • Container (80-193)
packages/thirdweb/src/react/web/ui/components/text.tsx (1)
  • Text (18-34)
packages/thirdweb/src/stories/ConnectEmbed.stories.tsx (3)
packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx (1)
  • ConnectEmbed (198-325)
packages/thirdweb/src/react/web/ui/ConnectWallet/ConnectButton.tsx (1)
  • ConnectButton (301-424)
packages/thirdweb/src/stories/utils.tsx (1)
  • storyClient (15-17)
packages/thirdweb/src/react/web/ui/ConnectWallet/WalletSelector.tsx (2)
packages/thirdweb/src/react/web/ui/components/basic.tsx (1)
  • Container (80-193)
packages/thirdweb/src/react/web/ui/ConnectWallet/WalletEntryButton.tsx (1)
  • WalletEntryButton (25-95)
packages/thirdweb/src/react/web/wallets/shared/ScanScreen.tsx (2)
packages/thirdweb/src/react/web/ui/components/basic.tsx (1)
  • Container (80-193)
packages/thirdweb/src/react/web/ui/components/text.tsx (1)
  • Text (18-34)
packages/thirdweb/src/react/web/ui/ConnectWallet/screens/ReceiveFunds.tsx (1)
packages/thirdweb/src/react/web/ui/components/basic.tsx (1)
  • Container (80-193)
packages/thirdweb/src/react/web/ui/ConnectWallet/NetworkSelector.tsx (1)
packages/thirdweb/src/react/web/ui/components/basic.tsx (1)
  • Container (80-193)
packages/thirdweb/src/react/web/ui/components/basic.tsx (1)
packages/thirdweb/src/react/web/utils/cls.ts (1)
  • cls (11-13)
⏰ 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). (4)
  • GitHub Check: Lint Packages
  • GitHub Check: Size
  • GitHub Check: Unit Tests
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (21)
packages/thirdweb/src/react/web/ui/ConnectWallet/ConnectButton.tsx (1)

559-564: Passing className to Modal looks good.

This satisfies the new styling hook for the sign‑in modal. No issues.

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

38-38: Screen‑level hook looks good.

tw-receive-funds-screen provides a clear namespace for overrides.

packages/thirdweb/src/react/web/wallets/shared/OTPLoginUI.tsx (1)

209-214: LGTM: stable hooks for OTP screen and title

Root and title hooks look good and match the project pattern.

Also applies to: 227-229

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

14-15: LGTM: className passthrough

Forwarding className to Button is consistent with the rest of the UI.

Also applies to: 21-21

packages/thirdweb/src/react/web/wallets/shared/ScanScreen.tsx (1)

43-48: LGTM: added hooks across scan screen states

Consistent tw- hooks for root, buttons, description, and error states.

Also applies to: 76-77, 110-114, 132-138, 143-148, 165-166

packages/thirdweb/src/react/web/wallets/shared/ConnectingScreen.tsx (1)

34-39: LGTM: consistent screen hooks and status data attribute

Matches the rest of the PR’s pattern.

Also applies to: 73-80, 115-119

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

183-192: LGTM: description hook during signing

tw-screen-description is consistent with other screens.

packages/thirdweb/src/react/web/wallets/in-app/InputSelectionUI.tsx (1)

16-18: LGTM: className passthrough to InputContainer

Enables external styling; no behavior change.

Also applies to: 67-67

packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectModal.tsx (1)

121-121: LGTM — stable modal hook added

className="tw-modal__connect-wallet" provides a clear, stable hook without behavior changes.

packages/thirdweb/src/react/web/ui/TransactionButton/TransactionModal.tsx (1)

71-71: LGTM — stable modal hook added

className="tw-modal__view-transaction" aligns with the new modal class strategy.

packages/thirdweb/src/react/web/wallets/shared/SocialLogin.tsx (1)

157-162: LGTM — screen-level hook added

className="tw-social-login-screen" on the root Container is consistent with the new pattern.

packages/thirdweb/src/react/web/wallets/shared/GuestLogin.tsx (1)

94-99: LGTM — screen-level hook added

className="tw-guest-login-screen" applied consistently on the root Container.

packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx (1)

72-77: LGTM — WalletEntryButton forwards className

Declares className?: string and passes props.className to the root element (packages/thirdweb/src/react/web/ui/ConnectWallet/WalletEntryButton.tsx:25, 59–61).

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

104-105: LGTM — NetworkSelectorContent accepts and applies className
NetworkSelectorContentProps includes className?: string and the component's root Container renders className={props.className} in packages/thirdweb/src/react/web/ui/ConnectWallet/NetworkSelector.tsx, so the TokenSelector usage is valid.

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

958-959: LGTM: modal-level hook added

tw-modal__switch-network provides a clear, stable scope for styling/QA.

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

575-580: LGTM: comprehensive, scoped class hooks

Good coverage: highlight actions, view/manage/disconnect, network switcher, and modal scope (tw-modal__wallet-details). Names are consistent and composable.

Also applies to: 583-596, 613-626, 638-657, 689-701, 707-717, 722-733, 770-785, 1012-1013, 1056-1057

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

201-213: LGTM: clear, stable hooks across Wallet Selector

Header, primary CTA, “get started” container, wallet items, and “show all” affordances now have stable classes. Good for QA/theming.

Also applies to: 221-230, 234-251, 490-491, 636-636, 656-670

packages/thirdweb/src/stories/ConnectEmbed.stories.tsx (1)

8-33: LGTM: Storybook coverage added

Useful permutations; decorator with a floating ConnectButton aids manual testing.

packages/thirdweb/src/react/web/ui/components/basic.tsx (1)

40-46: LGTM: className support and default header hook

ModalHeader now reliably exposes tw-header while allowing overrides; Container forwards className. Matches the PR’s styling‑hook goals.

Also applies to: 100-101, 184-184

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

173-177: LGTM — no stale SendFunds selectors found

rg search for "tw-sendfunds-screen-send-button|tw_sendfunds_screen_send_button|sendfunds" returned only SendFunds components, stories, and tests; no hits for the old button-class selectors.

packages/thirdweb/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx (1)

361-362: LGTM — approving changes

InputSelectionUI forwards props.className to InputContainer and WalletTypeRowButton forwards props.className to Button; StyledDiv/StyledButton are built on styled.div / styled.button so className reaches the DOM.

@@ -0,0 +1,5 @@
---
"thirdweb": patch
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

🧩 Analysis chain

Changeset bump likely incorrect (API surface changed).

This PR appears to make Modal require a className prop. That’s a public API change and should be a minor bump per our rules, unless we revert to a non‑breaking optional prop. Pick one:

  • Option A (versioning): bump to minor.
  • Option B (code): make className optional and default internally so this remains patch.

Apply this diff for Option A:

-"thirdweb": patch
+"thirdweb": minor

Run to confirm whether className is required and that all usages pass it:


🏁 Script executed:

#!/bin/bash
set -e

echo "Check Modal prop type:"
rg -nC2 -g 'packages/thirdweb/**/Modal.tsx' -P 'export (const|function)\s+Modal\b'

echo "Find <Modal> without className:"
rg -nP --type tsx -g 'packages/thirdweb/**' '<Modal(?![^>]*\bclassName=)'

Length of output: 527


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "==== Modal.tsx (head) ===="
sed -n '1,240p' packages/thirdweb/src/react/web/ui/components/Modal.tsx || true

echo
echo "==== className occurrences inside Modal.tsx ===="
rg -n 'className' packages/thirdweb/src/react/web/ui/components/Modal.tsx || true

echo
echo "==== Scanning all TSX files for <Modal opening tags (reports if className present) ===="
python3 - <<'PY'
import re,glob
open_tag_re = re.compile(r'<Modal\b(.*?>)', re.DOTALL)
for path in glob.glob('packages/thirdweb/**/*.tsx', recursive=True):
    try:
        text = open(path,'r',encoding='utf-8').read()
    except Exception:
        continue
    for m in re.finditer(r'<Modal\b', text):
        start = m.start()
        match = open_tag_re.search(text, pos=start)
        lineno = text.count('\n', 0, start) + 1
        if not match:
            snippet = text[start:start+200].replace('\n','␤')
            print(f"{path}:{lineno}: could not capture opening tag; snippet: {snippet}")
            continue
        tag = '<Modal' + match.group(1)
        has = 'className=' in tag
        tag_one_line = tag.replace('\n','␤')
        print(f"{path}:{lineno}: className_present={has} tag={tag_one_line}")
PY

Length of output: 8874


Bump changeset to minor — Modal's className prop is now required.

Modal's props declare className: string (required). Found usages without className in:

  • packages/thirdweb/src/react/native/ui/connect/ConnectButton.tsx:157
  • packages/thirdweb/src/react/web/ui/ConnectWallet/useConnectModal.tsx:64

Choose one:

  • Option A (versioning): bump to minor — apply:
-"thirdweb": patch
+"thirdweb": minor
  • Option B (code): make className?: string and default internally to keep a patch.
📝 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
"thirdweb": patch
"thirdweb": minor

shadow,
spacing,
} from "../../../core/design-system/index.js";
import { cls } from "../../utils/cls.js";
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

🧩 Analysis chain

Modal className now required — verify all call sites or make optional

Making className required can break internal consumers that didn’t pass it. Either verify all usages are updated or make it optional and default to the base class.

Apply this minimal softening (keeps behavior, reduces churn):

-export const Modal: React.FC<{
+export const Modal: React.FC<{
@@
-  className: string;
+  className?: string;

No logic change needed since cls("tw-modal", props.className) already tolerates undefined.

Run to find any <Modal> without a className prop:

Naming note (very minor): current convention uses tw-modal__xyz. If these are modal variants (not elements), tw-modal--xyz (BEM modifier) may read clearer. Not blocking.

Also applies to: 37-37, 95-95


🏁 Script executed:

#!/bin/bash
# Finds <Modal ...> open tags missing className in packages/thirdweb
rg -nPU '(?s)<Modal\b(?![^>]*\bclassName=)[^>]*>' packages/thirdweb --type tsx -C2

Length of output: 83


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Searching for <Modal> tags missing className in packages/thirdweb..."

# Collect files that contain "<Modal" (tsx files)
if command -v rg >/dev/null 2>&1; then
  mapfile -t files < <(rg -l --type tsx "<Modal" packages/thirdweb || true)
else
  mapfile -t files < <(find packages/thirdweb -type f -name '*.tsx' -print0 | xargs -0 grep -Il "<Modal" || true)
fi

if [ ${#files[@]} -eq 0 ]; then
  echo "NO_MODAL_TAGS_FOUND"
  exit 0
fi

# For each file, slurp and find opening <Modal ...> tags that do NOT include className=
for f in "${files[@]}"; do
  perl -0777 -ne '
    while (/<Modal\b([^>]*)>/gs) {
      $attrs = $1;
      if ($attrs !~ /className\s*=/) {
        $start = $-[0];
        $pre = substr($_, 0, $start);
        $line_num = ($pre =~ tr/\n//) + 1;
        printf("%s:%d\n", $ARGV, $line_num);
        print $& . "\n\n";
      }
    }
  ' -- "$f"
done

Length of output: 153


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== 1) Locate Modal component file ==="
modal=$(find packages/thirdweb -type f -name 'Modal.tsx' -print -quit || true)
if [ -n "$modal" ]; then
  echo "FOUND: $modal"
  echo "---- head of $modal ----"
  sed -n '1,220p' "$modal" || true
else
  echo "Modal.tsx not found under packages/thirdweb"
fi

echo
echo "=== 2) Find all files under packages/thirdweb containing '<Modal' and check if opening tag includes className ==="
files=$(grep -IlR "<Modal" packages/thirdweb || true)
if [ -z "${files}" ]; then
  echo "NO_FILES_WITH_MODAL_FOUND"
  exit 0
fi

echo "$files" | while IFS= read -r file; do
  printf "\n--- %s ---\n" "$file"
  grep -n -C2 "<Modal" "$file" || true

  perl -0777 -ne '
    while (/<Modal\b([^>]*)>/gs) {
      $attrs = $1;
      $start = $-[0];
      $pre = substr($_,0,$start);
      $line_num = ($pre =~ tr/\n//) + 1;
      printf("%s:%d\n", $ARGV, $line_num);
      print $& . "\n";
      if ($attrs =~ /className\s*=/) {
        print "HAS_CLASSNAME\n\n";
      } else {
        print "MISSING_CLASSNAME\n\n";
      }
    }
  ' -- "$file" || true
done

exit 0

Length of output: 24971


Make Modal.className optional or update callers

Modal's props currently require className; at least one web caller omits it — packages/thirdweb/src/react/web/ui/ConnectWallet/useConnectModal.tsx:64. Change the prop to optional (runtime unchanged — cls tolerates undefined) or add className at the caller.

-export const Modal: React.FC<{
+export const Modal: React.FC<{
@@
-  className: string;
+  className?: string;

Committable suggestion skipped: line range outside the PR's diff.

"use client";
import { ChevronLeftIcon } from "@radix-ui/react-icons";
import { lazy, Suspense, useEffect, useRef, useState } from "react";
import { useEffect, useRef, useState } from "react";
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

Reintroduce lazy loading for InAppWalletSelectionUI (perf regression)

Switching from lazy to eager import pulls the in‑app flow into the initial bundle and penalizes TTI for users who never open it. Restore code-splitting with Suspense.

-import { useEffect, useRef, useState } from "react";
+import { lazy, Suspense, useEffect, useRef, useState } from "react";
-import InAppWalletSelectionUI from "../../wallets/in-app/InAppWalletSelectionUI.js";
+const InAppWalletSelectionUI = lazy(
+  () => import("../../wallets/in-app/InAppWalletSelectionUI.js"),
+);
+import { LoadingScreen } from "../../wallets/shared/LoadingScreen.js";
-            {wallet.id === "inApp" && props.size === "compact" ? (
-              <InAppWalletSelectionUI
+            {wallet.id === "inApp" && props.size === "compact" ? (
+              <Suspense fallback={<LoadingScreen />}>
+                <InAppWalletSelectionUI
                   chain={props.chain}
                   client={props.client}
                   connectLocale={props.connectLocale}
                   disabled={props.disabled}
-                done={() => props.done(wallet)}
+                  done={() => props.done(wallet)}
                   goBack={props.goBack}
                   recommendedWallets={props.recommendedWallets}
-                select={() => props.selectWallet(wallet)}
+                  select={() => props.selectWallet(wallet)}
                   size={props.size}
                   wallet={wallet as Wallet<"inApp">}
-              />
+                />
+              </Suspense>
             ) : (

Also applies to: 21-21, 622-633

🤖 Prompt for AI Agents
In packages/thirdweb/src/react/web/ui/ConnectWallet/WalletSelector.tsx around
lines 3 (and similarly at 21 and 622-633), the eager import of
InAppWalletSelectionUI caused a perf regression by pulling the in-app flow into
the initial bundle; restore code-splitting by replacing the direct import with
React.lazy(() => import(...)) and wrap its usage in a <Suspense fallback={...}>
(provide a lightweight spinner/placeholder) so the component is loaded only when
needed; ensure TypeScript types are preserved (use default export or adjust
import) and update any tests/SSR guards if necessary to avoid rendering lazy on
the server.

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