-
Notifications
You must be signed in to change notification settings - Fork 1
🎨 Palette: Add aria-labels to filter dropdowns in LogsView.tsx
#499
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -99,6 +99,7 @@ export function LogsView() { | |
| className="text-xs px-3 py-1.5 border border-border bg-card text-txt cursor-pointer" | ||
| value={logLevelFilter} | ||
| onChange={handleLevelChange} | ||
| aria-label="Filter logs by level" | ||
| > | ||
| <option value="">All levels</option> | ||
| <option value="debug">Debug</option> | ||
|
|
@@ -111,6 +112,7 @@ export function LogsView() { | |
| className="text-xs px-3 py-1.5 border border-border bg-card text-txt cursor-pointer" | ||
| value={logSourceFilter} | ||
| onChange={handleSourceChange} | ||
| aria-label="Filter logs by source" | ||
| > | ||
| <option value="">All sources</option> | ||
| {logSources.map((s) => ( | ||
|
|
@@ -125,6 +127,7 @@ export function LogsView() { | |
| className="text-xs px-3 py-1.5 border border-border bg-card text-txt cursor-pointer" | ||
| value={logTagFilter} | ||
| onChange={handleTagChange} | ||
| aria-label="Filter logs by tag" | ||
| > | ||
| <option value="">All tags</option> | ||
| {logTags.map((tag) => ( | ||
|
Comment on lines
127
to
133
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Potential runtime error if Although the dropdown is conditionally rendered with {(logTags ?? []).map((tag) => (
<option key={tag} value={tag}>{tag}</option>
))}Alternatively, validate |
||
|
|
||
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.
Potential runtime error if
logSourcesis undefined or not an arrayThe dropdown options are generated by mapping over
logSources. IflogSourcesis undefined or not an array, this will cause a runtime error. To improve robustness, ensurelogSourcesis always an array:Alternatively, validate
logSourcesin the context provider.