Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bf50641

Browse files
authored
chore(site): enable oxlint role-supports-aria-props rule (#29192)
Enables the `role-supports-aria-props` oxlint rule (jsx-a11y), moving it out of the migration backlog and setting it to `error`. Stacked on top of #29191. Review that PR first; the base of this PR is its branch. ## Fixes for the two violations the rule surfaced - **`Autocomplete.tsx` (select-only trigger button):** removed `aria-invalid` from the `<button>`. `aria-invalid` is not exposed by the implicit `button` role, so it had no effect for assistive tech. The error message linkage via `aria-describedby` (a global attribute) is kept. The only consumer that sets an invalid state (`ModelIdentifierField`) uses the `inlineSearch` variant, which renders an `<input role="combobox">` that still keeps `aria-invalid` (valid there). - **`AgentLatency.tsx` (latency popover trigger):** the trigger was a `<span role="presentation" aria-label="latency">`; `presentation` does not support `aria-label`, and a presentational role on an interactive trigger is wrong. Converted it to a real `<button>` with reset styling so it stays visually identical (inline colored text, no button chrome) while being a focusable, correctly-labeled control. ## Verification - `oxlint --deny-warnings`: 0 warnings, 0 errors. - `biome lint --error-on-warnings` on the changed files: clean. - `tsc -p .`: clean. - Storybook visual check of `components/AgentRow --example`: latency renders as inline colored text (no boxed button) and clicking it still opens the "Latency" popover. --- _This PR was generated by Coder Agents on behalf of @jeremyruppel._
1 parent a18642a commit bf50641

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

site/.oxlintrc.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"img-redundant-alt": "error",
2222
"no-redundant-roles": "error",
2323
"role-has-required-aria-props": "error",
24+
"role-supports-aria-props": "error",
2425
"alt-text": "error",
2526
"anchor-has-content": "error",
2627
"anchor-ambiguous-text": "error",
@@ -207,7 +208,6 @@
207208
"consistent-type-imports": "off", // style/useImportType (medium)
208209
"jsx-curly-brace-presence": "off", // style/useConsistentCurlyBraces (medium, coder error rule)
209210
"no-fallthrough": "off", // suspicious/noFallthroughSwitchClause (medium)
210-
"role-supports-aria-props": "off", // a11y/useAriaPropsSupportedByRole (small)
211211
"click-events-have-key-events": "off", // a11y/useKeyWithClickEvents (small)
212212
"prefer-function-type": "off", // style/useShorthandFunctionType (small)
213213
"no-empty-interface": "off", // suspicious/noEmptyInterface (small)

site/src/components/Autocomplete/Autocomplete.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,6 @@ export function Autocomplete<TOption>({
374374
data-testid={testId}
375375
aria-expanded={isOpen}
376376
aria-haspopup="listbox"
377-
aria-invalid={triggerAriaInvalid}
378377
aria-describedby={triggerAriaDescribedBy}
379378
disabled={disabled}
380379
className={cn(

site/src/modules/resources/AgentLatency.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ export const AgentLatency: FC<AgentLatencyProps> = ({ agent }) => {
4343
return (
4444
<HelpPopover>
4545
<HelpPopoverTrigger asChild>
46-
<span
47-
role="presentation"
46+
<button
47+
type="button"
4848
aria-label="latency"
4949
className={cn("cursor-pointer", latency.color)}
5050
>
5151
{Math.round(latency.latency_ms)}ms
52-
</span>
52+
</button>
5353
</HelpPopoverTrigger>
5454
<HelpPopoverContent>
5555
<HelpPopoverTitle>Latency</HelpPopoverTitle>

0 commit comments

Comments
 (0)