feat(conversations): show 5-hour and weekly rate limit usage with reset times#318
Conversation
…ormatting and limit pill component - Added a `formatResetTime` function to display the reset time for the 5-hour spending limit in a user-friendly format. - Introduced a `LimitPill` component to visually represent the usage percentage of the 5-hour and weekly budget limits. - Updated the Conversations component to conditionally render messages based on team usage status, including a button for topping up when the budget is exhausted. - Enhanced the budget display logic to include both 5-hour and weekly limits, improving clarity for users on their usage status.
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThe changes implement a dual-layer billing system with both 5-hour rolling spend limits and 7-day weekly budgets. The API response type is extended with new fields for 5-hour window tracking and cycle dates. The UI is updated to display both usage metrics via color-coded pills, conditionally show warnings based on either limit being reached, and selectively display the top-up button. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
Problem
Solution
backend-3, separate branch): ExtendedGET /teams/me/usagewithfiveHourSpendUsd,fiveHourCapUsd,fiveHourResetsAt,cycleStartDate, andcycleEndsAt. AddedgetWindowSpendInfo()torateLimitServiceto return the oldest entry timestamp for reset calculation.TeamUsagetype, addedLimitPillcomponent (compact bar + percentage with color coding: primary < 80%, amber 80–99%, coral at 100%),formatResetTimehelper for human-readable countdowns, and a hover tooltip showing both limits' details.Submission Checklist
formatResetTimeandLimitPillcomponentTeamUsagefieldsImpact
getTeamUsagecall is augmented, not duplicated.feat/rate-limit-usage-displayonbackend-3) to be deployed for the new fields to be populated.Related
tinyhumansai/backend-3branchfeat/rate-limit-usage-displaySummary by CodeRabbit
New Features
Style