Skip to content

Conversation

@MananTank
Copy link
Member

@MananTank MananTank commented Oct 9, 2025


PR-Codex overview

This PR enhances the TokenIdPage component by integrating Suspense for loading states and adjusting the layout for better user experience during data fetching.

Detailed summary

  • Added Suspense to handle loading states more effectively.
  • Modified the loading spinner's layout by adding padding (py-20).
  • Wrapped the tab rendering logic in Suspense, providing a fallback UI while loading.

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

Summary by CodeRabbit

  • New Features

    • Added a loading experience for NFT tab content with a visible fallback (spinner and loading text) while content loads.
    • Improves responsiveness when switching tabs by deferring heavy tab content until it's ready.
  • Style

    • Increased vertical padding for the pending NFT state to enhance visual spacing and readability.

@vercel
Copy link

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

@linear
Copy link

linear bot commented Oct 9, 2025

@vercel vercel bot temporarily deployed to Preview – nebula October 9, 2025 16:45 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 9, 2025 16:45 Inactive
@changeset-bot
Copy link

changeset-bot bot commented Oct 9, 2025

⚠️ No Changeset found

Latest commit: edf3aad

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 9, 2025 16:45 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 October 9, 2025 16:45 Inactive
@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Oct 9, 2025
@MananTank MananTank marked this pull request as ready for review October 9, 2025 16:45
@MananTank MananTank requested review from a team as code owners October 9, 2025 16:45
Copy link
Member Author

MananTank commented Oct 9, 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 9, 2025

Walkthrough

Adds a React Suspense boundary around the NFT token page’s tab content with a local fallback loader, moves per-tab rendering inside that Suspense boundary, and adjusts the pending-NFT loading container vertical padding.

Changes

Cohort / File(s) Summary
NFT token page — Suspense + loading UI
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/token-id.tsx
Introduces React Suspense around tab content with a fallback (spinner + text), relocates inline tab-content rendering into the Suspense boundary, and adds py-20 to the pending NFT loading container. No public API changes.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant TokenIdPage
    participant SuspenseBoundary as Suspense (Tab Area)
    participant Fallback as Local Fallback Loader
    participant TabContent as Active Tab Renderer

    User->>TokenIdPage: navigate / switch tab
    TokenIdPage->>SuspenseBoundary: render tab area
    alt data / child pending
        SuspenseBoundary->>Fallback: show localized spinner + text
    else ready
        SuspenseBoundary->>TabContent: render active tab content
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description retains the template comments without filling in the required title, reviewer notes, and testing instructions sections and only includes an auto-generated PR-Codex overview instead of the mandated structure. Please complete the repository description template by adding the PR title in the specified format, notes for reviewers, and detailed steps for testing.
✅ Passed checks (4 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title clearly identifies the issue being addressed by referencing BLD-396 and concisely summarizes the fix of preventing a full page loading indicator when switching tabs on the /nfts/ Dashboard page.
Linked Issues Check ✅ Passed The PR implements the objective from BLD-396 by wrapping the tab content in React Suspense with a fallback loading spinner and adjusting padding to prevent a fullscreen indicator when switching tabs, satisfying the linked issue requirements.
Out of Scope Changes Check ✅ Passed All modifications are confined to the TokenIdPage component and pertain solely to improving loading state handling for tab switching, with no unrelated or extraneous changes detected.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ 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-09-_bld-396_dashboard_fix_changing_tabs_in__nfts__id_page_showing_full_page_loading_indicator

📜 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 e847c55 and edf3aad.

📒 Files selected for processing (1)
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/token-id.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/token-id.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, webpack)
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: Size
  • GitHub Check: Build Packages
  • GitHub Check: Unit Tests
  • GitHub Check: Lint Packages
  • GitHub Check: Analyze (javascript)

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

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8224   +/-   ##
=======================================
  Coverage   55.02%   55.02%           
=======================================
  Files         919      919           
  Lines       60583    60583           
  Branches     4126     4126           
=======================================
  Hits        33338    33338           
  Misses      27141    27141           
  Partials      104      104           
Flag Coverage Δ
packages 55.02% <ø> (ø)
🚀 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 10-09-_bld-396_dashboard_fix_changing_tabs_in__nfts__id_page_showing_full_page_loading_indicator branch from e246d14 to 8dc86dd Compare October 9, 2025 16:48
@vercel vercel bot temporarily deployed to Preview – docs-v2 October 9, 2025 16:48 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui October 9, 2025 16:48 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula October 9, 2025 16:48 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 9, 2025 16:48 Inactive
@MananTank MananTank changed the title [BLD-396] Dashboard: Fix changing tabs in /nfts/<id> page showing full page loading indicator [BLD-396] Dashboard: Fix changing tabs in /nfts/<id> page shows full page loading indicator Oct 9, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 9, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 64.51 KB (0%) 1.3 s (0%) 198 ms (+50.32% 🔺) 1.5 s
thirdweb (cjs) 365.79 KB (0%) 7.4 s (0%) 1.3 s (-2.28% 🔽) 8.6 s
thirdweb (minimal + tree-shaking) 5.73 KB (0%) 115 ms (0%) 49 ms (+512.11% 🔺) 164 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 41 ms (+534.81% 🔺) 52 ms
thirdweb/react (minimal + tree-shaking) 19.13 KB (0%) 383 ms (0%) 59 ms (+617.28% 🔺) 442 ms

@graphite-app graphite-app bot changed the base branch from bld-395 to graphite-base/8224 October 9, 2025 18:31
@graphite-app graphite-app bot force-pushed the graphite-base/8224 branch from 511aa04 to fe940b3 Compare October 9, 2025 18:43
@graphite-app graphite-app bot force-pushed the 10-09-_bld-396_dashboard_fix_changing_tabs_in__nfts__id_page_showing_full_page_loading_indicator branch from 8dc86dd to bcd7141 Compare October 9, 2025 18:43
@vercel vercel bot temporarily deployed to Preview – docs-v2 October 9, 2025 18:43 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 9, 2025 18:43 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui October 9, 2025 18:43 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula October 9, 2025 18:43 Inactive
@graphite-app graphite-app bot changed the base branch from graphite-base/8224 to main October 9, 2025 18:43
@graphite-app graphite-app bot force-pushed the 10-09-_bld-396_dashboard_fix_changing_tabs_in__nfts__id_page_showing_full_page_loading_indicator branch from bcd7141 to e847c55 Compare October 9, 2025 18:43
@vercel vercel bot temporarily deployed to Preview – nebula October 9, 2025 18:43 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 9, 2025 18:43 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 October 9, 2025 18:43 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui October 9, 2025 18:43 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 (1)
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/token-id.tsx (1)

61-68: Prefer explicit function declaration with return type.

The coding guidelines recommend explicit function declarations and return types for TypeScript. Consider refactoring to:

-export const TokenIdPage: React.FC<TokenIdPageProps> = ({
-  contract,
-  tokenId,
-  isErc721,
-  isLoggedIn,
-  accountAddress,
-  projectMeta,
-}) => {
+export function TokenIdPage({
+  contract,
+  tokenId,
+  isErc721,
+  isLoggedIn,
+  accountAddress,
+  projectMeta,
+}: TokenIdPageProps): React.ReactElement {

As per coding guidelines.

📜 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 fe940b3 and e847c55.

📒 Files selected for processing (1)
  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/token-id.tsx (3 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/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/token-id.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)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/token-id.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)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/token-id.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/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/token-id.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/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/token-id.tsx
🧠 Learnings (2)
📚 Learning: 2025-06-18T04:27:16.172Z
Learnt from: jnsdls
PR: thirdweb-dev/js#7365
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx:16-17
Timestamp: 2025-06-18T04:27:16.172Z
Learning: Next.js Link component supports external URLs without throwing errors. When used with absolute URLs (like https://...), it behaves like a regular anchor tag without client-side routing, but does not cause runtime crashes or errors as previously believed.

Applied to files:

  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/token-id.tsx
📚 Learning: 2025-06-18T04:30:04.326Z
Learnt from: jnsdls
PR: thirdweb-dev/js#7365
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx:16-17
Timestamp: 2025-06-18T04:30:04.326Z
Learning: Next.js Link component fully supports both internal and external URLs and works appropriately with all standard anchor attributes including target="_blank", rel="noopener noreferrer", etc. Using Link for external URLs is completely appropriate and recommended.

Applied to files:

  • apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/token-id.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). (2)
  • GitHub Check: Size
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (3)
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/token-id.tsx (3)

5-5: LGTM!

The Suspense import is correctly added to support the new loading boundary below.


92-92: Question: Is the vertical padding necessary here?

The container already has h-[400px] with items-center for vertical centering. Adding py-20 seems redundant and may not provide visual benefit since the spinner is already centered. Was this added to match a specific design requirement?


182-201: Verify Suspense usage and optimize active tab rendering.

Suspense only works if child components suspend (e.g., via React.lazy or throw promises). Confirm each tab’s children uses a suspense-aware pattern; otherwise the fallback spinner will never display.

Replace the tabs.map block with a single lookup:

- <Suspense fallback={...}>
-   {tabs.map(tb =>
-     tb.title === tab && (
-       <div className="w-full" key={tb.title}>
-         {tb.children}
-       </div>
-     )
-   )}
- </Suspense>
+ <Suspense fallback={...}>
+   {(() => {
+     const active = tabs.find(tb => tb.title === tab);
+     return active ? (
+       <div className="w-full" key={active.title}>
+         {active.children}
+       </div>
+     ) : null;
+   })()}
+ </Suspense>

@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 9, 2025

Merge activity

…page loading indicator (#8224)

<!--

## 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 enhances the `TokenIdPage` component by introducing `Suspense` for improved loading state handling and adjusting the layout of the loading spinner.

### Detailed summary
- Added `Suspense` for handling loading states.
- Updated the loading spinner layout with additional padding (`py-20`).
- Wrapped the tab rendering logic within the `Suspense` component for better user experience during data fetching.

> ✨ 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
  - Introduced a loading experience for NFT tab content using Suspense, providing a fallback UI while content loads.
  - Improves responsiveness when switching tabs by deferring heavy content until ready.

- Style
  - Increased vertical padding for the pending NFT state to enhance visual spacing and readability.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@graphite-app graphite-app bot force-pushed the 10-09-_bld-396_dashboard_fix_changing_tabs_in__nfts__id_page_showing_full_page_loading_indicator branch from e847c55 to edf3aad Compare October 9, 2025 22:14
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 9, 2025 22:14 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula October 9, 2025 22:14 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui October 9, 2025 22:14 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 October 9, 2025 22:14 Inactive
@graphite-app graphite-app bot merged commit edf3aad into main Oct 9, 2025
24 checks passed
@graphite-app graphite-app bot deleted the 10-09-_bld-396_dashboard_fix_changing_tabs_in__nfts__id_page_showing_full_page_loading_indicator branch October 9, 2025 22:23
@vercel vercel bot temporarily deployed to Production – docs-v2 October 9, 2025 22:23 Inactive
@vercel vercel bot temporarily deployed to Production – nebula October 9, 2025 22:23 Inactive
@vercel vercel bot temporarily deployed to Production – wallet-ui October 9, 2025 22:23 Inactive
@vercel vercel bot temporarily deployed to Production – thirdweb_playground October 9, 2025 22:23 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