Skip to content

Conversation

@MananTank
Copy link
Member

@MananTank MananTank commented Dec 18, 2025


PR-Codex overview

This PR focuses on updating the BridgeWidget functionality and improving the documentation for the Bridge Widget Playground. It modifies integration types, adjusts code handling, and enhances the user experience by adding new features and documentation entries.

Detailed summary

  • Updated href in sidebar.tsx to point to the new playground URL.
  • Changed integrationType in types.ts from "script" | "component" | "iframe" to "iframe" | "script" | "react".
  • Adjusted code language rendering in code.tsx based on integrationType.
  • Modified condition checks for integration types in getCode function.
  • Added ArticleIconCard components in multiple .mdx files for the Bridge Widget Playground.
  • Introduced a validTabs array in page.tsx for tab validation.
  • Updated the Page component to accept searchParams and handle tab selection.
  • Enhanced BridgeWidgetPlayground component to manage URL updates based on selected tab.

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

Summary by CodeRabbit

  • New Features

    • Playground reads a URL tab parameter to pre-select a tab and keeps the browser URL synced when switching.
    • Playground accepts a default tab prop to initialize the selected integration.
  • User-facing Changes

    • "Component" tab renamed and standardized to "React"; code snippets and tab behavior now use "React".
  • Documentation

    • Added "Try it out" call-to-action cards linking to the live playground across docs.
  • Chores

    • Sidebar playground link updated to the bridge-specific playground URL.

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

@vercel
Copy link

vercel bot commented Dec 18, 2025

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

Project Deployment Review Updated (UTC)
docs-v2 Ready Ready Preview, Comment Dec 18, 2025 6:18pm
thirdweb_playground Ready Ready Preview, Comment Dec 18, 2025 6:18pm
3 Skipped Deployments
Project Deployment Review Updated (UTC)
nebula Skipped Skipped Dec 18, 2025 6:18pm
thirdweb-www Skipped Skipped Dec 18, 2025 6:18pm
wallet-ui Skipped Skipped Dec 18, 2025 6:18pm

@vercel vercel bot temporarily deployed to Preview – thirdweb-www December 18, 2025 17:38 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui December 18, 2025 17:38 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula December 18, 2025 17:38 Inactive
@changeset-bot
Copy link

changeset-bot bot commented Dec 18, 2025

⚠️ No Changeset found

Latest commit: 9383ccd

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

This PR includes no changesets

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

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

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 18, 2025

Walkthrough

Renames the Bridge Widget integration type from "component" to "react", adds URL-backed default-tab support and URL synchronization for the playground, updates page signature to accept searchParams, adds "Try it out" playground cards in portal docs, and updates the portal sidebar Playground URL to the bridge playground path.

Changes

Cohort / File(s) Summary
Type & runtime logic
apps/playground-web/src/app/bridge/bridge-widget/components/types.ts, apps/playground-web/src/app/bridge/bridge-widget/components/code.tsx, apps/playground-web/src/app/bridge/bridge-widget/components/bridge-playground.tsx
Renamed integration type "component""react" in the type union and runtime branches. Code generation now emits TSX for "react". BridgeWidgetPlayground now accepts `props: { defaultTab?: "iframe"
Page-level search handling
apps/playground-web/src/app/bridge/bridge-widget/page.tsx
Made Page an async function that accepts searchParams, validates a tab query param against ["iframe","script","react"], and passes the normalized defaultTab into BridgeWidgetPlayground.
Documentation — playground CTA additions
apps/portal/src/app/bridge/bridge-widget/iframe/page.mdx, apps/portal/src/app/bridge/bridge-widget/page.mdx, apps/portal/src/app/bridge/bridge-widget/react/page.mdx, apps/portal/src/app/bridge/bridge-widget/script/page.mdx
Added PlayIcon import and new "Try it out" sections using ArticleIconCard linking to the live Bridge Widget Playground; cleaned up duplicated inline imports in one MDX file.
Navigation
apps/portal/src/app/bridge/sidebar.tsx
Updated the Playground sidebar link URL from https://playground.thirdweb.com to https://playground.thirdweb.com/bridge.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify all occurrences of the old "component" value were replaced (types, codegen branches, UI checks).
  • Review page.tsx searchParams parsing and type narrowing for array/malformed values.
  • Confirm BridgeWidgetPlayground prop initialization and URL sync do not introduce hydration/SSR inconsistencies (server vs client defaultTab usage).
  • Check codegen outputs and getCode routing for the "react" branch to ensure correct templates are chosen.

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description lacks the required template structure with Notes for the reviewer and How to test sections; it only contains a PR-Codex auto-generated summary. Complete the PR description by adding 'Notes for the reviewer' and 'How to test' sections following the repository template to provide proper context for reviewers.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main addition in this PR: playground links for the bridge widget across the portal documentation.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 12-18-portal_add_bridge_widget_playground_links

📜 Recent 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 3687b8f and 9383ccd.

📒 Files selected for processing (9)
  • apps/playground-web/src/app/bridge/bridge-widget/components/bridge-playground.tsx (3 hunks)
  • apps/playground-web/src/app/bridge/bridge-widget/components/code.tsx (2 hunks)
  • apps/playground-web/src/app/bridge/bridge-widget/components/types.ts (1 hunks)
  • apps/playground-web/src/app/bridge/bridge-widget/page.tsx (3 hunks)
  • apps/portal/src/app/bridge/bridge-widget/iframe/page.mdx (2 hunks)
  • apps/portal/src/app/bridge/bridge-widget/page.mdx (2 hunks)
  • apps/portal/src/app/bridge/bridge-widget/react/page.mdx (2 hunks)
  • apps/portal/src/app/bridge/bridge-widget/script/page.mdx (2 hunks)
  • apps/portal/src/app/bridge/sidebar.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (7)
  • apps/portal/src/app/bridge/bridge-widget/page.mdx
  • apps/portal/src/app/bridge/sidebar.tsx
  • apps/playground-web/src/app/bridge/bridge-widget/page.tsx
  • apps/playground-web/src/app/bridge/bridge-widget/components/types.ts
  • apps/portal/src/app/bridge/bridge-widget/iframe/page.mdx
  • apps/playground-web/src/app/bridge/bridge-widget/components/bridge-playground.tsx
  • apps/playground-web/src/app/bridge/bridge-widget/components/code.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: Build Packages
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Lint Packages
  • GitHub Check: Size
  • GitHub Check: Unit Tests
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (4)
apps/portal/src/app/bridge/bridge-widget/script/page.mdx (2)

2-3: LGTM! Clean import additions.

The imports for ArticleIconCard and PlayIcon are correctly structured and support the new playground link section.

Also applies to: 9-9


61-68: Excellent addition! Playground link enhances documentation.

The "Try it out" section provides a valuable interactive experience for users. The playground URL with tab=script correctly aligns with this script integration page and is fully functional.

apps/portal/src/app/bridge/bridge-widget/react/page.mdx (2)

2-2: LGTM! Consistent import pattern.

The imports mirror the script integration page, maintaining consistency across documentation.

Also applies to: 8-8


82-91: Great addition! Consistent playground link with correct tab parameter.

The "Try it out" section follows the same pattern as the script page. The URL parameter tab=react correctly reflects the integration type rename from "component" to "react" mentioned in the PR objectives.

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 Playground Changes involving the Playground codebase. Portal Involves changes to the Portal (docs) codebase. labels Dec 18, 2025
@MananTank MananTank marked this pull request as ready for review December 18, 2025 17:39
@MananTank MananTank requested review from a team as code owners December 18, 2025 17:39
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.

@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8575   +/-   ##
=======================================
  Coverage   54.47%   54.47%           
=======================================
  Files         922      922           
  Lines       61361    61361           
  Branches     4149     4149           
=======================================
  Hits        33425    33425           
  Misses      27835    27835           
  Partials      101      101           
Flag Coverage Δ
packages 54.47% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 18, 2025

size-limit report 📦

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

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)
apps/playground-web/src/app/bridge/bridge-widget/page.tsx (1)

23-34: Correct Next.js 15 async searchParams migration.

The implementation correctly follows Next.js 15's pattern where searchParams is a Promise that must be awaited. The validation logic properly handles both string and string[] cases, with appropriate fallback to undefined for invalid values.

Optional: Add explicit return type for better IDE support
-export default async function Page(props: {
+export default async function Page(props: {
   searchParams: Promise<{
     tab?: string | undefined | string[];
   }>;
-}) {
+}): Promise<JSX.Element> {

This addition is purely for documentation and IDE autocomplete—the function is correctly typed without it.

📜 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 ac326e2 and b898a88.

📒 Files selected for processing (9)
  • apps/playground-web/src/app/bridge/bridge-widget/components/bridge-playground.tsx (2 hunks)
  • apps/playground-web/src/app/bridge/bridge-widget/components/code.tsx (2 hunks)
  • apps/playground-web/src/app/bridge/bridge-widget/components/types.ts (1 hunks)
  • apps/playground-web/src/app/bridge/bridge-widget/page.tsx (3 hunks)
  • apps/portal/src/app/bridge/bridge-widget/iframe/page.mdx (2 hunks)
  • apps/portal/src/app/bridge/bridge-widget/page.mdx (2 hunks)
  • apps/portal/src/app/bridge/bridge-widget/react/page.mdx (2 hunks)
  • apps/portal/src/app/bridge/bridge-widget/script/page.mdx (2 hunks)
  • apps/portal/src/app/bridge/sidebar.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

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

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

Files:

  • apps/playground-web/src/app/bridge/bridge-widget/components/types.ts
  • apps/playground-web/src/app/bridge/bridge-widget/components/bridge-playground.tsx
  • apps/playground-web/src/app/bridge/bridge-widget/page.tsx
  • apps/portal/src/app/bridge/sidebar.tsx
  • apps/playground-web/src/app/bridge/bridge-widget/components/code.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/bridge-widget/components/types.ts
  • apps/playground-web/src/app/bridge/bridge-widget/components/bridge-playground.tsx
  • apps/playground-web/src/app/bridge/bridge-widget/page.tsx
  • apps/playground-web/src/app/bridge/bridge-widget/components/code.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/bridge-widget/components/types.ts
  • apps/playground-web/src/app/bridge/bridge-widget/components/bridge-playground.tsx
  • apps/playground-web/src/app/bridge/bridge-widget/page.tsx
  • apps/portal/src/app/bridge/sidebar.tsx
  • apps/playground-web/src/app/bridge/bridge-widget/components/code.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/bridge-widget/components/types.ts
  • apps/playground-web/src/app/bridge/bridge-widget/components/bridge-playground.tsx
  • apps/playground-web/src/app/bridge/bridge-widget/page.tsx
  • apps/portal/src/app/bridge/sidebar.tsx
  • apps/playground-web/src/app/bridge/bridge-widget/components/code.tsx
🧬 Code graph analysis (2)
apps/playground-web/src/app/bridge/bridge-widget/components/bridge-playground.tsx (1)
apps/playground-web/src/app/bridge/bridge-widget/components/types.ts (1)
  • BridgeWidgetPlaygroundOptions (7-28)
apps/playground-web/src/app/bridge/bridge-widget/page.tsx (1)
apps/playground-web/src/app/bridge/bridge-widget/components/bridge-playground.tsx (1)
  • BridgeWidgetPlayground (22-79)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Size
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (16)
apps/portal/src/app/bridge/sidebar.tsx (1)

16-16: LGTM - Playground link now points to bridge-specific path.

The updated URL correctly routes to the bridge widget playground, aligning with the new routing structure introduced in this PR.

apps/portal/src/app/bridge/bridge-widget/script/page.mdx (2)

1-9: LGTM - Import organization is clean.

Imports are well-organized with ArticleIconCard and PlayIcon added to support the new playground CTA section.


61-68: LGTM - Playground CTA section is consistent with other documentation pages.

The "Try it out" section with the playground link follows the same pattern used across other bridge-widget documentation pages, and the ?tab=script parameter correctly defaults to the script integration tab.

apps/portal/src/app/bridge/bridge-widget/page.mdx (2)

9-9: LGTM - PlayIcon import added for playground CTA.


61-71: LGTM - Playground CTA section added consistently.

The playground link appropriately omits a tab parameter since this is an overview page, allowing the playground to use its default tab.

apps/portal/src/app/bridge/bridge-widget/react/page.mdx (2)

1-8: LGTM - Imports consolidated and PlayIcon added.


82-91: LGTM - Playground CTA correctly uses ?tab=react parameter.

The tab parameter correctly uses "react" (not "component"), aligning with the type rename in this PR.

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

1-14: LGTM - Import organization improved.

Moving image imports to the top and consolidating related imports improves readability.


50-58: LGTM - Playground CTA section added with correct tab parameter.

apps/playground-web/src/app/bridge/bridge-widget/components/bridge-playground.tsx (2)

22-32: LGTM - defaultTab prop cleanly integrates with state initialization.

The prop type correctly matches the BridgeWidgetPlaygroundOptions.integrationType union, and the state initialization properly merges defaultTab with defaultOptions using a functional initializer to avoid re-computation on every render.


63-64: LGTM - React tab correctly uses "react" integration type.

Both the onClick handler and isActive check have been consistently updated from "component" to "react", aligning with the type rename.

apps/playground-web/src/app/bridge/bridge-widget/components/code.tsx (2)

28-28: LGTM - Language mapping correctly updated for React integration.

The lang prop now correctly maps "react" integration type to "tsx" syntax highlighting.


39-41: LGTM - Code generation path updated to use "react" integration type.

The condition correctly routes to getCode_ReactComponent when integrationType === "react", consistent with the type rename.

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

8-8: All usages of integrationType correctly updated to "react" from "component".

The rename has been consistently applied. Verification confirms:

  • types.ts line 8 defines integrationType: "iframe" | "script" | "react"
  • bridge-playground.tsx lines 63-64 set and compare against "react"
  • code.tsx lines 28, 39 check for integrationType === "react"
  • No remaining "component" string references exist in the bridge-widget directory
  • No localStorage or URL parameters rely on the old value
apps/playground-web/src/app/bridge/bridge-widget/page.tsx (2)

11-12: LGTM! Idiomatic TypeScript pattern for deriving union types.

The as const assertion combined with indexed access type creates a type-safe union from the array literal, ensuring a single source of truth for valid tab values.


44-44: LGTM! Proper integration with BridgeWidgetPlayground.

The validTab value (of type ValidTabs | undefined) correctly matches the defaultTab prop signature, enabling URL-driven initial tab selection while falling back to the component's internal default when no valid tab is provided.

@graphite-app
Copy link
Contributor

graphite-app bot commented Dec 18, 2025

Merge activity

<!--

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

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

## Notes for the reviewer

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

## How to test

Unit tests, playground, etc.

-->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on updating the `Bridge Widget` to enhance its integration options and improve user experience by adding a live playground feature. It modifies the integration types, updates the code logic, and introduces new UI components for better functionality.

### Detailed summary
- Changed `href` in `sidebar.tsx` for the Playground link.
- Updated `integrationType` options in `types.ts` to include "react".
- Adjusted code language conditions in `code.tsx` based on `integrationType`.
- Added `PlayIcon` and `ArticleIconCard` components in multiple `.mdx` files.
- Introduced a "Try it out" section in several `.mdx` files for the Playground.
- Modified the `Page` component to accept `searchParams` and determine the valid tab.
- Enhanced `BridgeWidgetPlayground` to manage URL updates based on the selected integration type.

> ✨ 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

* **New Features**
  * Playground now supports URL parameters to pre-select integration tabs and keeps the browser URL in sync when switching tabs
  * React integration tab standardized and labeled consistently with other tabs

* **Documentation**
  * Added "Try it out" call-to-action cards throughout docs linking to the live playground

* **Chores**
  * Sidebar playground link updated to point to the bridge-specific playground URL

<sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@graphite-app graphite-app bot force-pushed the 12-18-portal_add_bridge_widget_playground_links branch from 3687b8f to 9383ccd Compare December 18, 2025 18:08
@vercel vercel bot temporarily deployed to Preview – thirdweb-www December 18, 2025 18:08 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui December 18, 2025 18:08 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula December 18, 2025 18:08 Inactive
@graphite-app graphite-app bot merged commit 9383ccd into main Dec 18, 2025
25 checks passed
@graphite-app graphite-app bot deleted the 12-18-portal_add_bridge_widget_playground_links branch December 18, 2025 18:18
@vercel vercel bot temporarily deployed to Production – nebula December 18, 2025 18:18 Inactive
@vercel vercel bot temporarily deployed to Production – wallet-ui December 18, 2025 18:18 Inactive
@vercel vercel bot temporarily deployed to Production – thirdweb-www December 18, 2025 18:18 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Playground Changes involving the Playground codebase. Portal Involves changes to the Portal (docs) codebase.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants