-
Notifications
You must be signed in to change notification settings - Fork 527
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
fix: ratelimits ui filters and logs ordering #2811
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
📝 WalkthroughWalkthroughThis pull request introduces modifications to several files, notably Changes
Sequence DiagramsequenceDiagram
participant Frontend as Filters Component
participant Backend as getRatelimitLogs
Frontend->>Backend: Request logs with optional passed filter
alt Passed filter defined
Backend-->>Backend: Apply passed condition to SQL query
end
Backend-->>Frontend: Return filtered logs ordered by time
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (4)
⏰ Context from checks skipped due to timeout of 90000ms (17)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Thank you for following the naming conventions for pull request titles! 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/dashboard/app/(app)/ratelimits/[namespaceId]/logs/filter.tsx (1)
203-211
: Consider accessibility improvements for the date picker triggers.While the styling looks good with
buttonVariants()
, convertingButton
components todiv
elements might affect accessibility. Consider:
- Adding
role="button"
- Including proper
aria-*
attributes- Adding keyboard interaction handlers
<div className={cn("text-xs font-medium w-full items-center gap-0", buttonVariants())} + role="button" + tabIndex={0} + aria-label="Open date picker" + onKeyDown={(e) => { + if (e.key === 'Enter' || e.key === ' ') { + e.preventDefault(); + e.currentTarget.click(); + } + }} >Also applies to: 230-238
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/dashboard/app/(app)/ratelimits/[namespaceId]/logs/filter.tsx
(3 hunks)internal/clickhouse/src/ratelimits.ts
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (17)
- GitHub Check: Test Packages / Test ./packages/rbac
- GitHub Check: Test Packages / Test ./packages/nextjs
- GitHub Check: Test Packages / Test ./packages/hono
- GitHub Check: Test Packages / Test ./packages/cache
- GitHub Check: Test Packages / Test ./packages/api
- GitHub Check: Test Packages / Test ./internal/clickhouse
- GitHub Check: Test Packages / Test ./internal/resend
- GitHub Check: Test Packages / Test ./internal/keys
- GitHub Check: Test Packages / Test ./internal/id
- GitHub Check: Test Packages / Test ./internal/hash
- GitHub Check: Test Packages / Test ./internal/encryption
- GitHub Check: Test Packages / Test ./internal/billing
- GitHub Check: Test API / API Test Local
- GitHub Check: Build / Build
- GitHub Check: autofix
- GitHub Check: Test Agent Local / test_agent_local
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (4)
internal/clickhouse/src/ratelimits.ts (2)
166-166
: LGTM! Good addition of the optional filter parameter.The new optional boolean parameter allows for filtering logs based on ratelimit success/failure status.
184-185
: LGTM! SQL query changes look good.The changes properly implement:
- Conditional filtering based on the
passed
parameter- Explicit DESC ordering for showing newest logs first
apps/dashboard/app/(app)/ratelimits/[namespaceId]/logs/filter.tsx (2)
196-196
: LGTM! Good fix for date selection.Disabling future dates is the correct approach for a logging interface.
Line range hint
41-49
: LGTM! Good coordination between frontend and backend filtering.The
success
state in the frontend properly maps to the newpassed
parameter in the backend, maintaining type consistency and providing a clean user experience for filtering logs.
Summary by CodeRabbit
New Features
Bug Fixes
Refactor