feat(site): merge Limits + Usage into unified Spend page#23993
Merged
DanielleMaywood merged 0 commit intoApr 7, 2026
Conversation
2647970 to
e866d28
Compare
23e5642 to
132e13e
Compare
e866d28 to
10e5668
Compare
c85a227 to
c10e80a
Compare
10e5668 to
ca81cdd
Compare
c10e80a to
514ed86
Compare
ca81cdd to
2ad4c35
Compare
This was referenced Apr 7, 2026
2ad4c35 to
0d52625
Compare
514ed86 to
0d52625
Compare
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.
PR 4/4 in a stack to unify agent settings pages.
What
Merges the separate Limits and Usage pages into a single Spend page with three
CollapsibleSectioncards.Why
The Limits and Usage pages were closely related — limits configure spend caps, usage shows who is spending against those caps — but lived on separate routes with no cross-references. Combining them into a single "Spend" page gives admins a single place to configure limits and immediately see the effect on usage, without navigating between tabs.
Changes
AgentSettingsSpendPage— container component. Usesmutate()(notmutateAsync) for all mutations so the view component never deals with promises or try/catch. Upsert success callbacks (form resets) are passed viaonSuccessin the mutation call options rather than awaited in the view.AgentSettingsSpendPageView— ~900 line view with 3 CollapsibleSection cards:DefaultLimitController(render-prop) to isolate form state so the card can remount viakeywithout losing parent state.ChatCostSummaryViewfor per-user breakdowns.SpendDrillInView— extracted from the main view into its own component to reduce nesting. Handles the back button, user profile card, loading/error states, andChatCostSummaryViewrendering. Useskey={selectedUser.id}to remountChatCostSummaryViewwhen the selected user changes, which naturally resets internal pagination state.formatUsageDateRange— added toutils/dateRange.ts(extending the utility from PR 3). Formats date ranges as "MMM D – MMM D, YYYY", subtracting 1 day from exclusive-midnight end dates.Router —
/agents/settings/limitsand/agents/settings/usageroutes removed, replaced by/agents/settings/spend.Sidebar — "Limits" + "Usage" merged into "Spend" (
WalletIcon), "Analytics" renamed to "Insights".Deleted files —
AgentSettingsLimitsPage,AgentSettingsUsagePageView,LimitsTab/LimitsTab.tsx,LimitsTab/index.ts. The sub-components (DefaultLimitSection,GroupLimitsSection,UserOverridesSection) gainhideHeaderprops and are reused insideCollapsibleSectioncards.Stories — 6 stories with play functions: full view with all sections, empty users, drill-in, drill-in + back, refetch overlay, and config loading state.
Stack