Skip to content

Conversation

@MananTank
Copy link
Member

@MananTank MananTank commented Aug 9, 2025


PR-Codex overview

This PR focuses on refactoring the ContractRow and ContractPublisher components for improved type usage and code clarity, as well as implementing caching for contract fetching logic in the ContractCard component.

Detailed summary

  • Simplified ContractRow component by removing the ContractRowProps interface.
  • Refactored ContractPublisher to accept props directly instead of using an interface.
  • Replaced AccountProvider and related components with a simplified structure using Img and Blobbie.
  • Introduced unstable_cache for fetchPublishedContractVersion and resolvePublisherEnsAndAvatar to enhance performance.
  • Updated ContractCard to use cached fetching logic and modified the rendering of ContractPublisher to accept new props directly.

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

Summary by CodeRabbit

  • New Features

    • Improved performance and consistency for contract publisher information by introducing server-side caching for contract version data and publisher ENS details.
    • Enhanced publisher display with avatars and ENS names, including fallback visuals when no avatar is available.
  • Refactor

    • Streamlined the contract publisher display by replacing the previous component with a simplified implementation accepting explicit props.
    • Updated type definitions for improved code clarity without affecting user-facing behavior.
    • Simplified contract row component type annotations for cleaner code.
  • Chores

    • Minor import and type annotation adjustments for better maintainability.

@vercel
Copy link

vercel bot commented Aug 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 9, 2025 4:08pm
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Skipped (Inspect) Aug 9, 2025 4:08pm
nebula ⬜️ Skipped (Inspect) Aug 9, 2025 4:08pm
thirdweb_playground ⬜️ Skipped (Inspect) Aug 9, 2025 4:08pm
wallet-ui ⬜️ Skipped (Inspect) Aug 9, 2025 4:08pm

@vercel vercel bot temporarily deployed to Preview – wallet-ui August 9, 2025 13:32 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground August 9, 2025 13:32 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 August 9, 2025 13:32 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula August 9, 2025 13:32 Inactive
@changeset-bot
Copy link

changeset-bot bot commented Aug 9, 2025

⚠️ No Changeset found

Latest commit: a3909e1

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 9, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

This update introduces server-side caching for fetching published contract versions and resolving publisher ENS names and avatars in the contract card component. The ContractPublisher component is refactored to a simpler stateless function accepting explicit props, removing dependencies on account context and thirdweb components. Minor type annotation changes and import adjustments are also made.

Changes

Cohort / File(s) Change Summary
Contract Card Caching & Refactor
apps/dashboard/src/@/components/contracts/contract-card/contract-card.tsx
Adds server-side caching for fetching published contract versions and resolving publisher ENS/avatar using Next.js's unstable_cache. Refactors ContractCard to use cached data and renders ContractPublisher directly with explicit props. Updates imports and changes ContractCardProps from interface to type alias.
Contract Publisher Component Refactor
apps/dashboard/src/@/components/contracts/contract-card/contract-publisher.tsx
Refactors ContractPublisher from a React functional component using AccountProvider and thirdweb components to a simpler function receiving ensName, address, and ensAvatar as props. Removes loading skeletons, account context, and thirdweb account components. Uses custom Img component with fallback.
Contract Row Prop Type Simplification
apps/dashboard/src/app/(app)/(dashboard)/explore/components/contract-row/index.tsx
Removes explicit ContractRowProps interface and changes ContractRow prop type to an inline type annotation. No logic or rendering changes.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ContractCard (Server)
    participant Cache
    participant ENS Resolver
    participant Avatar Resolver

    User->>ContractCard (Server): Request contract card
    ContractCard->>Cache: Check for cached contract version
    alt Not cached
        ContractCard->>Contract API: Fetch published contract version
        Contract API-->>ContractCard: Return contract data
        ContractCard->>Cache: Store contract version (1hr)
    else Cached
        Cache-->>ContractCard: Return cached contract version
    end
    ContractCard->>Cache: Check for cached ENS & avatar
    alt Not cached
        ContractCard->>ENS Resolver: Resolve ENS name
        ContractCard->>Avatar Resolver: Resolve avatar
        ENS Resolver-->>ContractCard: ENS name
        Avatar Resolver-->>ContractCard: Avatar URL
        ContractCard->>Cache: Store ENS & avatar (1hr)
    else Cached
        Cache-->>ContractCard: Return cached ENS & avatar
    end
    ContractCard-->>User: Render card with publisher info
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 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.

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between fa5d022 and a3909e1.

📒 Files selected for processing (3)
  • apps/dashboard/src/@/components/contracts/contract-card/contract-card.tsx (5 hunks)
  • apps/dashboard/src/@/components/contracts/contract-card/contract-publisher.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/(dashboard)/explore/components/contract-row/index.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • apps/dashboard/src/app/(app)/(dashboard)/explore/components/contract-row/index.tsx
  • apps/dashboard/src/@/components/contracts/contract-card/contract-publisher.tsx
  • apps/dashboard/src/@/components/contracts/contract-card/contract-card.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: Size
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Unit Tests
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Build Packages
  • GitHub Check: Lint Packages
  • GitHub Check: Analyze (javascript)
✨ 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-09-cache_contractcard_speed_up__explore_pageload

🪧 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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
  • 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 src/utils.ts and explain its main purpose.
    • @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 comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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.

@MananTank MananTank marked this pull request as ready for review August 9, 2025 13:32
@MananTank MananTank requested review from a team as code owners August 9, 2025 13:32
@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Aug 9, 2025
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 Aug 9, 2025

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7822   +/-   ##
=======================================
  Coverage   56.33%   56.33%           
=======================================
  Files         905      905           
  Lines       58821    58821           
  Branches     4146     4146           
=======================================
  Hits        33137    33137           
  Misses      25578    25578           
  Partials      106      106           
Flag Coverage Δ
packages 56.33% <ø> (ø)
🚀 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.

@MananTank MananTank force-pushed the 08-09-cache_contractcard_speed_up__explore_pageload branch from 22c15e3 to 2f3dc54 Compare August 9, 2025 13:35
@vercel vercel bot temporarily deployed to Preview – nebula August 9, 2025 13:35 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 August 9, 2025 13:35 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui August 9, 2025 13:35 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground August 9, 2025 13:35 Inactive
@MananTank MananTank force-pushed the 08-09-cache_contractcard_speed_up__explore_pageload branch from 2f3dc54 to e871652 Compare August 9, 2025 13:37
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground August 9, 2025 13:37 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui August 9, 2025 13:37 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula August 9, 2025 13:37 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 August 9, 2025 13:37 Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 64.03 KB (0%) 1.3 s (0%) 169 ms (+259.6% 🔺) 1.5 s
thirdweb (cjs) 357.38 KB (0%) 7.2 s (0%) 181 ms (+28.83% 🔺) 7.4 s
thirdweb (minimal + tree-shaking) 5.72 KB (0%) 115 ms (0%) 106 ms (+1231.59% 🔺) 220 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 92 ms (+5443.96% 🔺) 102 ms
thirdweb/react (minimal + tree-shaking) 19.16 KB (0%) 384 ms (0%) 152 ms (+1305.02% 🔺) 535 ms

@MananTank MananTank force-pushed the 08-09-cache_contractcard_speed_up__explore_pageload branch from e871652 to 99ee331 Compare August 9, 2025 13:42
@vercel vercel bot temporarily deployed to Preview – nebula August 9, 2025 13:42 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground August 9, 2025 13:42 Inactive
@MananTank MananTank force-pushed the 08-09-cache_contractcard_speed_up__explore_pageload branch from 6c29564 to 057366a Compare August 9, 2025 15:14
@vercel vercel bot temporarily deployed to Preview – wallet-ui August 9, 2025 15:14 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 August 9, 2025 15:14 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground August 9, 2025 15:14 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula August 9, 2025 15:14 Inactive
@MananTank MananTank force-pushed the 08-09-cache_contractcard_speed_up__explore_pageload branch from 057366a to fa5d022 Compare August 9, 2025 15:25
@vercel vercel bot temporarily deployed to Preview – wallet-ui August 9, 2025 15:25 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 August 9, 2025 15:25 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula August 9, 2025 15:25 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground August 9, 2025 15:25 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: 2

🧹 Nitpick comments (2)
apps/dashboard/src/@/components/contracts/contract-card/contract-publisher.tsx (2)

19-19: Encode path segment to avoid malformed URLs

Protect against unexpected characters by encoding the dynamic segment.

-      href={`/${displayName}`}
+      href={`/${encodeURIComponent(displayName)}`}

33-33: Nit: remove extra space before text node

Minor: there’s a leading space inside the span.

-      <span className="text-xs"> {shortenIfAddress(displayName)}</span>
+      <span className="text-xs">{shortenIfAddress(displayName)}</span>
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 057366a and fa5d022.

📒 Files selected for processing (3)
  • apps/dashboard/src/@/components/contracts/contract-card/contract-card.tsx (5 hunks)
  • apps/dashboard/src/@/components/contracts/contract-card/contract-publisher.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/(dashboard)/explore/components/contract-row/index.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/dashboard/src/app/(app)/(dashboard)/explore/components/contract-row/index.tsx
  • apps/dashboard/src/@/components/contracts/contract-card/contract-card.tsx
🧰 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/@/components/contracts/contract-card/contract-publisher.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/@/components/contracts/contract-card/contract-publisher.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/@/components/contracts/contract-card/contract-publisher.tsx
🧠 Learnings (16)
📓 Common learnings
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Surface breaking changes prominently in PR descriptions
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.
Learnt from: MananTank
PR: thirdweb-dev/js#7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/direct-listings/shared-direct-listings-page.tsx:47-52
Timestamp: 2025-05-26T16:29:54.317Z
Learning: The `projectMeta` prop is not required for the server-rendered `ContractDirectListingsPage` component in the direct listings shared page, following the same pattern as other server components in the codebase where `projectMeta` is only needed for client components.
Learnt from: MananTank
PR: thirdweb-dev/js#7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/tokens/shared-page.tsx:41-48
Timestamp: 2025-05-26T16:28:50.772Z
Learning: The `projectMeta` prop is not required for the server-rendered `ContractTokensPage` component in the tokens shared page, unlike some other shared pages where it's needed for consistency.
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:82-90
Timestamp: 2025-06-13T13:03:41.732Z
Learning: The thirdweb `contract` object is serializable and can safely be used in contexts (e.g., React-Query keys) that require serializable values.
Learnt from: MananTank
PR: thirdweb-dev/js#7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/settings/shared-settings-page.tsx:29-39
Timestamp: 2025-05-27T20:10:47.245Z
Learning: MananTank prefers adding error handling (try-catch) directly inside utility functions like `shouldRenderNewPublicPage` rather than requiring callers to wrap the function calls in try-catch blocks. This centralizes error handling and benefits all callers automatically.
📚 Learning: 2025-05-26T16:29:54.317Z
Learnt from: MananTank
PR: thirdweb-dev/js#7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/direct-listings/shared-direct-listings-page.tsx:47-52
Timestamp: 2025-05-26T16:29:54.317Z
Learning: The `projectMeta` prop is not required for the server-rendered `ContractDirectListingsPage` component in the direct listings shared page, following the same pattern as other server components in the codebase where `projectMeta` is only needed for client components.

Applied to files:

  • apps/dashboard/src/@/components/contracts/contract-card/contract-publisher.tsx
📚 Learning: 2025-05-26T16:28:50.772Z
Learnt from: MananTank
PR: thirdweb-dev/js#7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/tokens/shared-page.tsx:41-48
Timestamp: 2025-05-26T16:28:50.772Z
Learning: The `projectMeta` prop is not required for the server-rendered `ContractTokensPage` component in the tokens shared page, unlike some other shared pages where it's needed for consistency.

Applied to files:

  • apps/dashboard/src/@/components/contracts/contract-card/contract-publisher.tsx
📚 Learning: 2025-05-29T00:46:09.063Z
Learnt from: jnsdls
PR: thirdweb-dev/js#7188
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components/accounts-count.tsx:15-15
Timestamp: 2025-05-29T00:46:09.063Z
Learning: In the accounts component at apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/components/accounts-count.tsx, the 3-column grid layout (md:grid-cols-3) is intentionally maintained even when rendering only one StatCard, as part of the design structure for this component.

Applied to files:

  • apps/dashboard/src/@/components/contracts/contract-card/contract-publisher.tsx
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to src/exports/react.native.ts : React Native specific exports are in `src/exports/react.native.ts`

Applied to files:

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

Applied to files:

  • apps/dashboard/src/@/components/contracts/contract-card/contract-publisher.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : Accept a typed `props` object and export a named function (`export function MyComponent()`).

Applied to files:

  • apps/dashboard/src/@/components/contracts/contract-card/contract-publisher.tsx
📚 Learning: 2025-08-07T20:43:21.864Z
Learnt from: MananTank
PR: thirdweb-dev/js#7812
File: apps/dashboard/src/app/(app)/(dashboard)/published-contract/components/token-banner.tsx:48-60
Timestamp: 2025-08-07T20:43:21.864Z
Learning: In the TokenBanner component at apps/dashboard/src/app/(app)/(dashboard)/published-contract/components/token-banner.tsx, the Link components use target="_blank" with internal application routes (starting with "/") to open pages in new tabs within the same application. These internal links do not require rel="noopener noreferrer" security attributes, which are only needed for external URLs.

Applied to files:

  • apps/dashboard/src/@/components/contracts/contract-card/contract-publisher.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{tsx,jsx} : For notices & skeletons rely on `AnnouncementBanner`, `GenericLoadingPage`, `EmptyStateCard`.

Applied to files:

  • apps/dashboard/src/@/components/contracts/contract-card/contract-publisher.tsx
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*client.tsx : Interactive UI that relies on hooks (`useState`, `useEffect`, React Query, wallet hooks).

Applied to files:

  • apps/dashboard/src/@/components/contracts/contract-card/contract-publisher.tsx
📚 Learning: 2025-06-17T18:30:52.976Z
Learnt from: MananTank
PR: thirdweb-dev/js#7356
File: apps/nebula/src/app/not-found.tsx:1-1
Timestamp: 2025-06-17T18:30:52.976Z
Learning: In the thirdweb/js project, the React namespace is available for type annotations (like React.FC) without needing to explicitly import React. This is project-specific configuration that differs from typical TypeScript/React setups.

Applied to files:

  • apps/dashboard/src/@/components/contracts/contract-card/contract-publisher.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/@/components/contracts/contract-card/contract-publisher.tsx
📚 Learning: 2025-06-13T13:03:41.732Z
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:82-90
Timestamp: 2025-06-13T13:03:41.732Z
Learning: The thirdweb `contract` object is serializable and can safely be used in contexts (e.g., React-Query keys) that require serializable values.

Applied to files:

  • apps/dashboard/src/@/components/contracts/contract-card/contract-publisher.tsx
📚 Learning: 2025-05-26T16:30:24.965Z
Learnt from: MananTank
PR: thirdweb-dev/js#7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/analytics/shared-analytics-page.tsx:33-39
Timestamp: 2025-05-26T16:30:24.965Z
Learning: In the thirdweb dashboard codebase, redirectToContractLandingPage function already handles execution termination internally (likely using Next.js redirect() which throws an exception), so no explicit return statement is needed after calling it.

Applied to files:

  • apps/dashboard/src/@/components/contracts/contract-card/contract-publisher.tsx
📚 Learning: 2025-05-26T16:31:02.480Z
Learnt from: MananTank
PR: thirdweb-dev/js#7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/claim-conditions/shared-claim-conditions-page.tsx:43-49
Timestamp: 2025-05-26T16:31:02.480Z
Learning: In the thirdweb dashboard codebase, when `redirectToContractLandingPage()` is called, an explicit return statement is not required afterward because the function internally calls Next.js's `redirect()` which throws an error to halt execution.

Applied to files:

  • apps/dashboard/src/@/components/contracts/contract-card/contract-publisher.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, vite)
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Size
  • GitHub Check: Unit Tests
  • GitHub Check: Build Packages
  • GitHub Check: Lint Packages
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
apps/dashboard/src/@/components/contracts/contract-card/contract-publisher.tsx (1)

20-21: Targeting _blank for internal routes is okay (per repo learning)

Opening internal routes in a new tab without rel is acceptable here; aligns with prior repo guidance.

@MananTank MananTank changed the title Cache ContractCard, speed up /explore pageload Add caching to ContractCard, speed up /explore pageload Aug 9, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Aug 9, 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 `ContractRow`, `ContractPublisher`, and `ContractCard` components to streamline their props and improve caching mechanisms for fetching contract data.

### Detailed summary
- Simplified `ContractRow` props by removing the interface.
- Refactored `ContractPublisher` to use props directly instead of an interface.
- Updated `ContractPublisher` to utilize `Img` and `Blobbie` for avatar rendering.
- Introduced caching for `fetchPublishedContractVersion` and `resolvePublisherEnsAndAvatar`.
- Changed how `ContractPublisher` is rendered in `ContractCard` to use new props structure.

> ✨ 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**
  * Improved performance and consistency for contract publisher information by introducing server-side caching for contract version data and publisher ENS details.
  * Enhanced publisher display with avatars and ENS names, including fallback visuals when no avatar is available.

* **Refactor**
  * Streamlined the contract publisher display by replacing the previous component with a simplified implementation accepting explicit props.
  * Updated type definitions for improved code clarity without affecting user-facing behavior.

* **Chores**
  * Minor import and type annotation adjustments for better maintainability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@graphite-app graphite-app bot force-pushed the 08-09-cache_contractcard_speed_up__explore_pageload branch from fa5d022 to a3909e1 Compare August 9, 2025 15:59
@vercel vercel bot temporarily deployed to Preview – wallet-ui August 9, 2025 15:59 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula August 9, 2025 15:59 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 August 9, 2025 15:59 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground August 9, 2025 15:59 Inactive
@graphite-app graphite-app bot merged commit a3909e1 into main Aug 9, 2025
24 checks passed
@graphite-app graphite-app bot deleted the 08-09-cache_contractcard_speed_up__explore_pageload branch August 9, 2025 16:08
@vercel vercel bot temporarily deployed to Production – docs-v2 August 9, 2025 16:08 Inactive
@vercel vercel bot temporarily deployed to Production – wallet-ui August 9, 2025 16:08 Inactive
@vercel vercel bot temporarily deployed to Production – nebula August 9, 2025 16:08 Inactive
@vercel vercel bot temporarily deployed to Production – thirdweb_playground August 9, 2025 16:08 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