mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? Improve code review guidelines for copilot --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
3.1 KiB
3.1 KiB
applyTo
| applyTo |
|---|
| apps/studio/** |
shadcn/Radix UI Component Review Rules
All comments are advisory.
Core Principle
This project uses shadcn/ui components built on Radix UI primitives (from packages/ui/). These components provide comprehensive accessibility out-of-the-box. Do not flag missing accessibility attributes that are already handled by the underlying Radix primitives.
Components with Built-In Accessibility — Do NOT Flag
The following components (imported from ui) already handle ARIA roles, keyboard navigation, focus management, and screen reader support automatically via Radix UI primitives:
| Component | What Radix Handles |
|---|---|
Dialog, AlertDialog |
role="dialog", aria-modal, focus trapping, ESC to close |
DropdownMenu, ContextMenu |
role="menu" / role="menuitem", arrow key navigation |
Select |
role="combobox", aria-expanded, keyboard selection |
Tabs |
role="tablist" / role="tab" / role="tabpanel", aria-selected, arrow keys |
Checkbox |
role="checkbox", aria-checked, Space to toggle |
RadioGroup |
role="radio", aria-checked, arrow key navigation |
Switch |
role="switch", aria-checked, keyboard toggle |
Tooltip |
Trigger/content association, show/hide timing |
Accordion, Collapsible |
aria-expanded, Enter/Space to toggle |
Popover, HoverCard |
Focus management, dismiss on ESC |
Slider |
role="slider", aria-valuemin/max/now, arrow keys |
Toggle, ToggleGroup |
aria-pressed, keyboard support |
ScrollArea |
Accessible scrollbar replacement |
NavigationMenu |
role="navigation", keyboard navigation |
Specifically, Never Flag These
- Missing
roleonDialog,AlertDialog,DropdownMenu,Select,Tabs,RadioGroup, or other Radix-based components — roles are set by the primitive - Missing
aria-modalonDialogorAlertDialog— set automatically - Missing
aria-expandedonAccordion,Collapsible,Select, orDropdownMenutriggers — managed by Radix state - Missing
aria-selectedonTabs— managed byTabsPrimitive - Missing
aria-checkedonCheckbox,RadioGroup, orSwitch— managed by Radix state - Missing keyboard event handlers (
onKeyDown,onKeyUp) on interactive Radix components — keyboard support is built-in - Missing focus management in
DialogorAlertDialog— focus trapping is automatic - Missing
aria-labelonDialogCloseorAlertDialogCancel— these render a visible<span className="sr-only">Close</span>
What TO Flag
Only flag accessibility issues for:
- Custom interactive elements not using Radix primitives (e.g., a
<div onClick>that should be a<button>) - Icon-only buttons missing an accessible label —
<Button>alone does not add one; usearia-labelor<span className="sr-only"> - Missing
Labelassociation — form inputs should be paired with<Label htmlFor="...">or wrapped in a<Field>component - Images missing
alttext — not handled by any component library - Color-only state indicators — state changes should not rely solely on color