refactor(org-profile): remove Usage Statistics from organization profile page#1260
Merged
jeanduplessis merged 4 commits intomainfrom Mar 20, 2026
Merged
refactor(org-profile): remove Usage Statistics from organization profile page#1260jeanduplessis merged 4 commits intomainfrom
jeanduplessis merged 4 commits intomainfrom
Conversation
Contributor
Author
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 files)
Reviewed by gpt-5.4-20260305 · 109,354 tokens |
…ion profile page Move input/output token breakdown to the dedicated usage details page, reducing database load on the default landing page after login.
Prevents chartSplitBy.tokenType from getting stuck in a true state when the user switches from Total Tokens to Input/Output Tokens or any other metric, since the Input/Output toggle only renders for the tokens metric.
Replace nested ternary for metric key conversion with a lookup map, use satisfies instead of as casts, and remove redundant alias/props.
6eed4c8 to
123465d
Compare
src/components/organizations/usage-details/hooks/useProcessedMetrics.ts
Outdated
Show resolved
Hide resolved
The summary card was averaging per-bucket averages (arithmetic mean), which diverges from the true overall average when request volume differs across time buckets. Now computes totalCost / totalRequests directly.
pandemicsyn
approved these changes
Mar 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OrganizationUsageSummaryCard) from the organization profile page (OrganizationDashboard), which is the default landing page after login. TheusageStatstRPC endpoint queriesmicrodollar_usagewith a 30-day SUM/COUNT aggregation on every page load, adding unnecessary database pressure for the most-visited page./organizations/[id]/usage-details), which previously only showed a combined "Total Tokens" figure. This ensures the token breakdown data that was on the profile page is still accessible.input_tokens,output_tokens).Verification
tsgo --noEmit --incremental false— passes with no errorseslinton all 8 changed files — no warnings or errorsprettier --check— all files formattedVisual Changes
usageStatsqueryReviewer Notes
OrganizationUsageSummaryCardcomponent,useOrganizationUsageStatshook,UsageStatsSchema, and theusageStatstRPC procedure are intentionally kept becauseOrganizationAdminDashboardstill renders the card.lg:grid-cols-5tolg:grid-cols-4 xl:grid-cols-7to accommodate 7 cards.