fix(frontend): address round-2 review — aria-label, email fallback, last dark: class

- Add aria-label="Reset scope" to select elements in RateLimitDisplay
  and RateLimitModal for screen reader accessibility
- Fall back to userId when userEmail is empty in RateLimitModal dialog
  description so admins always see an identifier
- Remove last remaining dark:bg-gray-900 class in RateLimitManager
This commit is contained in:
Zamil Majdy
2026-03-26 21:08:57 +07:00
parent 0434bb951b
commit 644798bbf2
3 changed files with 4 additions and 2 deletions

View File

@@ -61,6 +61,7 @@ export function RateLimitDisplay({ data, onReset }: Props) {
<div className="mt-6 flex items-center gap-3 border-t pt-4">
<select
aria-label="Reset scope"
value={resetWeekly ? "both" : "daily"}
onChange={(e) => setResetWeekly(e.target.value === "both")}
className="rounded-md border bg-white px-3 py-1.5 text-sm"

View File

@@ -219,7 +219,7 @@ export function RateLimitManager() {
{/* User selection list -- always require explicit selection */}
{searchResults.length >= 1 && !selectedUser && (
<div className="rounded-md border bg-white p-4 dark:bg-gray-900">
<div className="rounded-md border bg-white p-4">
<h3 className="mb-2 text-sm font-medium text-gray-700">
Select a user ({searchResults.length}{" "}
{searchResults.length === 1 ? "result" : "results"})

View File

@@ -125,7 +125,7 @@ export function RateLimitModal({
<DialogHeader>
<DialogTitle>Rate Limits</DialogTitle>
<DialogDescription>
CoPilot rate limits for {userEmail}
CoPilot rate limits for {userEmail || userId}
</DialogDescription>
</DialogHeader>
@@ -160,6 +160,7 @@ export function RateLimitModal({
<div className="flex items-center gap-3 border-t pt-4">
<select
aria-label="Reset scope"
value={resetWeekly ? "both" : "daily"}
onChange={(e) => setResetWeekly(e.target.value === "both")}
className="rounded-md border bg-white px-3 py-1.5 text-sm"