Skip to content

Conversation

@MananTank
Copy link
Member

@MananTank MananTank commented Aug 13, 2025


PR-Codex overview

This PR focuses on the removal of redundant code in the aggregateFn function across two files, specifically in the highlights-card.tsx components for different paths.

Detailed summary

  • Removed the if condition checking for key === "activeUsers" in the aggregateFn.
  • The logic for calculating the maximum active users is no longer present in both highlights-card.tsx files.

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

Summary by CodeRabbit

  • Bug Fixes
    • Standardized analytics aggregation across Highlights cards: all metrics, including Active Users, now show the total over the selected period (Active Users previously showed the peak). Expect updated figures in Team Analytics Highlights and Project Overview Highlights and consistent summary vs. detailed views.

@vercel
Copy link

vercel bot commented Aug 13, 2025

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

Project Deployment Preview Comments Updated (UTC)
thirdweb-www Ready Preview Comment Aug 13, 2025 6:56pm
4 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
docs-v2 ⬜️ Skipped Aug 13, 2025 6:56pm
nebula ⬜️ Skipped Aug 13, 2025 6:56pm
thirdweb_playground ⬜️ Skipped Aug 13, 2025 6:56pm
wallet-ui ⬜️ Skipped Aug 13, 2025 6:56pm

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

changeset-bot bot commented Aug 13, 2025

⚠️ No Changeset found

Latest commit: 22aad59

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

@MananTank MananTank marked this pull request as ready for review August 13, 2025 13:19
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 13, 2025

Walkthrough

Unified aggregation logic in two highlights card components by removing the activeUsers max special-case and always summing the time series values for the given key.

Changes

Cohort / File(s) Summary of Changes
Highlights aggregation unification
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/analytics/highlights-card.tsx, apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/overview/highlights-card.tsx
Removed conditional max for "activeUsers"; aggregateFn now sums timeSeriesData for all keys. No exported/public signature changes.

Sequence Diagram(s)

sequenceDiagram
  participant UI as HighlightsCard
  participant Agg as aggregateFn
  participant Data as timeSeriesData

  Note over UI: Old flow (conditional)
  UI->>Agg: aggregateFn(key, timeSeriesData)
  alt key == "activeUsers"
    Agg->>Data: compute max by key
    Agg-->>UI: return max
  else
    Agg->>Data: sum by key
    Agg-->>UI: return sum
  end

  Note over UI: New flow (unified)
  UI->>Agg: aggregateFn(key, timeSeriesData)
  Agg->>Data: sum by key (all keys)
  Agg-->>UI: return sum
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 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 36fde88 and 22aad59.

📒 Files selected for processing (2)
  • apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/analytics/highlights-card.tsx (0 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/overview/highlights-card.tsx (0 hunks)
💤 Files with no reviewable changes (2)
  • apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/analytics/highlights-card.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/overview/highlights-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: E2E Tests (pnpm, vite)
  • GitHub Check: Unit Tests
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: Size
  • 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-13-dashboard_fix_active_users_calculation_in_team_and_project_analytics

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

@MananTank MananTank requested review from a team as code owners August 13, 2025 13:19
@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Aug 13, 2025
Copy link
Member Author

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

@codecov
Copy link

codecov bot commented Aug 13, 2025

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7854   +/-   ##
=======================================
  Coverage   56.34%   56.34%           
=======================================
  Files         905      905           
  Lines       58834    58834           
  Branches     4150     4150           
=======================================
  Hits        33151    33151           
  Misses      25577    25577           
  Partials      106      106           
Flag Coverage Δ
packages 56.34% <ø> (ø)
🚀 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 changed the title Dashboard: Fix Active Users calculation in team and project analytics Dashboard: Fix Active Users calculation in team and project analytics charts Aug 13, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Aug 13, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 64.06 KB (0%) 1.3 s (0%) 410 ms (+89.76% 🔺) 1.7 s
thirdweb (cjs) 357.05 KB (0%) 7.2 s (0%) 1.7 s (+9.58% 🔺) 8.8 s
thirdweb (minimal + tree-shaking) 5.73 KB (0%) 115 ms (0%) 78 ms (+549.73% 🔺) 193 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 40 ms (+805.69% 🔺) 51 ms
thirdweb/react (minimal + tree-shaking) 19.15 KB (0%) 383 ms (0%) 46 ms (+50% 🔺) 429 ms

@graphite-app
Copy link
Contributor

graphite-app bot commented Aug 13, 2025

Merge activity

… charts (#7854)

<!--

## 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 modifying the `aggregateFn` function in two files related to analytics highlights cards, ensuring consistent functionality for aggregating data.

### Detailed summary
- In both `highlights-card.tsx` files, the `aggregateFn` function is updated to include logic for handling the `activeUsers` key.
- The function calculates the maximum value for `activeUsers` and sums values for other keys.

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

* **Bug Fixes**
  * Standardized analytics aggregation across Highlights cards. All metrics, including Active Users, now show the total over the selected period (previously Active Users showed the peak value). Expect updated figures in both Team Analytics Highlights and Project Overview Highlights, ensuring consistency between summary cards and detailed views.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@graphite-app graphite-app bot force-pushed the 08-13-dashboard_fix_active_users_calculation_in_team_and_project_analytics branch from 36fde88 to 22aad59 Compare August 13, 2025 18:47
@vercel vercel bot temporarily deployed to Preview – wallet-ui August 13, 2025 18:47 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground August 13, 2025 18:47 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula August 13, 2025 18:47 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 August 13, 2025 18:47 Inactive
@graphite-app graphite-app bot merged commit 22aad59 into main Aug 13, 2025
24 checks passed
@graphite-app graphite-app bot deleted the 08-13-dashboard_fix_active_users_calculation_in_team_and_project_analytics branch August 13, 2025 18:57
@vercel vercel bot temporarily deployed to Production – docs-v2 August 13, 2025 18:57 Inactive
@vercel vercel bot temporarily deployed to Production – thirdweb_playground August 13, 2025 18:57 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