-
Notifications
You must be signed in to change notification settings - Fork 619
Dashboard: Fix Active Users calculation in team and project analytics charts #7854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dashboard: Fix Active Users calculation in team and project analytics charts #7854
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
WalkthroughUnified 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
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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
💤 Files with no reviewable changes (2)
⏰ 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)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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 Report✅ All modified and coverable lines are covered by tests. 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
🚀 New features to boost your workflow:
|
size-limit report 📦
|
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 -->
36fde88 to
22aad59
Compare

PR-Codex overview
This PR focuses on the removal of redundant code in the
aggregateFnfunction across two files, specifically in thehighlights-card.tsxcomponents for different paths.Detailed summary
ifcondition checking forkey === "activeUsers"in theaggregateFn.highlights-card.tsxfiles.Summary by CodeRabbit