Skip to content

Conversation

@MananTank
Copy link
Member

@MananTank MananTank commented Jan 12, 2026


PR-Codex overview

This PR introduces two new properties, amountEditable and tokenEditable, to enhance the BuyWidget component. These options allow developers to control the editability of the token selection and amount fields, providing greater flexibility in user interactions.

Detailed summary

  • Added amountEditable and tokenEditable props to BuyWidget.
  • Updated BuyPlayground, CheckoutPlayground, and TransactionPlayground components to utilize the new props.
  • Modified URL handling to include editability options.
  • Enhanced BuyWidgetEmbed and related components to support new props.
  • Updated stories in BuyWidget.stories.tsx to demonstrate new functionality.
  • Added UI elements in LeftSection.tsx for controlling editability options.
  • Documented editability options in iframe/page.mdx.

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

Summary by CodeRabbit

  • New Features

    • Added amountEditable and tokenEditable options to the Buy widget to disable amount editing and/or token selection.
  • UI

    • UI now disables controls and hides selection affordances when editability is turned off.
  • Documentation

    • Docs updated with examples showing query-param and iframe usage for editability options.
  • Tests

    • Story variants added to demonstrate token/amount locked scenarios.

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

@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 6:23pm
nebula Ready Ready Preview, Comment Jan 12, 2026 6:23pm
thirdweb_playground Ready Ready Preview, Comment Jan 12, 2026 6:23pm
thirdweb-www Ready Ready Preview, Comment Jan 12, 2026 6:23pm
wallet-ui Ready Ready Preview, Comment Jan 12, 2026 6:23pm

@changeset-bot
Copy link

changeset-bot bot commented Jan 12, 2026

🦋 Changeset detected

Latest commit: 8d4b6a1

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

This PR includes changesets to release 4 packages
Name Type
thirdweb Patch
@thirdweb-dev/nebula Patch
@thirdweb-dev/wagmi-adapter Patch
wagmi-inapp Patch

Not sure what this means? Click here to learn what changesets are.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 12, 2026

Walkthrough

Adds two optional boolean props, amountEditable and tokenEditable, to the BuyWidget and propagates them through dashboard, playground, docs, and storybook; UI and iframe URL generation are updated to respect these flags and disable token selection or amount editing when set false.

Changes

Cohort / File(s) Summary
Core Bridge Component Updates
packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx, packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx
Added amountEditable?: boolean and tokenEditable?: boolean to BuyWidget props; propagated to FundWallet and TokenSection. UI now disables token selection and amount inputs / suggested amount buttons when flags are false.
Selected Token Button Styling
packages/thirdweb/src/react/web/ui/Bridge/common/selected-token-button.tsx
Added optional disabled prop; conditional hover, background, cursor, opacity, and ChevronDownIcon rendering based on disabled state.
Button Active State
packages/thirdweb/src/react/web/ui/components/buttons.tsx
Scoped active transform to non-disabled buttons by adjusting the CSS selector.
Dashboard Embed & Page
apps/dashboard/src/app/bridge/buy-widget/BuyWidgetEmbed.client.tsx, apps/dashboard/src/app/bridge/buy-widget/page.tsx
Added amountEditable and tokenEditable props to BuyWidgetEmbed signature; page parses amountEditable/tokenEditable query params (treating "false" → false) and forwards them to embed/widget.
Playground types & defaults
apps/playground-web/src/app/bridge/components/types.ts, apps/playground-web/src/app/bridge/buy-widget/BuyPlayground.tsx, apps/playground-web/src/app/bridge/checkout-widget/CheckoutPlayground.tsx, apps/playground-web/src/app/bridge/transaction-widget/TransactionPlayground.tsx
Added amountEditable and tokenEditable to BridgeComponentsPlaygroundOptions.payOptions and set defaults (true) in playground variants.
Playground UI / Codegen / URL
apps/playground-web/src/app/bridge/components/LeftSection.tsx, .../RightSection.tsx, .../CodeGen.tsx, .../buildBuyIframeUrl.ts
Added "Editability Options" checkboxes in LeftSection; RightSection forwards flags to BuyWidget; CodeGen conditionally emits props when false; buildBuyIframeUrl appends amountEditable=false / tokenEditable=false when applicable.
Docs, Stories & Release Note
apps/portal/src/app/bridge/buy-widget/iframe/page.mdx, packages/thirdweb/src/stories/BuyWidget.stories.tsx, .changeset/dirty-breads-swim.md
Documentation updated with "Editability Options" iframe examples; added three story variants (TokenNotEditable, AmountNotEditable, TokenAndAmountNotEditable); added release note entry.

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant IframePage as Page (iframe URL / query)
  participant Embed as BuyWidgetEmbed
  participant Widget as BuyWidget
  participant Fund as FundWallet
  participant TokenSec as TokenSection

  User->>IframePage: opens iframe URL (may include amountEditable=false / tokenEditable=false)
  IframePage->>Embed: parse query params -> props { amountEditable?, tokenEditable? }
  Embed->>Widget: forward props
  Widget->>Fund: forward props
  Fund->>TokenSec: forward props
  alt tokenEditable = false
    TokenSec-->>User: render token selector disabled (no chevron, non-interactive)
  else tokenEditable = true
    TokenSec-->>User: render token selector interactive
  end
  alt amountEditable = false
    Fund-->>User: render amount input & suggested buttons disabled/hidden
  else amountEditable = true
    Fund-->>User: render editable amount input and suggested buttons
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately and specifically identifies the main change: adding tokenEditable and amountEditable props to BuyWidget.
Description check ✅ Passed The PR description is largely complete with a detailed PR-Codex summary covering all major changes, though it lacks explicit testing instructions and notes for reviewers.
Linked Issues check ✅ Passed The PR successfully implements the objective from MNY-356 by adding tokenEditable and amountEditable parameters across widgets and iframes to control token selection and amount editing.
Out of Scope Changes check ✅ Passed All changes are within scope—introducing the editability props, propagating them through components, updating playgrounds, and documenting the features directly address the MNY-356 objective.

✏️ 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.

@github-actions github-actions bot added Dashboard Involves changes to the Dashboard. Playground Changes involving the Playground codebase. Portal Involves changes to the Portal (docs) codebase. packages SDK Involves changes to the thirdweb SDK labels Jan 12, 2026
@MananTank MananTank changed the title [MNY-335] Add tokenEditable and amountEditable props on BuyWidget [MNY-356] Add tokenEditable and amountEditable props on BuyWidget Jan 12, 2026
@MananTank MananTank marked this pull request as ready for review January 12, 2026 17:38
@MananTank MananTank requested review from a team as code owners January 12, 2026 17:38
Copy link
Member Author


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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
apps/playground-web/src/app/bridge/components/LeftSection.tsx (1)

268-281: Consider using useId() for checkbox IDs for consistency.

Other checkboxes in this file (e.g., cryptoPaymentId, cardPaymentId) use useId() for generating unique IDs. The hardcoded strings "token-editable" and "amount-editable" work but break the established pattern.

♻️ Suggested refactor

Add to the existing useId() declarations around line 66-67:

  const cryptoPaymentId = useId();
  const cardPaymentId = useId();
+ const tokenEditableId = useId();
+ const amountEditableId = useId();

Then update the checkbox IDs:

  <Checkbox
    checked={payOptions.tokenEditable}
-   id="token-editable"
+   id={tokenEditableId}
    ...
  />
- <Label htmlFor="token-editable">Token Editable</Label>
+ <Label htmlFor={tokenEditableId}>Token Editable</Label>
  <Checkbox
    checked={payOptions.amountEditable}
-   id="amount-editable"
+   id={amountEditableId}
    ...
  />
- <Label htmlFor="amount-editable">Amount Editable</Label>
+ <Label htmlFor={amountEditableId}>Amount Editable</Label>
packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx (1)

503-507: Consider using nullish coalescing for cleaner defaults.

The explicit undefined check works correctly, but could be simplified using the nullish coalescing operator for consistency with common patterns.

♻️ Optional simplification
-  const amountEditable =
-    props.amountEditable === undefined ? true : props.amountEditable;
-
-  const tokenEditable =
-    props.tokenEditable === undefined ? true : props.tokenEditable;
+  const amountEditable = props.amountEditable ?? true;
+  const tokenEditable = props.tokenEditable ?? true;
packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx (1)

562-595: Redundant disabled check in suggested amount buttons.

The props.amountEditable === false condition at line 569 is unnecessary since this entire block only renders when props.amountEditable is truthy (line 562). When amountEditable is true, this check will always evaluate to false.

♻️ Suggested simplification
                <Button
-                  disabled={
-                    !props.selectedToken?.data || props.amountEditable === false
-                  }
+                  disabled={!props.selectedToken?.data}
                  key={amount}
📜 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 37b801b.

📒 Files selected for processing (17)
  • .changeset/dirty-breads-swim.md
  • apps/dashboard/src/app/bridge/buy-widget/BuyWidgetEmbed.client.tsx
  • apps/dashboard/src/app/bridge/buy-widget/page.tsx
  • apps/playground-web/src/app/bridge/buy-widget/BuyPlayground.tsx
  • apps/playground-web/src/app/bridge/checkout-widget/CheckoutPlayground.tsx
  • apps/playground-web/src/app/bridge/components/CodeGen.tsx
  • apps/playground-web/src/app/bridge/components/LeftSection.tsx
  • apps/playground-web/src/app/bridge/components/RightSection.tsx
  • apps/playground-web/src/app/bridge/components/buildBuyIframeUrl.ts
  • apps/playground-web/src/app/bridge/components/types.ts
  • apps/playground-web/src/app/bridge/transaction-widget/TransactionPlayground.tsx
  • apps/portal/src/app/bridge/buy-widget/iframe/page.mdx
  • packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/common/selected-token-button.tsx
  • packages/thirdweb/src/react/web/ui/components/buttons.tsx
  • packages/thirdweb/src/stories/BuyWidget.stories.tsx
🧰 Additional context used
📓 Path-based instructions (13)
**/*.{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:

  • apps/playground-web/src/app/bridge/components/types.ts
  • apps/playground-web/src/app/bridge/components/buildBuyIframeUrl.ts
  • packages/thirdweb/src/stories/BuyWidget.stories.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/common/selected-token-button.tsx
  • packages/thirdweb/src/react/web/ui/components/buttons.tsx
  • apps/playground-web/src/app/bridge/components/LeftSection.tsx
  • apps/playground-web/src/app/bridge/components/RightSection.tsx
  • apps/playground-web/src/app/bridge/buy-widget/BuyPlayground.tsx
  • apps/dashboard/src/app/bridge/buy-widget/page.tsx
  • apps/playground-web/src/app/bridge/checkout-widget/CheckoutPlayground.tsx
  • apps/dashboard/src/app/bridge/buy-widget/BuyWidgetEmbed.client.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx
  • apps/playground-web/src/app/bridge/components/CodeGen.tsx
  • apps/playground-web/src/app/bridge/transaction-widget/TransactionPlayground.tsx
apps/{dashboard,playground-web}/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

apps/{dashboard,playground-web}/src/**/*.{ts,tsx}: Import UI component primitives from @/components/ui/* (Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground
Use Tailwind CSS only – no inline styles or CSS modules in dashboard and playground
Use cn() from @/lib/utils for conditional Tailwind class merging
Use design system tokens for styling (backgrounds: bg-card, borders: border-border, muted text: text-muted-foreground)
Expose className prop on root element for component overrides

Files:

  • apps/playground-web/src/app/bridge/components/types.ts
  • apps/playground-web/src/app/bridge/components/buildBuyIframeUrl.ts
  • apps/playground-web/src/app/bridge/components/LeftSection.tsx
  • apps/playground-web/src/app/bridge/components/RightSection.tsx
  • apps/playground-web/src/app/bridge/buy-widget/BuyPlayground.tsx
  • apps/dashboard/src/app/bridge/buy-widget/page.tsx
  • apps/playground-web/src/app/bridge/checkout-widget/CheckoutPlayground.tsx
  • apps/dashboard/src/app/bridge/buy-widget/BuyWidgetEmbed.client.tsx
  • apps/playground-web/src/app/bridge/components/CodeGen.tsx
  • apps/playground-web/src/app/bridge/transaction-widget/TransactionPlayground.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:

  • apps/playground-web/src/app/bridge/components/types.ts
  • apps/playground-web/src/app/bridge/components/buildBuyIframeUrl.ts
  • packages/thirdweb/src/stories/BuyWidget.stories.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/common/selected-token-button.tsx
  • packages/thirdweb/src/react/web/ui/components/buttons.tsx
  • apps/playground-web/src/app/bridge/components/LeftSection.tsx
  • apps/playground-web/src/app/bridge/components/RightSection.tsx
  • apps/playground-web/src/app/bridge/buy-widget/BuyPlayground.tsx
  • apps/dashboard/src/app/bridge/buy-widget/page.tsx
  • apps/playground-web/src/app/bridge/checkout-widget/CheckoutPlayground.tsx
  • apps/dashboard/src/app/bridge/buy-widget/BuyWidgetEmbed.client.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx
  • apps/playground-web/src/app/bridge/components/CodeGen.tsx
  • apps/playground-web/src/app/bridge/transaction-widget/TransactionPlayground.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • apps/playground-web/src/app/bridge/components/types.ts
  • apps/playground-web/src/app/bridge/components/buildBuyIframeUrl.ts
  • packages/thirdweb/src/stories/BuyWidget.stories.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/common/selected-token-button.tsx
  • packages/thirdweb/src/react/web/ui/components/buttons.tsx
  • apps/playground-web/src/app/bridge/components/LeftSection.tsx
  • apps/playground-web/src/app/bridge/components/RightSection.tsx
  • apps/playground-web/src/app/bridge/buy-widget/BuyPlayground.tsx
  • apps/dashboard/src/app/bridge/buy-widget/page.tsx
  • apps/playground-web/src/app/bridge/checkout-widget/CheckoutPlayground.tsx
  • apps/dashboard/src/app/bridge/buy-widget/BuyWidgetEmbed.client.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx
  • apps/playground-web/src/app/bridge/components/CodeGen.tsx
  • apps/playground-web/src/app/bridge/transaction-widget/TransactionPlayground.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/stories/BuyWidget.stories.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/common/selected-token-button.tsx
  • packages/thirdweb/src/react/web/ui/components/buttons.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx
**/*.stories.tsx

📄 CodeRabbit inference engine (CLAUDE.md)

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

Files:

  • packages/thirdweb/src/stories/BuyWidget.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/BuyWidget.stories.tsx
apps/dashboard/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

apps/dashboard/src/**/*.{ts,tsx}: Use NavLink for internal navigation with automatic active states in dashboard
Start server component files with import "server-only"; in Next.js
Read cookies/headers with next/headers in server components
Access server-only environment variables in server components
Perform heavy data fetching in server components
Implement redirect logic with redirect() from next/navigation in server components
Begin client component files with 'use client'; directive in Next.js
Handle interactive UI with React hooks (useState, useEffect, React Query, wallet hooks) in client components
Access browser APIs (localStorage, window, IntersectionObserver) in client components
Support fast transitions with prefetched data in client components
Always call getAuthToken() to retrieve JWT from cookies on server side
Use Authorization: Bearer header for API calls – never embed tokens in URLs
Return typed results (Project[], User[]) from server-side data fetches – avoid any
Wrap client-side API calls in React Query (@tanstack/react-query)
Use descriptive, stable queryKeys in React Query for cache hits
Configure staleTime/cacheTime in React Query based on freshness (default ≥ 60s)
Keep tokens secret via internal API routes or server actions
Never import posthog-js in server components – only use analytics client-side

Files:

  • apps/dashboard/src/app/bridge/buy-widget/page.tsx
  • apps/dashboard/src/app/bridge/buy-widget/BuyWidgetEmbed.client.tsx
apps/dashboard/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

apps/dashboard/**/*.{ts,tsx}: Always import from the central UI library under @/components/ui/* for reusable core UI components like Button, Input, Select, Tabs, Card, Sidebar, Separator, Badge
Use NavLink from @/components/ui/NavLink for internal navigation to ensure active states are handled automatically
For notices and skeletons, rely on AnnouncementBanner, GenericLoadingPage, and EmptyStateCard components
Import icons from lucide-react or the project-specific …/icons exports; never embed raw SVG
Keep components pure; fetch data outside using server components or hooks and pass it down via props
Use Tailwind CSS as the styling system; avoid inline styles or CSS modules
Merge class names with cn from @/lib/utils to keep conditional logic readable
Stick to design tokens: use bg-card, border-border, text-muted-foreground and other Tailwind variables instead of hard-coded colors
Use spacing utilities (px-*, py-*, gap-*) instead of custom margins
Follow mobile-first responsive design with Tailwind helpers (max-sm, md, lg, xl)
Never hard-code colors; always use Tailwind variables
Combine class names via cn, and expose className prop if useful in components
Use React Query (@tanstack/react-query) for all client-side data fetching with typed hooks

Files:

  • apps/dashboard/src/app/bridge/buy-widget/page.tsx
  • apps/dashboard/src/app/bridge/buy-widget/BuyWidgetEmbed.client.tsx
apps/dashboard/**/page.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

Use the container class with a max-w-7xl cap for consistent page width

Files:

  • apps/dashboard/src/app/bridge/buy-widget/page.tsx
apps/{dashboard,playground}/**/*.{tsx,ts}

📄 CodeRabbit inference engine (AGENTS.md)

apps/{dashboard,playground}/**/*.{tsx,ts}: Import UI primitives from @/components/ui/_ (Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in Dashboard and Playground apps
Use NavLink for internal navigation so active states are handled automatically
Use Tailwind CSS for styling – no inline styles or CSS modules
Merge class names with cn() from @/lib/utils to keep conditional logic readable
Stick to design tokens for styling: backgrounds (bg-card), borders (border-border), muted text (text-muted-foreground), etc.
Server Components: Read cookies/headers with next/headers, access server-only environment variables or secrets, perform heavy data fetching, implement redirect logic with redirect() from next/navigation, and start files with import 'server-only'; to prevent client bundling
Client Components: Begin files with 'use client'; before imports, handle interactive UI relying on React hooks (useState, useEffect, React Query, wallet hooks), access browser APIs (localStorage, window, IntersectionObserver, etc.), and support fast transitions with client-side data prefetching
For client-side data fetching: Wrap calls in React Query (@tanstack/react-query), use descriptive and stable queryKeys for cache hits, configure staleTime / cacheTime based on freshness requirements (default ≥ 60 s), and keep tokens secret by calling internal API routes or server actions

Files:

  • apps/dashboard/src/app/bridge/buy-widget/page.tsx
  • apps/dashboard/src/app/bridge/buy-widget/BuyWidgetEmbed.client.tsx
apps/{dashboard,playground}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

apps/{dashboard,playground}/**/*.{ts,tsx}: For server-side data fetching: Always call getAuthToken() to retrieve the JWT from cookies and inject the token as an Authorization: Bearer header – never embed it in the URL. Return typed results (Project[], User[], …) – avoid any
Never import posthog-js in server components; analytics reporting is client-side only

Files:

  • apps/dashboard/src/app/bridge/buy-widget/page.tsx
  • apps/dashboard/src/app/bridge/buy-widget/BuyWidgetEmbed.client.tsx
apps/dashboard/**/*.client.tsx

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

apps/dashboard/**/*.client.tsx: Name component files after the component in PascalCase; append .client.tsx when the component is interactive
Client components must start with 'use client'; directive before imports

Files:

  • apps/dashboard/src/app/bridge/buy-widget/BuyWidgetEmbed.client.tsx
🧬 Code graph analysis (4)
packages/thirdweb/src/stories/BuyWidget.stories.tsx (2)
packages/thirdweb/src/stories/utils.tsx (1)
  • storyClient (14-16)
packages/thirdweb/src/exports/chains.ts (1)
  • base (18-18)
packages/thirdweb/src/react/web/ui/Bridge/common/selected-token-button.tsx (3)
packages/thirdweb/src/react/web/ui/components/buttons.tsx (1)
  • Button (27-161)
packages/thirdweb/src/react/core/design-system/index.ts (3)
  • spacing (142-154)
  • radius (156-164)
  • iconSize (166-176)
packages/thirdweb/src/react/web/ui/components/basic.tsx (1)
  • Container (80-193)
apps/playground-web/src/app/bridge/components/LeftSection.tsx (2)
packages/thirdweb/src/react/web/ui/components/formElements.tsx (1)
  • Label (20-28)
apps/dashboard/src/@/components/ui/checkbox.tsx (1)
  • Checkbox (34-34)
apps/dashboard/src/app/bridge/buy-widget/page.tsx (1)
apps/dashboard/src/app/bridge/_common/parseQueryParams.ts (1)
  • parseQueryParams (3-11)
🪛 Gitleaks (8.30.0)
packages/thirdweb/src/stories/BuyWidget.stories.tsx

[high] 72-72: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


[high] 84-84: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


[high] 96-96: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

⏰ 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: Size
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Build Packages
  • GitHub Check: Unit Tests
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Lint Packages
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (21)
packages/thirdweb/src/react/web/ui/components/buttons.tsx (1)

34-36: LGTM!

Good fix to prevent the active state transform from applying when the button is disabled. This ensures consistent visual behavior for disabled buttons across the widget.

apps/playground-web/src/app/bridge/checkout-widget/CheckoutPlayground.tsx (1)

27-28: LGTM!

Sensible defaults with editability enabled by default. Note that the LeftSection component only displays editability controls for the "buy" widget, not "checkout" - this appears intentional since checkout flows typically have fixed products and amounts.

apps/playground-web/src/app/bridge/components/buildBuyIframeUrl.ts (1)

71-78: LGTM!

The implementation correctly appends query parameters only when editability is explicitly disabled (=== false), maintaining backward compatibility where the default behavior is editable. This pattern is consistent with other optional parameters in this file.

apps/playground-web/src/app/bridge/components/LeftSection.tsx (1)

263-301: LGTM on the overall implementation.

The "Editability Options" section is well-structured, correctly scoped to the "buy" widget, and the onCheckedChange handlers properly handle Radix's CheckedState type by comparing checked === true.

packages/thirdweb/src/react/web/ui/Bridge/common/selected-token-button.tsx (2)

30-50: LGTM on the disabled state implementation.

The implementation correctly:

  • Removes hover background when disabled
  • Passes the disabled prop to the underlying Button
  • Overrides default disabled styling with cursor: "default" and opacity: 1 for a cleaner non-interactive appearance (rather than the typical "not-allowed" cursor and dimmed opacity)

This provides a subtle indication that the field is locked rather than broken/unavailable, which aligns well with the "editability" concept.


174-189: Good UX decision.

Hiding the chevron indicator when the button is disabled clearly communicates that the token selection is not interactive. This is better than showing a dropdown arrow on a non-clickable element.

apps/playground-web/src/app/bridge/components/RightSection.tsx (1)

73-74: LGTM!

The amountEditable and tokenEditable props are correctly passed to BuyWidget from the playground options. The placement alongside related props like receiverAddress maintains good code organization.

apps/playground-web/src/app/bridge/components/CodeGen.tsx (1)

163-170: LGTM!

The code generation logic correctly emits amountEditable and tokenEditable only when explicitly set to false for the "buy" widget. The strict equality check (=== false) appropriately distinguishes between false and undefined, ensuring minimal generated code when defaults are used.

.changeset/dirty-breads-swim.md (1)

1-5: LGTM!

The changeset correctly identifies this as a patch release for additive, non-breaking props. The description clearly communicates the feature purpose.

apps/playground-web/src/app/bridge/buy-widget/BuyPlayground.tsx (1)

27-28: LGTM!

The default values of true for both amountEditable and tokenEditable align with the expected behavior where editing is enabled by default, and users can explicitly disable it.

apps/playground-web/src/app/bridge/transaction-widget/TransactionPlayground.tsx (1)

24-25: No changes needed. The amountEditable and tokenEditable controls in LeftSection.tsx are properly gated behind props.widget === "buy" (line 159), so they are only displayed for the Buy widget and not for TransactionWidget. Users will not see these controls when using the transaction widget, avoiding any confusion.

Likely an incorrect or invalid review comment.

apps/portal/src/app/bridge/buy-widget/iframe/page.mdx (1)

143-167: LGTM! Documentation is clear and well-structured.

The new "Editability Options" section follows the existing documentation patterns, with appropriate examples showing the query parameters in context (including chain for token selection and amount for amount editing).

apps/dashboard/src/app/bridge/buy-widget/BuyWidgetEmbed.client.tsx (1)

23-24: LGTM! Clean prop forwarding implementation.

The new amountEditable and tokenEditable props are correctly typed as optional booleans and properly forwarded to the underlying BuyWidget component, consistent with the existing props pattern.

Also applies to: 39-40, 75-76

packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx (1)

216-225: LGTM! Well-documented new props with clear JSDoc.

The new amountEditable and tokenEditable props are properly typed and documented, clearly explaining the default behavior (editable by default).

apps/dashboard/src/app/bridge/buy-widget/page.tsx (2)

76-82: LGTM! Query parameter parsing correctly implements the documented behavior.

The parsing logic intentionally returns false only when explicitly set to "false", and undefined otherwise. This allows the downstream BuyWidget component to apply its default (editable) behavior when the parameter is omitted, which aligns with the documentation.


101-102: Props correctly forwarded to BuyWidgetEmbed.

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

66-101: LGTM! Good test coverage for the new editability props.

The three new story variants provide comprehensive coverage:

  • Individual prop testing (TokenNotEditable, AmountNotEditable)
  • Combined scenario (TokenAndAmountNotEditable)

The stories follow existing patterns and use the same Base USDC token address as other stories.

Note: The static analysis hints flagging the token address as a "Generic API Key" are false positives—this is the public USDC contract address on Base (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913), not a secret.

apps/playground-web/src/app/bridge/components/types.ts (1)

62-65: LGTM!

The new amountEditable and tokenEditable boolean fields are properly typed and well-placed within the payOptions object. The comment clearly indicates their purpose.

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

116-125: LGTM!

The new props are well-documented with clear JSDoc comments explaining their purpose and default behavior. The props are correctly typed as required booleans, with the defaulting logic handled by the parent component (BuyWidget).


477-485: LGTM!

The tokenEditable prop is correctly used to disable the token selection button, preventing users from changing the token when editing is disabled.


489-507: LGTM!

The token amount DecimalInput is correctly disabled when amountEditable is false, preventing user modification of the value.

@codecov
Copy link

codecov bot commented Jan 12, 2026

Codecov Report

❌ Patch coverage is 1.63934% with 60 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.00%. Comparing base (49b80fe) to head (8d4b6a1).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...es/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx 0.00% 35 Missing ⚠️
...act/web/ui/Bridge/common/selected-token-button.tsx 0.00% 19 Missing ⚠️
...ges/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8621      +/-   ##
==========================================
- Coverage   53.02%   53.00%   -0.02%     
==========================================
  Files         924      924              
  Lines       61726    61746      +20     
  Branches     4035     4031       -4     
==========================================
  Hits        32730    32730              
- Misses      28898    28918      +20     
  Partials       98       98              
Flag Coverage Δ
packages 53.00% <1.63%> (-0.02%) ⬇️
Files with missing lines Coverage Δ
...s/thirdweb/src/react/web/ui/components/buttons.tsx 82.58% <100.00%> (ø)
...ges/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx 4.53% <0.00%> (-0.08%) ⬇️
...act/web/ui/Bridge/common/selected-token-button.tsx 6.94% <0.00%> (-0.25%) ⬇️
...es/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx 6.13% <0.00%> (-0.11%) ⬇️
🚀 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%)

@graphite-app
Copy link
Contributor

graphite-app bot commented Jan 12, 2026

Merge activity

)

<!--

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

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

## Notes for the reviewer

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

## How to test

Unit tests, playground, etc.

-->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces two new properties, `amountEditable` and `tokenEditable`, to enhance the `BuyWidget` component, allowing control over editing options for token selection and amount. This improves user experience by providing flexibility in the widget's functionality.

### Detailed summary
- Added `amountEditable` and `tokenEditable` properties to `BuyWidget`.
- Updated `BuyPlayground.tsx`, `CheckoutPlayground.tsx`, and `TransactionPlayground.tsx` to use new props.
- Modified `CodeGen.tsx` to incorporate editability options.
- Updated URL generation in `buildBuyIframeUrl.ts` for new props.
- Added editability options in `LeftSection.tsx`.
- Enhanced `BuyWidgetEmbed` to accept new props.
- Implemented stories in `BuyWidget.stories.tsx` for editable and non-editable states.
- Added documentation in `iframe/page.mdx` for new features.
- Adjusted `FundWallet.tsx` and `TokenSection.tsx` to respect new editability options.

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

<!-- end pr-codex -->

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

## Summary by CodeRabbit

## Release Notes

* **New Features**
  * Added `amountEditable` and `tokenEditable` props to the BuyWidget component, allowing developers to disable token selection and/or amount editing in the buy flow.
  * Enhanced UI controls to prevent interaction with locked fields when these options are disabled.
  * Updated documentation with examples of how to use the new editability options.

* **Tests**
  * Added story variants demonstrating token and amount lock scenarios.

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

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx (1)

562-595: Redundant disabled check inside conditionally rendered block.

The props.amountEditable === false check in the disabled condition on line 569 is redundant because this entire block is already conditionally rendered only when props.amountEditable is truthy (line 562). The condition will always evaluate to false.

Suggested simplification
               <Button
-                  disabled={
-                    !props.selectedToken?.data || props.amountEditable === false
-                  }
+                  disabled={!props.selectedToken?.data}
                   key={amount}
📜 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 37b801b and 8d4b6a1.

📒 Files selected for processing (17)
  • .changeset/dirty-breads-swim.md
  • apps/dashboard/src/app/bridge/buy-widget/BuyWidgetEmbed.client.tsx
  • apps/dashboard/src/app/bridge/buy-widget/page.tsx
  • apps/playground-web/src/app/bridge/buy-widget/BuyPlayground.tsx
  • apps/playground-web/src/app/bridge/checkout-widget/CheckoutPlayground.tsx
  • apps/playground-web/src/app/bridge/components/CodeGen.tsx
  • apps/playground-web/src/app/bridge/components/LeftSection.tsx
  • apps/playground-web/src/app/bridge/components/RightSection.tsx
  • apps/playground-web/src/app/bridge/components/buildBuyIframeUrl.ts
  • apps/playground-web/src/app/bridge/components/types.ts
  • apps/playground-web/src/app/bridge/transaction-widget/TransactionPlayground.tsx
  • apps/portal/src/app/bridge/buy-widget/iframe/page.mdx
  • packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/common/selected-token-button.tsx
  • packages/thirdweb/src/react/web/ui/components/buttons.tsx
  • packages/thirdweb/src/stories/BuyWidget.stories.tsx
🚧 Files skipped from review as they are similar to previous changes (9)
  • apps/playground-web/src/app/bridge/components/LeftSection.tsx
  • apps/playground-web/src/app/bridge/components/RightSection.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/common/selected-token-button.tsx
  • apps/playground-web/src/app/bridge/transaction-widget/TransactionPlayground.tsx
  • apps/playground-web/src/app/bridge/components/buildBuyIframeUrl.ts
  • apps/playground-web/src/app/bridge/checkout-widget/CheckoutPlayground.tsx
  • apps/playground-web/src/app/bridge/buy-widget/BuyPlayground.tsx
  • apps/playground-web/src/app/bridge/components/types.ts
  • packages/thirdweb/src/react/web/ui/Bridge/BuyWidget.tsx
🧰 Additional context used
📓 Path-based instructions (13)
**/*.{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:

  • apps/dashboard/src/app/bridge/buy-widget/BuyWidgetEmbed.client.tsx
  • apps/playground-web/src/app/bridge/components/CodeGen.tsx
  • packages/thirdweb/src/react/web/ui/components/buttons.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx
  • apps/dashboard/src/app/bridge/buy-widget/page.tsx
  • packages/thirdweb/src/stories/BuyWidget.stories.tsx
apps/{dashboard,playground-web}/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

apps/{dashboard,playground-web}/src/**/*.{ts,tsx}: Import UI component primitives from @/components/ui/* (Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground
Use Tailwind CSS only – no inline styles or CSS modules in dashboard and playground
Use cn() from @/lib/utils for conditional Tailwind class merging
Use design system tokens for styling (backgrounds: bg-card, borders: border-border, muted text: text-muted-foreground)
Expose className prop on root element for component overrides

Files:

  • apps/dashboard/src/app/bridge/buy-widget/BuyWidgetEmbed.client.tsx
  • apps/playground-web/src/app/bridge/components/CodeGen.tsx
  • apps/dashboard/src/app/bridge/buy-widget/page.tsx
apps/dashboard/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

apps/dashboard/src/**/*.{ts,tsx}: Use NavLink for internal navigation with automatic active states in dashboard
Start server component files with import "server-only"; in Next.js
Read cookies/headers with next/headers in server components
Access server-only environment variables in server components
Perform heavy data fetching in server components
Implement redirect logic with redirect() from next/navigation in server components
Begin client component files with 'use client'; directive in Next.js
Handle interactive UI with React hooks (useState, useEffect, React Query, wallet hooks) in client components
Access browser APIs (localStorage, window, IntersectionObserver) in client components
Support fast transitions with prefetched data in client components
Always call getAuthToken() to retrieve JWT from cookies on server side
Use Authorization: Bearer header for API calls – never embed tokens in URLs
Return typed results (Project[], User[]) from server-side data fetches – avoid any
Wrap client-side API calls in React Query (@tanstack/react-query)
Use descriptive, stable queryKeys in React Query for cache hits
Configure staleTime/cacheTime in React Query based on freshness (default ≥ 60s)
Keep tokens secret via internal API routes or server actions
Never import posthog-js in server components – only use analytics client-side

Files:

  • apps/dashboard/src/app/bridge/buy-widget/BuyWidgetEmbed.client.tsx
  • apps/dashboard/src/app/bridge/buy-widget/page.tsx
apps/dashboard/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

apps/dashboard/**/*.{ts,tsx}: Always import from the central UI library under @/components/ui/* for reusable core UI components like Button, Input, Select, Tabs, Card, Sidebar, Separator, Badge
Use NavLink from @/components/ui/NavLink for internal navigation to ensure active states are handled automatically
For notices and skeletons, rely on AnnouncementBanner, GenericLoadingPage, and EmptyStateCard components
Import icons from lucide-react or the project-specific …/icons exports; never embed raw SVG
Keep components pure; fetch data outside using server components or hooks and pass it down via props
Use Tailwind CSS as the styling system; avoid inline styles or CSS modules
Merge class names with cn from @/lib/utils to keep conditional logic readable
Stick to design tokens: use bg-card, border-border, text-muted-foreground and other Tailwind variables instead of hard-coded colors
Use spacing utilities (px-*, py-*, gap-*) instead of custom margins
Follow mobile-first responsive design with Tailwind helpers (max-sm, md, lg, xl)
Never hard-code colors; always use Tailwind variables
Combine class names via cn, and expose className prop if useful in components
Use React Query (@tanstack/react-query) for all client-side data fetching with typed hooks

Files:

  • apps/dashboard/src/app/bridge/buy-widget/BuyWidgetEmbed.client.tsx
  • apps/dashboard/src/app/bridge/buy-widget/page.tsx
apps/dashboard/**/*.client.tsx

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

apps/dashboard/**/*.client.tsx: Name component files after the component in PascalCase; append .client.tsx when the component is interactive
Client components must start with 'use client'; directive before imports

Files:

  • apps/dashboard/src/app/bridge/buy-widget/BuyWidgetEmbed.client.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:

  • apps/dashboard/src/app/bridge/buy-widget/BuyWidgetEmbed.client.tsx
  • apps/playground-web/src/app/bridge/components/CodeGen.tsx
  • packages/thirdweb/src/react/web/ui/components/buttons.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx
  • apps/dashboard/src/app/bridge/buy-widget/page.tsx
  • packages/thirdweb/src/stories/BuyWidget.stories.tsx
apps/{dashboard,playground}/**/*.{tsx,ts}

📄 CodeRabbit inference engine (AGENTS.md)

apps/{dashboard,playground}/**/*.{tsx,ts}: Import UI primitives from @/components/ui/_ (Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in Dashboard and Playground apps
Use NavLink for internal navigation so active states are handled automatically
Use Tailwind CSS for styling – no inline styles or CSS modules
Merge class names with cn() from @/lib/utils to keep conditional logic readable
Stick to design tokens for styling: backgrounds (bg-card), borders (border-border), muted text (text-muted-foreground), etc.
Server Components: Read cookies/headers with next/headers, access server-only environment variables or secrets, perform heavy data fetching, implement redirect logic with redirect() from next/navigation, and start files with import 'server-only'; to prevent client bundling
Client Components: Begin files with 'use client'; before imports, handle interactive UI relying on React hooks (useState, useEffect, React Query, wallet hooks), access browser APIs (localStorage, window, IntersectionObserver, etc.), and support fast transitions with client-side data prefetching
For client-side data fetching: Wrap calls in React Query (@tanstack/react-query), use descriptive and stable queryKeys for cache hits, configure staleTime / cacheTime based on freshness requirements (default ≥ 60 s), and keep tokens secret by calling internal API routes or server actions

Files:

  • apps/dashboard/src/app/bridge/buy-widget/BuyWidgetEmbed.client.tsx
  • apps/dashboard/src/app/bridge/buy-widget/page.tsx
apps/{dashboard,playground}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

apps/{dashboard,playground}/**/*.{ts,tsx}: For server-side data fetching: Always call getAuthToken() to retrieve the JWT from cookies and inject the token as an Authorization: Bearer header – never embed it in the URL. Return typed results (Project[], User[], …) – avoid any
Never import posthog-js in server components; analytics reporting is client-side only

Files:

  • apps/dashboard/src/app/bridge/buy-widget/BuyWidgetEmbed.client.tsx
  • apps/dashboard/src/app/bridge/buy-widget/page.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • apps/dashboard/src/app/bridge/buy-widget/BuyWidgetEmbed.client.tsx
  • apps/playground-web/src/app/bridge/components/CodeGen.tsx
  • packages/thirdweb/src/react/web/ui/components/buttons.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx
  • apps/dashboard/src/app/bridge/buy-widget/page.tsx
  • packages/thirdweb/src/stories/BuyWidget.stories.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/buttons.tsx
  • packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx
  • packages/thirdweb/src/stories/BuyWidget.stories.tsx
apps/dashboard/**/page.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/dashboard.mdc)

Use the container class with a max-w-7xl cap for consistent page width

Files:

  • apps/dashboard/src/app/bridge/buy-widget/page.tsx
**/*.stories.tsx

📄 CodeRabbit inference engine (CLAUDE.md)

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

Files:

  • packages/thirdweb/src/stories/BuyWidget.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/BuyWidget.stories.tsx
🧬 Code graph analysis (3)
packages/thirdweb/src/react/web/ui/Bridge/FundWallet.tsx (5)
packages/thirdweb/src/react/web/ui/components/Spacer.tsx (1)
  • Spacer (6-15)
packages/thirdweb/src/react/web/ui/components/basic.tsx (1)
  • Container (80-193)
packages/thirdweb/src/react/web/ui/components/buttons.tsx (1)
  • Button (27-161)
packages/thirdweb/src/react/core/design-system/index.ts (3)
  • fontSize (132-140)
  • radius (156-164)
  • spacing (142-154)
packages/thirdweb/src/pay/convert/type.ts (1)
  • getFiatSymbol (29-31)
apps/dashboard/src/app/bridge/buy-widget/page.tsx (1)
apps/dashboard/src/app/bridge/_common/parseQueryParams.ts (1)
  • parseQueryParams (3-11)
packages/thirdweb/src/stories/BuyWidget.stories.tsx (2)
packages/thirdweb/src/stories/utils.tsx (1)
  • storyClient (14-16)
packages/thirdweb/src/exports/chains.ts (1)
  • base (18-18)
🪛 Gitleaks (8.30.0)
packages/thirdweb/src/stories/BuyWidget.stories.tsx

[high] 72-72: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


[high] 84-84: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


[high] 96-96: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: Size
  • GitHub Check: Build Packages
  • GitHub Check: Unit Tests
  • GitHub Check: Lint Packages
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (9)
packages/thirdweb/src/react/web/ui/components/buttons.tsx (1)

34-36: LGTM! Good UX improvement.

Scoping the active transform to exclude disabled buttons prevents misleading visual feedback when users click on non-interactive buttons.

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

66-101: LGTM! Good story coverage for the new props.

The three new variants properly exercise the tokenEditable and amountEditable props in isolation and combination, following the established pattern.

Note: The static analysis warnings about "Generic API Key" on lines 72, 84, and 96 are false positives — 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 is the public Base USDC contract address, not a secret.

apps/playground-web/src/app/bridge/components/CodeGen.tsx (1)

163-170: LGTM! Clean conditional prop generation.

The logic correctly limits these props to the "buy" widget and only emits them when explicitly false, allowing the default editable behavior when omitted.

.changeset/dirty-breads-swim.md (1)

1-5: LGTM!

Patch version is appropriate for these backward-compatible additions, and the description accurately summarizes the new props.

apps/portal/src/app/bridge/buy-widget/iframe/page.mdx (1)

143-168: LGTM! Well-structured documentation.

The new "Editability Options" section follows the existing documentation patterns, with clear descriptions and practical examples. Good call including amount=0.01 in the amountEditable=false example to demonstrate the typical use case.

apps/dashboard/src/app/bridge/buy-widget/BuyWidgetEmbed.client.tsx (1)

23-24: LGTM!

The new amountEditable and tokenEditable props are cleanly added and forwarded to the underlying BuyWidget. The optional boolean typing is appropriate, allowing the widget to use its default behavior when not specified.

Also applies to: 39-40, 75-76

apps/dashboard/src/app/bridge/buy-widget/page.tsx (1)

76-82: LGTM!

The parsing logic correctly returns false only when explicitly set to "false", and undefined otherwise. This allows the widget to apply its default behavior (editable) when the parameter is omitted or set to any other value. The approach is consistent between both new parameters.

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

116-125: LGTM!

The new props are well-documented with JSDoc comments explaining their purpose and default behavior.


484-484: LGTM!

Using === false correctly handles the case where the prop might be undefined at the call site, treating it as editable by default.

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

Labels

Dashboard Involves changes to the Dashboard. packages Playground Changes involving the Playground codebase. Portal Involves changes to the Portal (docs) codebase. SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants