Skip to content

Conversation

@MananTank
Copy link
Member

@MananTank MananTank commented Aug 18, 2025


PR-Codex overview

This PR focuses on refactoring the CreateNFTPage component in the create-nft-page.tsx file by removing redundant error handling, simplifying code structure, and retaining essential functionality related to NFT contract creation and deployment.

Detailed summary

  • Removed the import of reportAssetCreationFailed.
  • Simplified the contract deployment logic by restructuring try-catch blocks.
  • Kept essential error handling for sendAndConfirmTransaction.
  • Maintained functionality for adding contracts to the project.
  • Cleaned up code by removing unnecessary variables and comments.

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

Summary by CodeRabbit

  • New Features
    • None
  • Refactor
    • Streamlined NFT creation flows for a smoother, more deterministic ERC721/ERC1155 deployment, lazy minting, claim condition setup, and admin assignment with fewer interruption points.
    • Contracts are now linked to the project automatically in the background after deployment.
  • Chores
    • Improved post-deployment tracking by recording deployed contract details (address, chain, name, type, publisher) for better observability.

@vercel vercel bot temporarily deployed to Preview – thirdweb_playground August 18, 2025 18:43 Inactive
@vercel
Copy link

vercel bot commented Aug 18, 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 Aug 18, 2025 7:47pm
4 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
docs-v2 Skipped Skipped Aug 18, 2025 7:47pm
nebula Skipped Skipped Aug 18, 2025 7:47pm
thirdweb_playground Skipped Skipped Aug 18, 2025 7:47pm
wallet-ui Skipped Skipped Aug 18, 2025 7:47pm

@vercel vercel bot temporarily deployed to Preview – nebula August 18, 2025 18:43 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui August 18, 2025 18:43 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 August 18, 2025 18:43 Inactive
@changeset-bot
Copy link

changeset-bot bot commented Aug 18, 2025

⚠️ No Changeset found

Latest commit: e0ab3d5

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 Aug 18, 2025

Walkthrough

Removed try/catch error handling from NFT deployment, minting, claim-condition, and admin flows in the NFT creation page. Deployment now sets a contractAddress ref and emits reportContractDeployed, then enqueues background association with the project; imports simplified and utilities unchanged.

Changes

Cohort / File(s) Summary
NFT creation and deployment flow
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/nft/create-nft-page.tsx
Removed try/catch and parseError/reportAssetCreationFailed usage; deploy deterministically chooses ERC721 or ERC1155, stores contractAddress in contractAddressRef, calls reportContractDeployed with { address, chainId, contractName, deploymentType, publisher }, and calls addContractToProject.mutateAsync without per-call catch blocks. Simplified handlers: deploy, lazy mint, set claim conditions (ERC721/1155), set admins. Cleaned imports; utilities like transformSocialUrls unchanged.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CreateNFTPage
  participant Chain as Blockchain
  participant Project as ProjectService

  User->>CreateNFTPage: Deploy Contract (ERC721/1155)
  CreateNFTPage->>Chain: deployContract(ercType, params)
  Chain-->>CreateNFTPage: contractAddress
  CreateNFTPage->>CreateNFTPage: contractAddressRef.set(address)
  CreateNFTPage->>Project: addContractToProject.mutateAsync(address)
  CreateNFTPage->>Project: reportContractDeployed({address, chainId, contractName, deploymentType, publisher})

  User->>CreateNFTPage: Lazy Mint NFTs
  CreateNFTPage->>Chain: mintLazy(address, metadata)

  User->>CreateNFTPage: Set Claim Conditions
  CreateNFTPage->>Chain: setClaimConditions(address, conditions)

  User->>CreateNFTPage: Set Admins
  CreateNFTPage->>Chain: setAdmins(address, admins)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

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.
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 08-19-dashboard_fix_nft_collection_creation_error_tracked_twice

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Aug 18, 2025
Copy link
Member Author

MananTank commented Aug 18, 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 required 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.

@MananTank MananTank marked this pull request as ready for review August 18, 2025 18:43
@MananTank MananTank requested review from a team as code owners August 18, 2025 18:43
@MananTank MananTank changed the title Dashboard: Fix NFT Collection creation error tracked twice Dashboard: Fix NFT Collection creation error reported twice Aug 18, 2025
@codecov
Copy link

codecov bot commented Aug 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.54%. Comparing base (2c7d841) to head (e0ab3d5).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7868      +/-   ##
==========================================
- Coverage   56.54%   56.54%   -0.01%     
==========================================
  Files         904      904              
  Lines       58592    58592              
  Branches     4145     4144       -1     
==========================================
- Hits        33131    33129       -2     
- Misses      25355    25357       +2     
  Partials      106      106              
Flag Coverage Δ
packages 56.54% <ø> (-0.01%) ⬇️
see 1 file with indirect coverage changes
🚀 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 Aug 18, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 64.06 KB (+0.06% 🔺) 1.3 s (+0.06% 🔺) 234 ms (+165.98% 🔺) 1.6 s
thirdweb (cjs) 357.05 KB (0%) 7.2 s (0%) 666 ms (+10.08% 🔺) 7.9 s
thirdweb (minimal + tree-shaking) 5.73 KB (0%) 115 ms (0%) 77 ms (+1838.66% 🔺) 192 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 42 ms (+2457.44% 🔺) 52 ms
thirdweb/react (minimal + tree-shaking) 19.15 KB (0%) 383 ms (0%) 60 ms (+441.14% 🔺) 442 ms

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (4)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/nft/create-nft-page.tsx (4)

95-131: Deployment flow refactor looks solid; consider lazy-loading deploy helpers to keep bundle lean

The deterministic branch for 721 vs 1155 and param mapping look correct. To reduce initial bundle size in this client component, consider dynamic-importing the deploy helpers inside this async path.

Example refactor (inside handleContractDeploy):

// at the start of the function
const deploys = await import("thirdweb/deploys");

// then use:
if (ercType === "erc721") {
  contractAddress = await deploys.deployERC721Contract({ /* ... */ });
} else {
  contractAddress = await deploys.deployERC1155Contract({ /* ... */ });
}

This defers loading thirdweb/deploys until the user actually deploys a contract.


133-142: Make analytics non-blocking and set the ref before reporting

If analytics throws (network/ad-blockers), it could interrupt the flow. Set the ref first and wrap reporting in a no-op try/catch to avoid blocking deployment UX.

Apply this diff:

-    reportContractDeployed({
-      address: contractAddress,
-      chainId: Number(collectionInfo.chain),
-      contractName: contractType,
-      deploymentType: "asset",
-      publisher: "deployer.thirdweb.eth",
-    });
-
-    contractAddressRef.current = contractAddress;
+    contractAddressRef.current = contractAddress;
+    try {
+      reportContractDeployed({
+        address: contractAddress,
+        chainId: Number(collectionInfo.chain),
+        contractName: contractType,
+        deploymentType: "asset",
+        publisher: "deployer.thirdweb.eth",
+      });
+    } catch {
+      // ignore analytics errors
+    }

Please confirm reportContractDeployed expects contractName as the on-chain contract id (e.g., "DropERC721"/"DropERC1155") and not the generic "NFTCollection" used in some useTrack calls elsewhere.


336-339: Guard against empty admin updates to avoid a no-op multicall

If adminsToAdd is empty, encodedTxs is empty and multicall may be unnecessary or could throw depending on implementation. Skip sending the tx in that case.

Apply this diff:

-    await sendAndConfirmTransaction({
-      account,
-      transaction: tx,
-    });
+    if (encodedTxs.length > 0) {
+      await sendAndConfirmTransaction({
+        account,
+        transaction: tx,
+      });
+    }

143-151: Use mutate() for fire-and-forget to prevent unhandled promise rejections

The mutateAsync call returns a Promise that, when not handled, can result in uncaught errors in the console. Since this should run in the background, switch to the non-async version:

-    addContractToProject.mutateAsync({
+    addContractToProject.mutate({
       chainId: collectionInfo.chain,
       contractAddress: contractAddress,
       contractType: ercType === "erc721" ? "DropERC721" : "DropERC1155",
       deploymentType: "asset",
       projectId: props.projectId,
       teamId: props.teamId,
     });

The hook’s chainId parameter is already typed as a string, so there’s no need to coerce it with Number(...).

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • 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 2f627e1 and 980f97c.

📒 Files selected for processing (1)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/nft/create-nft-page.tsx (6 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{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

Files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/nft/create-nft-page.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/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/nft/create-nft-page.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/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/nft/create-nft-page.tsx
🧠 Learnings (4)
📚 Learning: 2025-06-10T00:50:20.795Z
Learnt from: MananTank
PR: thirdweb-dev/js#7315
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx:153-226
Timestamp: 2025-06-10T00:50:20.795Z
Learning: In apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx, the updateStatus function correctly expects a complete MultiStepState["status"] object. For pending states, { type: "pending" } is the entire status object. For error states, { type: "error", message: React.ReactNode } is the entire status object. The current code incorrectly spreads the entire step object instead of passing just the status object.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/nft/create-nft-page.tsx
📚 Learning: 2025-06-24T21:38:03.155Z
Learnt from: MananTank
PR: thirdweb-dev/js#7434
File: apps/dashboard/src/app/(app)/team/~/~/contract/[chain]/[contractAddress]/components/project-selector.tsx:62-76
Timestamp: 2025-06-24T21:38:03.155Z
Learning: In the project-selector.tsx component for contract imports, the addToProject.mutate() call is intentionally not awaited (fire-and-forget pattern) to allow immediate navigation to the contract page while the import happens in the background. This is a deliberate design choice to prioritize user experience.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/nft/create-nft-page.tsx
📚 Learning: 2025-06-13T13:50:08.622Z
Learnt from: MananTank
PR: thirdweb-dev/js#7332
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/overview/nft-drop-claim.tsx:170-178
Timestamp: 2025-06-13T13:50:08.622Z
Learning: In event-tracking (`useTrack`) calls across the dashboard, the team intentionally keeps `contractType` generic as `"NFTCollection"` even for ERC-721 drops; contract differentiation is handled via the `ercType` field instead.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/nft/create-nft-page.tsx
📚 Learning: 2025-06-10T00:46:00.514Z
Learnt from: MananTank
PR: thirdweb-dev/js#7315
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/form.ts:25-42
Timestamp: 2025-06-10T00:46:00.514Z
Learning: In NFT creation functions, the setClaimConditions function signatures are intentionally different between ERC721 and ERC1155. ERC721 setClaimConditions accepts the full CreateNFTFormValues, while ERC1155 setClaimConditions accepts a custom object with nftCollectionInfo and nftBatch parameters because it processes batches differently than the entire form data.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/nft/create-nft-page.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). (4)
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Size
  • GitHub Check: Lint Packages
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (4)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/nft/create-nft-page.tsx (4)

26-26: LGTM: Analytics import matches PR goal

Keeping only reportContractDeployed (and removing error-tracking duplications elsewhere) aligns with the objective to avoid double error events.


180-183: Direct await is fine; ensure UI surfaces errors

Removing try/catch here is fine if upstream UI handles promise rejections uniformly. Verify that CreateNFTPageUI or its caller surfaces transaction errors to the user.

Confirm that CreateNFTPageUI wraps these calls with error handling (toast/dialog/state) so rejections are user-visible.


220-223: Same note as above for claim conditions (ERC721)

Awaiting without local try/catch is fine if errors are handled upstream.


291-294: Same note as above for claim conditions (ERC1155 multicall)

LGTM. The multicall encoding is correct; ensuring upstream error surfacing is enough.

@graphite-app
Copy link
Contributor

graphite-app bot commented Aug 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 refactoring the `CreateNFTPage` component in `create-nft-page.tsx` to streamline contract deployment processes and improve error handling by removing redundant code and optimizing the reporting of contract deployment.

### Detailed summary
- Removed the import of `reportAssetCreationFailed`.
- Simplified the contract deployment logic for `erc721` and `erc1155`.
- Moved the `reportContractDeployed` call directly after contract creation.
- Eliminated redundant error handling in several transaction functions.
- Updated calls to `sendAndConfirmTransaction` to remove try-catch blocks.

> ✨ 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
  - None
- Refactor
  - Streamlined NFT creation flows for a smoother experience: deterministic ERC721/ERC1155 deployment, simplified lazy minting, claim condition setup, and admin assignment.
  - Contracts are automatically linked to the project in the background after deployment.
- Chores
  - Improved post-deployment tracking by recording deployed contract details (address, chain, name, type, publisher) for better observability.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@graphite-app graphite-app bot force-pushed the 08-19-dashboard_fix_nft_collection_creation_error_tracked_twice branch from 980f97c to e0ab3d5 Compare August 18, 2025 19:39
@vercel vercel bot temporarily deployed to Preview – nebula August 18, 2025 19:39 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 August 18, 2025 19:39 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground August 18, 2025 19:39 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui August 18, 2025 19:39 Inactive
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/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/nft/create-nft-page.tsx (3)

106-107: Guard against invalid BigInt conversions for royalties.

BigInt(sales.royaltyBps) will throw if royaltyBps is an empty string or otherwise invalid. Given form inputs can be blank or stringly-typed, consider a safe coerce with a default.

Apply this diff in both ERC721 and ERC1155 branches:

-          royaltyBps: BigInt(sales.royaltyBps),
+          royaltyBps: BigInt(sales.royaltyBps || 0),

Also applies to: 123-124


141-151: Run project-association truly in the background and avoid unhandled rejections.

mutateAsync returns a Promise. As-is, a failure here will generate an unhandled promise rejection (noise, potential UI test flakiness). Also, you already computed contractType; reuse it here.

Apply this diff:

-    addContractToProject.mutateAsync({
-      chainId: collectionInfo.chain,
-      contractAddress: contractAddress,
-      contractType: ercType === "erc721" ? "DropERC721" : "DropERC1155",
-      deploymentType: "asset",
-      projectId: props.projectId,
-      teamId: props.teamId,
-    });
+    void addContractToProject
+      .mutateAsync({
+        // ensure number if hook expects numeric chainId; otherwise keep as-is
+        chainId: Number(collectionInfo.chain),
+        contractAddress,
+        contractType, // reuse computed value
+        deploymentType: "asset",
+        projectId: props.projectId,
+        teamId: props.teamId,
+      })
+      .catch(() => {
+        // intentionally ignored (background task). Optionally log with a non-intrusive tracker.
+      });

If chainId is meant to remain a string in this hook, keep collectionInfo.chain and skip the Number(...).


95-95: Add explicit return types per repo TS guideline.

Minor nit to match the dashboard coding guidelines. Recommend adding explicit return types to these functions:

Example signatures:

async function handleContractDeploy(/* ... */): Promise<{ contractAddress: string }> { /* ... */ }
async function handleLazyMintNFTs(/* ... */): Promise<void> { /* ... */ }
async function handleSetClaimConditionsERC721(/* ... */): Promise<void> { /* ... */ }
async function handleSetClaimConditionsERC1155(/* ... */): Promise<void> { /* ... */ }
async function handleSetAdmins(/* ... */): Promise<void> { /* ... */ }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • 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 980f97c and e0ab3d5.

📒 Files selected for processing (1)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/nft/create-nft-page.tsx (6 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{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

Files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/nft/create-nft-page.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/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/nft/create-nft-page.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/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/nft/create-nft-page.tsx
🧠 Learnings (3)
📚 Learning: 2025-06-10T00:50:20.795Z
Learnt from: MananTank
PR: thirdweb-dev/js#7315
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx:153-226
Timestamp: 2025-06-10T00:50:20.795Z
Learning: In apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch-nft.tsx, the updateStatus function correctly expects a complete MultiStepState["status"] object. For pending states, { type: "pending" } is the entire status object. For error states, { type: "error", message: React.ReactNode } is the entire status object. The current code incorrectly spreads the entire step object instead of passing just the status object.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/nft/create-nft-page.tsx
📚 Learning: 2025-06-13T13:50:08.622Z
Learnt from: MananTank
PR: thirdweb-dev/js#7332
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/nft/overview/nft-drop-claim.tsx:170-178
Timestamp: 2025-06-13T13:50:08.622Z
Learning: In event-tracking (`useTrack`) calls across the dashboard, the team intentionally keeps `contractType` generic as `"NFTCollection"` even for ERC-721 drops; contract differentiation is handled via the `ercType` field instead.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/nft/create-nft-page.tsx
📚 Learning: 2025-06-10T00:46:00.514Z
Learnt from: MananTank
PR: thirdweb-dev/js#7315
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/form.ts:25-42
Timestamp: 2025-06-10T00:46:00.514Z
Learning: In NFT creation functions, the setClaimConditions function signatures are intentionally different between ERC721 and ERC1155. ERC721 setClaimConditions accepts the full CreateNFTFormValues, while ERC1155 setClaimConditions accepts a custom object with nftCollectionInfo and nftBatch parameters because it processes batches differently than the entire form data.

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/nft/create-nft-page.tsx
🧬 Code Graph Analysis (1)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/nft/create-nft-page.tsx (2)
apps/dashboard/src/@/analytics/report.ts (1)
  • reportContractDeployed (21-29)
packages/thirdweb/src/exports/thirdweb.ts (1)
  • sendAndConfirmTransaction (155-155)
⏰ 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: Size
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Unit Tests
  • GitHub Check: Build Packages
  • GitHub Check: Lint Packages
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (7)
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/create/nft/create-nft-page.tsx (7)

26-26: Good move: only keep success analytics (reportContractDeployed).

This aligns with the PR goal to avoid double-reporting failures and limits tracking to successful deploys.


133-139: Analytics emitted only after successful deploy — correct placement.

The payload matches reportContractDeployed’s expected shape. This should prevent duplicate error reports while preserving success tracking.


153-155: Helpful return shape.

Returning { contractAddress } keeps the UI step orchestration clear.


180-183: Lean path: let errors bubble to the UI.

Removing local try/catch for sendAndConfirmTransaction here simplifies control flow and avoids duplicate error tracking.


220-223: Same here — simplified error flow.

Awaiting and letting the caller handle errors is the right trade-off for consistent UX and telemetry.


291-294: Batch claim-conditions commit is clean.

Multicall + single confirmation with centralized error handling looks good.


336-339: Admin role grants: centralized confirmation, no redundant try/catch.

Looks good; transaction errors will be handled by the caller once.

@graphite-app graphite-app bot merged commit e0ab3d5 into main Aug 18, 2025
25 checks passed
@graphite-app graphite-app bot deleted the 08-19-dashboard_fix_nft_collection_creation_error_tracked_twice branch August 18, 2025 19:48
@vercel vercel bot temporarily deployed to Production – nebula August 18, 2025 19:48 Inactive
@vercel vercel bot temporarily deployed to Production – docs-v2 August 18, 2025 19:48 Inactive
@vercel vercel bot temporarily deployed to Production – wallet-ui August 18, 2025 19:48 Inactive
@vercel vercel bot temporarily deployed to Production – thirdweb_playground August 18, 2025 19: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