mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
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:
@@ -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"
|
||||
|
||||
@@ -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"})
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user