Skip to content

Conversation

@MananTank
Copy link
Member

@MananTank MananTank commented Oct 17, 2025


PR-Codex overview

This PR simplifies the TWAutoConnect component by removing the optional accountAbstraction prop and streamlining its usage in the BridgeProviders component.

Detailed summary

  • Removed the accountAbstraction prop from the TWAutoConnect function in autoconnect.tsx.
  • Updated the return statement in TWAutoConnect to only pass the client prop.
  • Added the TWAutoConnect component usage in Providers.client.tsx with the thirdwebClient.

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

Summary by CodeRabbit

  • Refactor
    • Simplified the auto-connect component API so it only requires the client, removing an unnecessary configuration prop.
    • Integrated the streamlined auto-connect into the app provider stack so wallet/client initialization occurs earlier during startup.

@vercel vercel bot temporarily deployed to Preview – docs-v2 October 17, 2025 13:35 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 17, 2025 13:35 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula October 17, 2025 13:35 Inactive
@changeset-bot
Copy link

changeset-bot bot commented Oct 17, 2025

⚠️ No Changeset found

Latest commit: 12082fd

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

This PR includes no changesets

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

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

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

@vercel vercel bot temporarily deployed to Preview – wallet-ui October 17, 2025 13:35 Inactive
@vercel
Copy link

vercel bot commented Oct 17, 2025

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

Project Deployment Preview Comments Updated (UTC)
thirdweb-www Ready Ready Preview Comment Oct 17, 2025 4:46pm
4 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
docs-v2 Skipped Skipped Oct 17, 2025 4:46pm
nebula Skipped Skipped Oct 17, 2025 4:46pm
thirdweb_playground Skipped Skipped Oct 17, 2025 4:46pm
wallet-ui Skipped Skipped Oct 17, 2025 4:46pm

💡 Enable Vercel Agent with $100 free credit for automated AI reviews

@MananTank MananTank marked this pull request as ready for review October 17, 2025 13:35
@MananTank MananTank requested review from a team as code owners October 17, 2025 13:35
@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Oct 17, 2025
Copy link
Member Author

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 17, 2025

Walkthrough

TWAutoConnect's API was simplified to accept only a client prop (removed optional accountAbstraction). A thirdwebClient is created via getClientThirdwebClient() and <TWAutoConnect client={thirdwebClient} /> is injected into the bridge provider tree inside ThirdwebProvider.

Changes

Cohort / File(s) Summary
TWAutoConnect API Simplification
apps/dashboard/src/app/(app)/components/autoconnect.tsx
Removed accountAbstraction from the component signature and its prop passing; removed SmartWalletOptions import. Component now accepts only client.
Bridge Provider Integration
apps/dashboard/src/app/bridge/components/client/Providers.client.tsx
Added imports for getClientThirdwebClient and TWAutoConnect; created thirdwebClient = getClientThirdwebClient() and injected <TWAutoConnect client={thirdwebClient} /> inside ThirdwebProvider (before ThemeProvider).

Sequence Diagram(s)

sequenceDiagram
    participant App as App Root
    participant Providers as Providers.client
    participant ThirdwebP as ThirdwebProvider
    participant TWAuto as TWAutoConnect
    participant Theme as ThemeProvider
    participant Children as App Children

    App->>Providers: render Providers.client
    Providers->>ThirdwebP: <ThirdwebProvider client={thirdwebClient}>
    ThirdwebP->>TWAuto: render <TWAutoConnect client={thirdwebClient}>
    note right of TWAuto #D6EAF8: Auto-connect logic runs\n(using provided client)
    ThirdwebP->>Theme: render <ThemeProvider>
    Theme->>Children: render app children
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description fails to follow the required template structure. While the description includes an auto-generated PR-Codex overview that summarizes the changes, it does not fill in the critical template sections: the title format section is left as a template comment with no content, no issue tag (TEAM-0000 format) is provided, the "Notes for the reviewer" section contains only template text, and the "How to test" section is completely absent. This leaves the description largely incomplete according to the repository's template requirements.
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 PR title "Dashboard: Fix autoconnect in /bridge page" is directly related to the main changes in the changeset. The summary shows that TWAutoConnect was simplified and integrated into the bridge page's Providers component, which is exactly what the title conveys. The title is concise, specific, and clear enough for teammates to quickly understand the primary objective of this fix without being overly detailed.
✨ 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 10-17-dashboard_fix_autoconnect_in__bridge_page

📜 Recent 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 a90569d and 12082fd.

📒 Files selected for processing (2)
  • apps/dashboard/src/app/(app)/components/autoconnect.tsx (1 hunks)
  • apps/dashboard/src/app/bridge/components/client/Providers.client.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/dashboard/src/app/(app)/components/autoconnect.tsx
  • apps/dashboard/src/app/bridge/components/client/Providers.client.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). (5)
  • GitHub Check: Unit Tests
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: Size
  • GitHub Check: Lint Packages
  • GitHub Check: Analyze (javascript)

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.

@codecov
Copy link

codecov bot commented Oct 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.89%. Comparing base (5ff6063) to head (12082fd).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8271   +/-   ##
=======================================
  Coverage   54.89%   54.89%           
=======================================
  Files         919      919           
  Lines       60622    60622           
  Branches     4126     4126           
=======================================
  Hits        33278    33278           
  Misses      27242    27242           
  Partials      102      102           
Flag Coverage Δ
packages 54.89% <ø> (ø)
🚀 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.

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

📜 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 3db3982 and d2a5e5c.

📒 Files selected for processing (2)
  • apps/dashboard/src/app/(app)/components/autoconnect.tsx (1 hunks)
  • apps/dashboard/src/app/bridge/components/client/Providers.client.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{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:

  • apps/dashboard/src/app/bridge/components/client/Providers.client.tsx
  • apps/dashboard/src/app/(app)/components/autoconnect.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)

Files:

  • apps/dashboard/src/app/bridge/components/client/Providers.client.tsx
  • apps/dashboard/src/app/(app)/components/autoconnect.tsx
apps/{dashboard,playground-web}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

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
Use NavLink for internal navigation with automatic active states in dashboard and playground apps
Use Tailwind CSS only – no inline styles or CSS modules
Use cn() from @/lib/utils for conditional class logic
Use design system tokens (e.g., bg-card, border-border, text-muted-foreground)
Server Components (Node edge): Start files with import "server-only";
Client Components (browser): Begin files with 'use client';
Always call getAuthToken() to retrieve JWT from cookies on server side
Use Authorization: Bearer header – never embed tokens in URLs
Return typed results (e.g., Project[], User[]) – avoid any
Wrap client-side data fetching calls in React Query (@tanstack/react-query)
Use descriptive, stable queryKeys for React Query 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

Files:

  • apps/dashboard/src/app/bridge/components/client/Providers.client.tsx
  • apps/dashboard/src/app/(app)/components/autoconnect.tsx
apps/{dashboard,playground}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

apps/{dashboard,playground}/**/*.{ts,tsx}: Import UI primitives from @/components/ui/_ (e.g., Button, Input, Tabs, Card)
Use NavLink for internal navigation to get active state handling
Use Tailwind CSS for styling; no inline styles
Merge class names with cn() from @/lib/utils for conditional classes
Stick to design tokens (e.g., bg-card, border-border, text-muted-foreground)
Server Components must start with import "server-only"; use next/headers, server‑only env, heavy data fetching, and redirect() where appropriate
Client Components must start with 'use client'; handle interactivity with hooks and browser APIs
Server-side data fetching: call getAuthToken() from cookies, send Authorization: Bearer <token> header, and return typed results (avoid any)
Client-side data fetching: wrap calls in React Query with descriptive, stable queryKeys and set sensible staleTime/cacheTime (≥ 60s default); keep tokens secret via internal routes or server actions
Do not import posthog-js in server components (client-side only)

Files:

  • apps/dashboard/src/app/bridge/components/client/Providers.client.tsx
  • apps/dashboard/src/app/(app)/components/autoconnect.tsx
apps/{dashboard,playground}/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Expose a className prop on the root element of every component

Files:

  • apps/dashboard/src/app/bridge/components/client/Providers.client.tsx
  • apps/dashboard/src/app/(app)/components/autoconnect.tsx
🧠 Learnings (2)
📚 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:

  • apps/dashboard/src/app/bridge/components/client/Providers.client.tsx
  • apps/dashboard/src/app/(app)/components/autoconnect.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:

  • apps/dashboard/src/app/bridge/components/client/Providers.client.tsx
🧬 Code graph analysis (2)
apps/dashboard/src/app/bridge/components/client/Providers.client.tsx (1)
apps/dashboard/src/app/(app)/components/autoconnect.tsx (1)
  • TWAutoConnect (5-7)
apps/dashboard/src/app/(app)/components/autoconnect.tsx (1)
packages/thirdweb/src/exports/thirdweb.ts (1)
  • ThirdwebClient (25-25)
⏰ 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: Build Packages
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: Lint Packages
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Unit Tests
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
apps/dashboard/src/app/bridge/components/client/Providers.client.tsx (2)

13-13: LGTM! Autoconnect integration looks correct.

The TWAutoConnect component is properly placed within the ThirdwebProvider hierarchy and uses the simplified API with just the client prop.


5-8: Restructure to avoid .client file importing from .server file.

The import pattern violates Next.js conventions: thirdweb-client.client.ts (a .client file) should not import from thirdweb.server.ts (a .server file). This can confuse the rendering model and cause bundler issues.

Move getConfiguredThirdwebClient() logic into thirdweb-client.client.ts directly, or restructure so client-side initialization doesn't depend on server-specific modules. The getVercelEnv() call is safe, but the module pattern itself needs fixing.

⛔ Skipped due to 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/**/components/*.client.tsx : Client components must start with `'use client';` before imports.
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.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 17, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 64.51 KB (0%) 1.3 s (0%) 317 ms (+93.19% 🔺) 1.7 s
thirdweb (cjs) 365.68 KB (0%) 7.4 s (0%) 1.6 s (+6.1% 🔺) 8.9 s
thirdweb (minimal + tree-shaking) 5.73 KB (0%) 115 ms (0%) 146 ms (+1577.71% 🔺) 261 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 68 ms (+1452.06% 🔺) 79 ms
thirdweb/react (minimal + tree-shaking) 19.13 KB (0%) 383 ms (0%) 90 ms (+970.34% 🔺) 473 ms

@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 17, 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 simplifies the `TWAutoConnect` component by removing the optional `accountAbstraction` prop and streamlining its usage in the `BridgeProviders` component.

### Detailed summary
- Removed the `accountAbstraction` prop from the `TWAutoConnect` component.
- Updated the `TWAutoConnect` function signature to only require the `client` prop.
- Integrated `TWAutoConnect` into the `BridgeProviders` component, passing the `thirdwebClient`.

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

* **Refactor**
  * Streamlined the auto-connect component API so it only requires the client, removing an unused configuration parameter.
  * Integrated the simplified auto-connect into the app provider stack to ensure automatic wallet/client initialization earlier in the startup sequence.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@graphite-app graphite-app bot merged commit 12082fd into main Oct 17, 2025
24 checks passed
@graphite-app graphite-app bot deleted the 10-17-dashboard_fix_autoconnect_in__bridge_page branch October 17, 2025 16:48
@vercel vercel bot temporarily deployed to Production – wallet-ui October 17, 2025 16:48 Inactive
@vercel vercel bot temporarily deployed to Production – thirdweb_playground October 17, 2025 16:48 Inactive
@vercel vercel bot temporarily deployed to Production – docs-v2 October 17, 2025 16:48 Inactive
@vercel vercel bot temporarily deployed to Production – nebula October 17, 2025 16:48 Inactive
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants