Repository navigation
chore(a11y): convert leftover focus recipes to focus-ring - #48219
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
5 Skipped Deployments
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughStandardizes focus-state styling across shared UI, design-system, docs, Studio, and www components by replacing explicit Tailwind focus and ring utilities with the shared ChangesFocus-ring styling standardization
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/design-system/components/color-palette.tsx`:
- Line 67: Preserve the existing transition utilities while applying the
focus-ring migration: in apps/design-system/components/color-palette.tsx:67
restore the hover-scale transition; in
packages/ui-patterns/src/multi-select/multi-select.tsx:296-300 restore
transition-colors duration-200; in
packages/ui/src/components/radio-group-stacked.tsx:51-58 and :69-72 restore the
root-item and indicator transitions; in
packages/ui/src/components/shadcn/ui/dialog.tsx:117-119 and :200-202,
packages/ui/src/components/shadcn/ui/sheet.tsx:183-185, and
packages/ui/src/components/shadcn/ui/sonner.tsx:57-60 restore each close-button
transition; and in apps/docs/features/ui/PromptPanel.tsx:136 and :195 plus
apps/docs/features/ui/Tabs.tsx:57 restore the expand/collapse, copy-button, and
tab-state transitions.
In `@apps/studio/components/ui/TwoOptionToggle.tsx`:
- Line 27: Update the toggle option elements rendered by TwoOptionToggle to use
native button type="button" elements instead of spans, preserving their existing
styling and click behavior. Ensure each option is keyboard-focusable and
activates through standard keyboard interaction so the focus-ring styling
applies to keyboard users.
In `@apps/www/app/state-of-startups/components/TwoOptionToggle.tsx`:
- Line 23: Update the option elements in TwoOptionToggle to render as button
type="button" controls instead of clickable spans, preserving their existing
click behavior and styling while adding aria-pressed semantics for the selected
option. Ensure both toggle choices are keyboard-focusable and activatable.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 69eff36c-4f15-41a8-a9ce-85f1dc631238
📒 Files selected for processing (53)
apps/design-system/components/color-palette.tsxapps/design-system/registry/default/example/form-patterns-sidepanel.tsxapps/docs/components/Navigation/NavigationMenu/GlobalMobileMenu.tsxapps/docs/components/Navigation/NavigationMenu/GlobalNavigationMenu.tsxapps/docs/features/ui/PromptPanel.tsxapps/docs/features/ui/Tabs.tsxapps/studio/components/interfaces/Auth/CustomAuthProviders/CreateOrUpdateCustomProviderSheet.tsxapps/studio/components/interfaces/Auth/OAuthApps/CreateOrUpdateOAuthAppSheet.tsxapps/studio/components/interfaces/Database/Policies/PolicyEditorPanel/PolicyEditorPanelHeader.tsxapps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/SlotLagMetrics.tsxapps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/SlotStatus.tsxapps/studio/components/interfaces/Integrations/Marketplace/MarketplaceCard.tsxapps/studio/components/interfaces/Integrations/Marketplace/MarketplaceFeaturedHeroGrid.tsxapps/studio/components/interfaces/Integrations/Marketplace/MarketplaceFilterBar.tsxapps/studio/components/interfaces/Integrations/Marketplace/MarketplaceListRow.tsxapps/studio/components/interfaces/ProjectHome/ConnectSection.tsxapps/studio/components/interfaces/ProjectHome/SortableSection.tsxapps/studio/components/interfaces/QueryPerformance/QueryPerformanceMetrics.tsxapps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesBucketsSection.tsxapps/studio/components/interfaces/Storage/StoragePolicies/StoragePolicyEditorModalTitle.tsxapps/studio/components/interfaces/Support/AttachmentUpload.tsxapps/studio/components/interfaces/Support/SupportAssistantSuccessCard.tsxapps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImportPreview.tsxapps/studio/components/ui/AIAssistantPanel/SupportAssistantSuccessCardContent.tsxapps/studio/components/ui/TwoOptionToggle.tsxapps/www/app/partners/catalog/IntegrationsContent.tsxapps/www/app/state-of-startups/components/TwoOptionToggle.tsxapps/www/components/Announcement/Badge.tsxapps/www/components/Button.tsxapps/www/components/Changelog/ChangelogTimelineList.tsxapps/www/components/FeaturesMatrix.tsxapps/www/components/Modules/ModulesNav.tsxapps/www/components/Nav/DevelopersDropdown.tsxapps/www/components/Nav/HamburgerMenu.tsxapps/www/components/Nav/MenuItem.tsxapps/www/components/Nav/MobileMenu.tsxapps/www/components/Nav/ProductDropdown.tsxapps/www/components/Nav/RightClickBrandLogo.tsxapps/www/components/Nav/SolutionsDropdown.tsxapps/www/components/Nav/index.tsxapps/www/components/Pricing/PricingComputeSection.tsxapps/www/components/Products/ProductCard.tsxapps/www/components/Products/ProductsNav.tsxapps/www/components/SolutionsStickyNav.tsxapps/www/pages/changelog.tsxapps/www/pages/company.tsxapps/www/pages/features.tsxpackages/ui-patterns/src/TextLink/index.tsxpackages/ui-patterns/src/multi-select/multi-select.tsxpackages/ui/src/components/radio-group-stacked.tsxpackages/ui/src/components/shadcn/ui/dialog.tsxpackages/ui/src/components/shadcn/ui/sheet.tsxpackages/ui/src/components/shadcn/ui/sonner.tsx
🎭 Playwright Test Results (tanstack)Details
Flaky testsFeatures › table-editor.spec.ts › table editor › copying cell values preserves false and zero Skipped testsFeatures › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled |
🎭 Playwright Test Results (next)Details
Flaky testsFeatures › queue-table-operations.spec.ts › Queue Table Operations › pending changes persist when switching between tables Skipped testsFeatures › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled |
There was a problem hiding this comment.
Pull request overview
This PR standardizes keyboard focus styling across the monorepo by replacing ad-hoc focus ring/outline class stacks with the shared Tailwind focus-ring utility (primarily :focus-visible), aligning remaining call sites with the focus-ring conventions introduced in #41575.
Changes:
- Replaced bespoke
focus-visible:ring-*/focus:*/ outline-based focus recipes withfocus-ringacross UI components and app surfaces (Studio, www, docs, design-system). - Updated several Radix/shadcn close/trigger controls and navigational links to use the canonical focus recipe, keeping documented exceptions (e.g., group-focus-visible patterns).
- Adjusted a few related state classes (e.g.,
focus-visible:z-10, border tweaks) to fit the new focus styling approach.
Reviewed changes
Copilot reviewed 53 out of 53 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/ui/src/components/shadcn/ui/sonner.tsx | Updates toast close button focus styling to use focus-ring. |
| packages/ui/src/components/shadcn/ui/sheet.tsx | Converts Sheet close button focus styles to focus-ring. |
| packages/ui/src/components/shadcn/ui/dialog.tsx | Converts Dialog close controls focus styles to focus-ring. |
| packages/ui/src/components/radio-group-stacked.tsx | Replaces custom focus ring stack with focus-ring and updates group focus styling. |
| packages/ui-patterns/src/TextLink/index.tsx | Standardizes TextLink focus styling via focus-ring. |
| packages/ui-patterns/src/multi-select/multi-select.tsx | Converts multi-select trigger focus styles to focus-ring. |
| apps/www/pages/features.tsx | Standardizes focus styles on view toggles and feature links. |
| apps/www/pages/company.tsx | Standardizes focus styles on press links/cards. |
| apps/www/pages/changelog.tsx | Converts changelog label badge focus styles to focus-ring. |
| apps/www/components/SolutionsStickyNav.tsx | Standardizes focus styles for sticky nav links. |
| apps/www/components/Products/ProductsNav.tsx | Standardizes focus styles for product nav links. |
| apps/www/components/Products/ProductCard.tsx | Uses focus-ring for product card links. |
| apps/www/components/Pricing/PricingComputeSection.tsx | Converts focus styling on the compute table toggle button. |
| apps/www/components/Nav/SolutionsDropdown.tsx | Standardizes dropdown link focus styles and minor import ordering. |
| apps/www/components/Nav/RightClickBrandLogo.tsx | Updates brand logo link focus styling to focus-ring. |
| apps/www/components/Nav/ProductDropdown.tsx | Standardizes focus styles across product dropdown links. |
| apps/www/components/Nav/MobileMenu.tsx | Converts mobile menu items and controls to use focus-ring. |
| apps/www/components/Nav/MenuItem.tsx | Standardizes MenuItem focus styling to focus-ring. |
| apps/www/components/Nav/index.tsx | Updates NavigationMenu trigger focus styling to focus-ring. |
| apps/www/components/Nav/HamburgerMenu.tsx | Converts hamburger button focus styles to focus-ring. |
| apps/www/components/Nav/DevelopersDropdown.tsx | Standardizes focus styles across developers dropdown links. |
| apps/www/components/Modules/ModulesNav.tsx | Standardizes module nav link focus styling. |
| apps/www/components/FeaturesMatrix.tsx | Converts matrix feature link focus styling to focus-ring. |
| apps/www/components/Changelog/ChangelogTimelineList.tsx | Converts tiny/normal label badge focus styles to focus-ring. |
| apps/www/components/Button.tsx | Applies focus-ring to the shared Button component. |
| apps/www/components/Announcement/Badge.tsx | Converts announcement badge focus styling to focus-ring. |
| apps/www/app/state-of-startups/components/TwoOptionToggle.tsx | Updates toggle option focus styling to focus-ring / focus-visible. |
| apps/www/app/partners/catalog/IntegrationsContent.tsx | Standardizes focus styling on view toggles and partner cards. |
| apps/studio/components/ui/TwoOptionToggle.tsx | Updates Studio toggle option focus styling to focus-ring / focus-visible. |
| apps/studio/components/ui/AIAssistantPanel/SupportAssistantSuccessCardContent.tsx | Converts focus styling on assistant success card content. |
| apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SpreadsheetImport/SpreadsheetImportPreview.tsx | Standardizes focus styling on expandable error rows. |
| apps/studio/components/interfaces/Support/SupportAssistantSuccessCard.tsx | Converts focus styling on assistant success card shell. |
| apps/studio/components/interfaces/Support/AttachmentUpload.tsx | Standardizes focus styling on attachment controls (remove/add). |
| apps/studio/components/interfaces/Storage/StoragePolicies/StoragePolicyEditorModalTitle.tsx | Converts Storage policy modal controls to focus-ring. |
| apps/studio/components/interfaces/Storage/StoragePolicies/StoragePoliciesBucketsSection.tsx | Converts bucket list toggle focus styling to focus-ring. |
| apps/studio/components/interfaces/QueryPerformance/QueryPerformanceMetrics.tsx | Standardizes focus styling on info/help buttons. |
| apps/studio/components/interfaces/ProjectHome/SortableSection.tsx | Converts reorder handle focus styling to focus-ring. |
| apps/studio/components/interfaces/ProjectHome/ConnectSection.tsx | Standardizes focus styling on connect action buttons. |
| apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceListRow.tsx | Consolidates focus styling for marketplace list row links. |
| apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceFilterBar.tsx | Updates view mode toggle focus styling to focus-ring. |
| apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceFeaturedHeroGrid.tsx | Converts featured marketplace cards focus styling to focus-ring. |
| apps/studio/components/interfaces/Integrations/Marketplace/MarketplaceCard.tsx | Converts marketplace card link focus styling to focus-ring. |
| apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/SlotStatus.tsx | Standardizes focus styling for slot status legend info button. |
| apps/studio/components/interfaces/Database/Replication/ReplicationPipelineStatus/SlotLagMetrics.tsx | Standardizes focus styling for slot lag metrics info buttons. |
| apps/studio/components/interfaces/Database/Policies/PolicyEditorPanel/PolicyEditorPanelHeader.tsx | Converts SheetClose focus styling to focus-ring. |
| apps/studio/components/interfaces/Auth/OAuthApps/CreateOrUpdateOAuthAppSheet.tsx | Converts SheetClose focus styling to focus-ring. |
| apps/studio/components/interfaces/Auth/CustomAuthProviders/CreateOrUpdateCustomProviderSheet.tsx | Converts SheetClose focus styling to focus-ring. |
| apps/docs/features/ui/Tabs.tsx | Standardizes tab trigger focus styling to focus-ring. |
| apps/docs/features/ui/PromptPanel.tsx | Converts focus styling for expand/copy controls to focus-ring. |
| apps/docs/components/Navigation/NavigationMenu/GlobalNavigationMenu.tsx | Converts global nav trigger and menu item focus styling to focus-ring. |
| apps/docs/components/Navigation/NavigationMenu/GlobalMobileMenu.tsx | Standardizes focus styling in mobile nav/menu controls. |
| apps/design-system/registry/default/example/form-patterns-sidepanel.tsx | Updates focus styling on the avatar/upload button to focus-ring. |
| apps/design-system/components/color-palette.tsx | Converts palette swatch focus styling to focus-ring. |
Restore opacity/color/transform transitions on focusable controls without reintroducing bare transition that would animate rings. Make TwoOptionToggle options real buttons so focus-ring is reachable. Scope pricing expand ring to the label to avoid Panel overflow clipping.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/studio/components/ui/TwoOptionToggle.tsx`:
- Around line 47-52: Update the toggle option rendering around the button and
TooltipTrigger so disabled options still receive pointer and keyboard focus
events for disabledOptionTooltip. Use a focusable wrapper around the native
disabled button, or replace disabled with aria-disabled while preserving the
existing click guard; keep active options’ behavior unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 72cf5ec9-604e-43c5-a5a1-a75f9aea9e59
📒 Files selected for processing (11)
apps/design-system/components/color-palette.tsxapps/docs/features/ui/PromptPanel.tsxapps/docs/features/ui/Tabs.tsxapps/studio/components/ui/TwoOptionToggle.tsxapps/www/app/state-of-startups/components/TwoOptionToggle.tsxapps/www/components/Pricing/PricingComputeSection.tsxpackages/ui-patterns/src/multi-select/multi-select.tsxpackages/ui/src/components/radio-group-stacked.tsxpackages/ui/src/components/shadcn/ui/dialog.tsxpackages/ui/src/components/shadcn/ui/sheet.tsxpackages/ui/src/components/shadcn/ui/sonner.tsx
🚧 Files skipped from review as they are similar to previous changes (8)
- apps/design-system/components/color-palette.tsx
- packages/ui-patterns/src/multi-select/multi-select.tsx
- apps/www/components/Pricing/PricingComputeSection.tsx
- packages/ui/src/components/radio-group-stacked.tsx
- packages/ui/src/components/shadcn/ui/dialog.tsx
- apps/docs/features/ui/PromptPanel.tsx
- packages/ui/src/components/shadcn/ui/sheet.tsx
- packages/ui/src/components/shadcn/ui/sonner.tsx
Use aria-disabled instead of the native disabled attribute so Radix TooltipTrigger asChild still receives pointer and focus events.
awaseem
left a comment
There was a problem hiding this comment.
Tested staging and self hosted
Braintrust eval report
|
What kind of change does this PR introduce?
Accessibility cleanup (DEPR-628).
What is the current behavior?
Leftover call sites still use ad-hoc focus recipes (
ring-foreground-muted,outline-brand, Dialog/Sheetfocus:rings, etc.) instead of the shared utilities from #41575.What is the new behavior?
Converts those leftovers across
packages/ui, Studio, www, docs, and design-system tofocus-ring, preferringfocus-visible. Keeps documented exceptions (group-focus-visible, InputGroup:has()).To test
Tab through controls (keyboard only). Expect a consistent offset ring on
:focus-visible, not a green/brand/custom stack, and no ring animation.www (marketing)
Preview: https://zone-www-dot-com-git-danny-depr-628-focus-ring-fbccf9-supabase.vercel.app
/: Product, Developers, Solutions dropdowns; logo; hamburger + mobile menu/features: view toggles and feature cards/company: card links/changelog: timeline / entry links/partners/catalog: grid/list toggle and partner cards/pricing: compute section expand control/database,/storage)/state-of-startups: TwoOptionToggle if presentdocs
Preview: https://docs-git-danny-depr-628-focus-ring-long-tail-supabase.vercel.app
studio (dashboard)
Preview: https://studio-staging-git-danny-depr-628-focus-ring-long-tail-supabase.vercel.app
/project/<ref>/integrations): featured cards, list/grid toggle, list rows/project/<ref>/auth/oauth-apps,/project/<ref>/auth/providers): open create/edit sheet, tab to close (X)/project/<ref>/database/policies): open policy editor sheet, tab to close/project/<ref>/storage/files/policies): bucket section links; policy modal close/project/<ref>/observability/query-performance): info icon buttons on metrics/support/new): attachment add/remove controlsdesign-system
Preview: https://design-system-git-danny-depr-628-focus-ring-long-tail-supabase.vercel.app
Additional context
Summary by CodeRabbit
Accessibility & Usability
aria-pressed/disabled handling and better keyboard navigation.Visual Updates