restore(usage): bring back OpenUsage rate-limits panel + sidebar entry#80
restore(usage): bring back OpenUsage rate-limits panel + sidebar entry#80aaditagrawal wants to merge 2 commits intomainfrom
Conversation
Restored from commit 97f179f (pre-PR #77 state), with one adaptation for upstream's new SPI: ProviderKind → ProviderDriverKind (now branded; uses .make()) Adapted files: - lib/openUsageRateLimits.ts (provider id → driver kind mapping) - lib/openUsageReactQuery.ts (query key driver kind) Restored verbatim: - components/RateLimitsPanel.tsx (sidebar collapsible) - components/RateLimitsPanel.test.tsx - components/RateLimitSummaryList.tsx - components/chat/RateLimitBanner.tsx (in-chat banner) - lib/openUsageRateLimits.test.ts - lib/rateLimits.ts (snapshot parsing core) - lib/icons.tsx (lucide aliases — distinct from components/Icons.tsx which is the app's custom monochrome icon set) Not yet wired: panel + banner are not mounted anywhere. Sidebar integration follows in a subsequent commit. Local: `bunx tsc --noEmit` clean from apps/web.
Mounts the restored OpenUsage rate-limits panel as a SidebarGroup between the search row and the projects section. Conditional render — the panel auto-hides itself when no rate-limit activities have arrived (returns null), and the wrapper SidebarGroup also hides when no threads-with-activities are subscribed, so the sidebar stays clean for users who never hit a provider rate limit. Plumbing: - New SidebarProjectsContent prop `threadsWithActivities` typed as `readonly Pick<Thread, "activities">[]`. - Parent computes it via `selectThreadsAcrossEnvironments` mapped to just the activities slice, wrapped in `useShallow` so the reference stays stable when activity slices are unchanged. Tests: 995/995 web, including the restored 8 OpenUsage tests (2 panel + 6 derivation).
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (10)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
PR #77's merge of upstream's multi-provider SPI silently dropped 9 files for the OpenUsage rate-limits feature. This PR restores them, adapts to upstream's branded SPI, and wires the panel into the sidebar.
Restored from `97f179fd` (9 files)
Adaptation
Only API drift: `ProviderKind` → `ProviderDriverKind` (now branded via `ProviderDriverKind.make(...)`).
Wiring
Test plan