Skip to content

Conversation

@joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Oct 7, 2025


PR-Codex overview

This PR focuses on improving the revalidation timing for certain page data and the active status of a project within the application. It reduces the revalidation period from one hour to thirty seconds for quicker updates.

Detailed summary

  • Added a revalidation period of 30 seconds for the ProjectOverviewPage.
  • Introduced a new property engineCloud in the type definition.
  • Updated the revalidate time for isProjectActive from 3600 seconds (1 hour) to 30 seconds.

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

Summary by CodeRabbit

  • New Features
    • Project status and sidebar data now auto-refresh roughly every 30 seconds, keeping information current without manual reloads.
    • Improved consistency of project activity indicators during transient errors for clearer status visibility.
    • Smoother dashboard experience as data updates in the background, reducing perceived staleness and the need to refresh pages.

@vercel vercel bot temporarily deployed to Preview – wallet-ui October 7, 2025 21:10 Inactive
@vercel
Copy link

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

@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 7, 2025 21:10 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula October 7, 2025 21:10 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 October 7, 2025 21:10 Inactive
@changeset-bot
Copy link

changeset-bot bot commented Oct 7, 2025

⚠️ No Changeset found

Latest commit: 3986b40

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

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

joaquim-verges commented Oct 7, 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 7, 2025

Walkthrough

Introduces a new engineCloud boolean in ActiveStatus, updates the default error object accordingly, and shortens cache/ISR revalidation intervals to 30 seconds for both isProjectActive and the project sidebar page via export const revalidate = 30.

Changes

Cohort / File(s) Summary
Analytics API module
apps/dashboard/src/@/api/analytics.ts
Added ActiveStatus.engineCloud:boolean; default error return now includes engineCloud:false; reduced isProjectActive revalidation from 3600s to 30s.
Project sidebar page ISR
apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/page.tsx
Exported revalidate = 30 to enable ISR revalidation every 30 seconds.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User
  participant P as Project Sidebar Page
  participant C as Cache (30s ISR)
  participant A as Analytics API (isProjectActive)

  U->>P: Request page
  P->>C: Check cached HTML (revalidate=30s)
  alt Cache fresh
    C-->>P: Serve cached page
    P-->>U: Return HTML
  else Cache stale or miss
    P->>A: Fetch isProjectActive (revalidate=30s)
    alt API success
      A-->>P: ActiveStatus { ..., engineCloud: boolean }
    else API error
      A-->>P: Default ActiveStatus { ..., engineCloud: false }
    end
    P->>C: Store regenerated HTML
    P-->>U: Return HTML
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
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.
Description Check ⚠️ Warning The PR description only includes the commented template and a PR-Codex overview without populating any of the required sections, leaving the title, notes for the reviewer, and testing instructions blank. Please complete the description template by adding a concise titled header in the prescribed format, filling in the “Notes for the reviewer” section with any important context, and providing clear steps under “How to test” so reviewers can validate the changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly and concisely summarizes the main changes by indicating both the addition of the engineCloud field and the reduction of revalidation time, and it follows the required prefix format.
✨ 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 _Dashboard_Add_engineCloud_to_ActiveStatus_and_reduce_revalidation_time_to_30_seconds

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

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.03%. Comparing base (23545cb) to head (3986b40).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8216   +/-   ##
=======================================
  Coverage   55.03%   55.03%           
=======================================
  Files         919      919           
  Lines       60569    60569           
  Branches     4126     4126           
=======================================
  Hits        33333    33333           
  Misses      27132    27132           
  Partials      104      104           
Flag Coverage Δ
packages 55.03% <ø> (ø)
🚀 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: 0

🧹 Nitpick comments (1)
apps/dashboard/src/@/api/analytics.ts (1)

493-493: Reduced revalidation time from 1 hour to 30 seconds.

The change provides fresher project activity data. The 30-second interval aligns with the page-level ISR revalidation in page.tsx.

Optional consideration: If the analytics service experiences increased load or rate limiting, consider adjusting this value or implementing request deduplication for concurrent calls.

📜 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 23545cb and 3986b40.

📒 Files selected for processing (2)
  • apps/dashboard/src/@/api/analytics.ts (3 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/page.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/(app)/team/[team_slug]/[project_slug]/(sidebar)/page.tsx
  • apps/dashboard/src/@/api/analytics.ts
**/*.{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)/page.tsx
  • apps/dashboard/src/@/api/analytics.ts
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)/page.tsx
  • apps/dashboard/src/@/api/analytics.ts
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)/team/[team_slug]/[project_slug]/(sidebar)/page.tsx
  • apps/dashboard/src/@/api/analytics.ts
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)/team/[team_slug]/[project_slug]/(sidebar)/page.tsx
🧠 Learnings (1)
📚 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 apps/{dashboard,playground-web}/**/*.{ts,tsx} : Configure `staleTime`/`cacheTime` in React Query based on freshness (default ≥ 60s)

Applied to files:

  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/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: Size
  • GitHub Check: Build Packages
  • GitHub Check: Lint Packages
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (3)
apps/dashboard/src/@/api/analytics.ts (2)

451-451: LGTM!

The addition of engineCloud to the ActiveStatus type is clean and consistent with the PR objectives.


483-483: LGTM!

The default error object correctly includes engineCloud: false, maintaining consistency with the updated ActiveStatus type definition.

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/page.tsx (1)

67-68: LGTM!

The 30-second ISR revalidation aligns perfectly with the updated cache timing for isProjectActive in analytics.ts, ensuring consistent data freshness across the page and its data sources.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 64.6 KB (0%) 1.3 s (0%) 123 ms (+136.89% 🔺) 1.5 s
thirdweb (cjs) 365.75 KB (0%) 7.4 s (0%) 526 ms (+8.42% 🔺) 7.9 s
thirdweb (minimal + tree-shaking) 5.73 KB (0%) 115 ms (0%) 51 ms (+2064.86% 🔺) 166 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 43 ms (+994.38% 🔺) 54 ms
thirdweb/react (minimal + tree-shaking) 19.13 KB (0%) 383 ms (0%) 60 ms (+2082.85% 🔺) 442 ms

@joaquim-verges joaquim-verges merged commit d7104f6 into main Oct 7, 2025
27 checks passed
@joaquim-verges joaquim-verges deleted the _Dashboard_Add_engineCloud_to_ActiveStatus_and_reduce_revalidation_time_to_30_seconds branch October 7, 2025 21:22
Copy link

@Ari4ka Ari4ka left a comment

Choose a reason for hiding this comment

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


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