Skip to content

chore(design-system): standardise keyboard focus rings - #41575

Merged
dnywh merged 16 commits into
masterfrom
dnywh/chore/improve-tab-focus-styles
Jul 22, 2026
Merged

dnywh merged 16 commits into
masterfrom
dnywh/chore/improve-tab-focus-styles

Conversation

@dnywh

@dnywh dnywh commented Dec 24, 2025 •

Copy link
Copy Markdown
Contributor

I have read the CONTRIBUTING.md file.

YES

What kind of change does this PR introduce?

UI / design-system consistency (accessibility).

What is the current behavior?

Keyboard focus rings are inconsistent across Studio and packages/ui:

  • Custom Button uses thick outline with per-variant colours (brand / grey / destructive / warning)
  • Form controls use muted grey rings (ring-background-control)
  • Tabs / NavMenu / Radio use soft brand ring-ring
  • Studio .inset-focus uses dark green outline-brand-600

Related: DEPR-354.

What is the new behavior?

One shared focus recipe, exposed as Tailwind @utility classes in packages/config/css/utilities.css:

Utility Use when
focus-ring Buttons, inputs, most controls (offset ring)
focus-inset Dense/flush surfaces such as interactive table rows (renamed from inset-focus)
# focus-ring
outline-hidden
focus-visible:ring-2
focus-visible:ring-ring
focus-visible:ring-offset-2
focus-visible:ring-offset-background

Applied on Button, shadcn form controls, Menu/NavMenu, Command palette trigger, Studio table rows, and related call sites. Documented in the design-system accessibility docs. Variants do not change focus ring colour.

When the ring must appear on a different element than the focused one (e.g. Menu + ProductMenu Link via group-focus-visible, or InputGroup via :has()), keep an explicit ring stack. The utilities bake in :focus-visible on the same element.

Additional context

Out of scope

  • Full packages/ui / Studio / www sweep
  • Legacy Studio form-group green box-shadow cleanup
  • ESLint rule for bare outline-none

Test plan

Prefer Safari (“hard mode” for tabIndex). Expect one soft brand ring everywhere: not grey, not solid green outline.

Design system

Studio

  • Org home → table view (/organizations/_ or org projects): switch to the table layout, Tab onto a project row; inset outline sits inside the row (list/card view uses CardButton, not focus-inset)
  • Project sidebar (Database, Auth, Storage, …): Tab the main product nav links; ring follows the focused item (not the nested section menus like Tables / Roles)
  • Storage → Files: Tab a bucket row; same inset outline as org table rows
  • Project Settings → General (or Compute and Disk): Tab through inputs, checkboxes, switches, selects; same offset ring, no ring on mouse click
  • Header ⌘K (desktop width): Tab to the search control after Feedback; same soft brand focus-ring (was a thicker ring-border-strong before)
  • Table Editor or SQL Editor tabs: focus a tab, Tab to × if active; close shows a ring
  • Light + dark: ring stays visible against both backgrounds

@vercel

vercel Bot commented Dec 24, 2025 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
design-system Ready Ready Preview, Comment Jul 21, 2026 8:30pm
7 Skipped Deployments
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Jul 21, 2026 8:30pm
cms Skipped Skipped Jul 21, 2026 8:30pm
docs Skipped Skipped Jul 21, 2026 8:30pm
studio-self-hosted Skipped Skipped Jul 21, 2026 8:30pm
studio-staging Skipped Skipped Jul 21, 2026 8:30pm
ui-library Skipped Skipped Jul 21, 2026 8:30pm
zone-www-dot-com Skipped Skipped Jul 21, 2026 8:30pm

Request Review

@coderabbitai

coderabbitai Bot commented Dec 24, 2025 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The change centralizes keyboard focus styling into focus-ring and focus-inset utilities, updates UI and Studio components to use them, migrates interactive table rows, removes legacy Studio stylesheet imports, and revises accessibility documentation.

Changes

Focus ring standardization

Layer / File(s) Summary
Canonical focus-ring utilities
packages/config/css/utilities.css, packages/ui/src/lib/commonCva.ts, apps/studio/styles/focus.css, apps/studio/pages/_app.tsx, apps/studio/routes/__root.tsx
Defines shared default and inset focus utilities, updates default focus configuration, replaces legacy inset styling, and removes its stylesheet imports.
UI component focus integration
packages/ui/src/components/**, packages/ui/src/lib/commonCva.ts
Replaces component-specific focus outline and ring classes with focus-ring, while retaining component-specific state, border, disabled, and offset behavior.
Pattern and Studio control alignment
packages/ui-patterns/**, apps/studio/components/layouts/Tabs/**, apps/studio/components/ui/DataTable/**, apps/studio/components/ui/ProductMenu/**
Updates command-menu, multi-select, tab, data-table, slider, and Product Menu control styling for the shared focus-ring approach and grouping behavior.
Interactive table row migration
apps/design-system/registry/**, apps/studio/components/interfaces/**, apps/studio/components/layouts/ProjectNeedsSecuring/**
Replaces inset-focus with focus-inset on interactive table rows without changing row navigation or interaction wiring.
Accessibility guidance updates
apps/design-system/content/docs/**
Documents the default and inset focus-ring recipes and updates Button and row-level navigation guidance.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Suggested labels: documentation

Suggested reviewers: joshenlim

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately summarizes the main change: standardizing keyboard focus rings.
Description check ✅ Passed The description follows the template and covers the change type, current behavior, new behavior, and additional context.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dnywh/chore/improve-tab-focus-styles

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@supabase

supabase Bot commented Dec 24, 2025

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Dec 24, 2025
@github-actions

github-actions Bot commented Dec 24, 2025 •

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results (tanstack)

passed  239 passed
skipped  5 skipped

Details

stats  244 tests across 29 suites
duration  3 minutes, 49 seconds
commit  db546cd

Skipped tests

Features › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled
Features › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected
Features › sql-editor.spec.ts › SQL Editor › share with team works as expected
Features › sql-editor.spec.ts › SQL Editor › folders works as expected
Features › sql-editor.spec.ts › SQL Editor › other SQL snippets actions work as expected

@coveralls

coveralls commented Dec 24, 2025 •

Copy link
Copy Markdown

Coverage Status

coverage: 15.75% (-51.6%) from 67.308%
when pulling 6400f53 on dnywh/chore/improve-tab-focus-styles
into d26bd92 on master.

@ChrisChinchilla ChrisChinchilla removed the documentation Improvements or additions to documentation label Feb 24, 2026
Converge Button, form controls, and inset-focus on focus-visible ring-ring
with shared focusRing/focusRingInset helpers, and document the recipe.
@dnywh
dnywh force-pushed the dnywh/chore/improve-tab-focus-styles branch from 6400f53 to 92c12b2 Compare July 17, 2026 19:25
@dnywh dnywh changed the title chore(design-system): improve tab focus chore(design-system): standardise keyboard focus rings Jul 17, 2026
dnywh added 3 commits July 17, 2026 15:35
Require the plugin inside config so apps that load config/postcss.config
do not fail looking it up from their own node_modules.
Bring the ⌘K nav trigger and ProductMenu items onto the shared
ring-ring focus recipe.
@dnywh
dnywh marked this pull request as ready for review July 17, 2026 19:48
@dnywh
dnywh requested review from a team as code owners July 17, 2026 19:48
@dnywh
dnywh requested a review from Copilot July 17, 2026 19:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Standardizes keyboard focus-ring styling across Studio and packages/ui to use a single shared Tailwind “ring” recipe (rather than per-component outlines), and documents the canonical approach in the design-system accessibility docs.

Changes:

  • Added shared focusRing / focusRingInset utilities and exported them from ui.
  • Updated focus-visible styling across key packages/ui components (Button, Input, Textarea, Checkbox, Switch, Select, InputGroup, Menu items) and ui-patterns CommandMenu trigger.
  • Aligned Studio’s .inset-focus utility and refreshed design-system documentation to describe the new recipe and rules.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/ui/src/lib/commonCva.ts Introduces shared focusRing / focusRingInset constants and wires focusRing into existing CVA defaults.
packages/ui/src/components/shadcn/ui/textarea.tsx Updates Textarea focus-visible ring classes to ring-ring + background offset.
packages/ui/src/components/shadcn/ui/text-area.tsx Updates TextArea focus-visible ring classes to the standardized recipe.
packages/ui/src/components/shadcn/ui/switch.tsx Aligns Switch focus-visible ring to ring-ring + background offset.
packages/ui/src/components/shadcn/ui/select.tsx Aligns SelectTrigger focus-visible ring styling to the standardized recipe.
packages/ui/src/components/shadcn/ui/input.tsx Aligns Input focus-visible ring styling to the standardized recipe.
packages/ui/src/components/shadcn/ui/input-group.tsx Aligns InputGroup “has focus-visible” ring styling to the standardized recipe.
packages/ui/src/components/shadcn/ui/checkbox.tsx Aligns Checkbox focus-visible ring styling to the standardized recipe.
packages/ui/src/components/shadcn/ui/button.tsx Aligns shadcn Button focus-visible ring to ring-ring.
packages/ui/src/components/Menu/Menu.tsx Updates Menu item focus-visible ring thickness/offset to match the new standard.
packages/ui/src/components/Button/Button.tsx Switches custom Button from outline-based focus to the shared ring recipe.
packages/ui/index.tsx Exports focusRing / focusRingInset from the package public API.
packages/ui-patterns/src/CommandMenu/api/CommandMenu.tsx Updates CommandMenu trigger input focus-visible ring to the standardized recipe.
apps/studio/styles/focus.css Updates .inset-focus to use an inset ring-based focus style.
apps/design-system/content/docs/components/button.mdx Documents that Button focus uses shared focusRing and variants don’t change ring color.
apps/design-system/content/docs/accessibility.mdx Documents the focus-ring recipe, usage, and rules (including “don’t animate focus ring”).

Comment thread packages/ui/src/lib/commonCva.ts Resolved
Comment thread packages/ui/src/lib/commonCva.ts Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 `@packages/ui/src/components/Menu/Menu.tsx`:
- Line 48: Update the Menu Item implementation associated with the shown
focus-visible classes so each menu item has a keyboard-focusable target,
following the menu’s existing focus-management pattern or rendering an
appropriate button/link. Ensure the <li role="menuitem"> receives a tabIndex or
delegates focus to a focusable child, while preserving the existing focus-ring
behavior.
🪄 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: fc3f945a-b99d-435c-9418-7817310d63af

📥 Commits

Reviewing files that changed from the base of the PR and between c1d010a and 0a3b439.

📒 Files selected for processing (16)
  • apps/design-system/content/docs/accessibility.mdx
  • apps/design-system/content/docs/components/button.mdx
  • apps/studio/styles/focus.css
  • packages/ui-patterns/src/CommandMenu/api/CommandMenu.tsx
  • packages/ui/index.tsx
  • packages/ui/src/components/Button/Button.tsx
  • packages/ui/src/components/Menu/Menu.tsx
  • packages/ui/src/components/shadcn/ui/button.tsx
  • packages/ui/src/components/shadcn/ui/checkbox.tsx
  • packages/ui/src/components/shadcn/ui/input-group.tsx
  • packages/ui/src/components/shadcn/ui/input.tsx
  • packages/ui/src/components/shadcn/ui/select.tsx
  • packages/ui/src/components/shadcn/ui/switch.tsx
  • packages/ui/src/components/shadcn/ui/text-area.tsx
  • packages/ui/src/components/shadcn/ui/textarea.tsx
  • packages/ui/src/lib/commonCva.ts

dnywh added 4 commits July 17, 2026 15:57
Keep outline-hidden always-on in the documented recipe, stop animating
rings via transition-all/transition, and show Menu item rings when a
wrapping ProductMenu link is keyboard-focused.
Replace the sparsely used focusRing constants with shared Tailwind
@Utility classes (focus-* naming), rename inset-focus to focus-inset,
and point primitives at the utilities.
Drop unused commonCva focus defaults, strip redundant classes beside
focus-ring, prefer transition-colors on touched controls, and document
the group/has exceptions where the utility cannot apply.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
packages/ui-patterns/src/multi-select/multi-select.tsx (1)

582-590: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Apply the focus ring to the actual focus target.

This div is not focusable, so focus-ring will never match its focus-visible state. Move the utility to CommandItem if it receives focus, or use the command item’s selected/active state styling instead.

🤖 Prompt for 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.

In `@packages/ui-patterns/src/multi-select/multi-select.tsx` around lines 582 -
590, Remove the ineffective focus-ring utility from the non-focusable div in the
multi-select option rendering, and apply it to the focusable CommandItem that
receives keyboard focus. If CommandItem does not expose focus-visible styling,
use its selected/active state styling for the focus indication instead.
apps/studio/components/ui/DataTable/DataTableFilters/DataTableFilterCheckbox.tsx (1)

148-158: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Make both Only actions keyboard-reachable.

The shared root cause is hidden group-hover:flex: display: none removes each button from the tab order, so keyboard users cannot invoke the action or see its new focus ring.

  • apps/studio/components/ui/DataTable/DataTableFilters/DataTableFilterCheckbox.tsx#L148-L158: replace the hidden/display-toggle approach with an opacity-based treatment and reveal it on focus-visible.
  • apps/studio/components/ui/DataTable/DataTableFilters/DataTableFilterCheckboxAsync.tsx#L119-L129: apply the same keyboard-reachable visibility treatment.
🤖 Prompt for 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.

In
`@apps/studio/components/ui/DataTable/DataTableFilters/DataTableFilterCheckbox.tsx`
around lines 148 - 158, Make both Only buttons keyboard-reachable by replacing
hidden/display-toggle styling with an opacity-based treatment that reveals the
button on focus-visible while preserving group-hover visibility. Update
DataTableFilterCheckbox.tsx lines 148-158 and DataTableFilterCheckboxAsync.tsx
lines 119-129 consistently; both sites require the same change.
apps/studio/components/layouts/Tabs/SortableTab.tsx (1)

140-144: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Give each close button a tab-specific accessible name.

Because the close control is now outside the tab trigger, aria-label="Close tab" is ambiguous when multiple tabs are open. Include the tab label in the accessible name or associate the button with its corresponding TabsTrigger.

🤖 Prompt for 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.

In `@apps/studio/components/layouts/Tabs/SortableTab.tsx` around lines 140 - 144,
Update the close button in SortableTab to use a tab-specific accessible name by
incorporating the associated tab’s label into aria-label, or associate it with
the corresponding TabsTrigger. Preserve the existing close behavior while
ensuring each button is distinguishable when multiple tabs are open.
apps/studio/components/layouts/Tabs/Tabs.tsx (1)

242-263: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Increase the new-tab close button’s hit area.

This button sizes to the 12px X icon, unlike the sortable-tab close button’s size-5 target. Add size-5 or equivalent padding for reliable mouse and touch interaction.

🤖 Prompt for 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.

In `@apps/studio/components/layouts/Tabs/Tabs.tsx` around lines 242 - 263, The
new-tab close button in the tab layout has too small a hit area. Update its
button styling to include a size-5 target or equivalent padding, matching the
sortable-tab close button, while preserving the existing positioning and
interaction classes.
🤖 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 `@packages/ui/src/components/NavMenu/index.tsx`:
- Line 36: Move the focus-ring styling from the non-focusable NavMenuItem `<li>`
class to its interactive child link or button so keyboard focus triggers the
ring; alternatively, apply an intentional focus-within variant to the parent.
Preserve the existing layout and state classes.

---

Outside diff comments:
In `@apps/studio/components/layouts/Tabs/SortableTab.tsx`:
- Around line 140-144: Update the close button in SortableTab to use a
tab-specific accessible name by incorporating the associated tab’s label into
aria-label, or associate it with the corresponding TabsTrigger. Preserve the
existing close behavior while ensuring each button is distinguishable when
multiple tabs are open.

In `@apps/studio/components/layouts/Tabs/Tabs.tsx`:
- Around line 242-263: The new-tab close button in the tab layout has too small
a hit area. Update its button styling to include a size-5 target or equivalent
padding, matching the sortable-tab close button, while preserving the existing
positioning and interaction classes.

In
`@apps/studio/components/ui/DataTable/DataTableFilters/DataTableFilterCheckbox.tsx`:
- Around line 148-158: Make both Only buttons keyboard-reachable by replacing
hidden/display-toggle styling with an opacity-based treatment that reveals the
button on focus-visible while preserving group-hover visibility. Update
DataTableFilterCheckbox.tsx lines 148-158 and DataTableFilterCheckboxAsync.tsx
lines 119-129 consistently; both sites require the same change.

In `@packages/ui-patterns/src/multi-select/multi-select.tsx`:
- Around line 582-590: Remove the ineffective focus-ring utility from the
non-focusable div in the multi-select option rendering, and apply it to the
focusable CommandItem that receives keyboard focus. If CommandItem does not
expose focus-visible styling, use its selected/active state styling for the
focus indication instead.
🪄 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: fd491cd2-f754-4718-8c9e-197249cd6233

📥 Commits

Reviewing files that changed from the base of the PR and between 3ed3b19 and 466cea8.

📒 Files selected for processing (42)
  • apps/design-system/content/docs/accessibility.mdx
  • apps/design-system/content/docs/components/button.mdx
  • apps/design-system/content/docs/components/table.mdx
  • apps/design-system/registry/default/example/table-row-link-actions.tsx
  • apps/design-system/registry/default/example/table-row-link.tsx
  • apps/studio/components/interfaces/Functions/EdgeFunctionsListItem.tsx
  • apps/studio/components/interfaces/Home/ProjectList/ProjectTableRow.tsx
  • apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooksEndpointDetails.tsx
  • apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooksEndpointList.tsx
  • apps/studio/components/interfaces/Settings/Database/JitDatabaseAccess/JitDbAccessRulesTable.tsx
  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/index.tsx
  • apps/studio/components/interfaces/Storage/BucketsPickerDialog/BucketTableRow.tsx
  • apps/studio/components/interfaces/Storage/FilesBuckets/BucketTable.tsx
  • apps/studio/components/interfaces/Storage/VectorBuckets/index.tsx
  • apps/studio/components/layouts/ProjectNeedsSecuring/ProjectNeedsSecuringView.tsx
  • apps/studio/components/layouts/Tabs/SortableTab.tsx
  • apps/studio/components/layouts/Tabs/Tabs.tsx
  • apps/studio/components/ui/DataTable/DataTableFilters/DataTableFilterCheckbox.tsx
  • apps/studio/components/ui/DataTable/DataTableFilters/DataTableFilterCheckboxAsync.tsx
  • apps/studio/components/ui/DataTable/DataTableSheetRowAction.tsx
  • apps/studio/components/ui/DataTable/primitives/Slider.tsx
  • apps/studio/pages/_app.tsx
  • apps/studio/routes/__root.tsx
  • apps/studio/styles/focus.css
  • packages/config/css/utilities.css
  • packages/ui-patterns/src/CommandMenu/api/CommandMenu.tsx
  • packages/ui-patterns/src/multi-select/multi-select.tsx
  • packages/ui/src/components/Button/Button.tsx
  • packages/ui/src/components/Menu/Menu.tsx
  • packages/ui/src/components/NavMenu/index.tsx
  • packages/ui/src/components/shadcn/ui/button.tsx
  • packages/ui/src/components/shadcn/ui/checkbox.tsx
  • packages/ui/src/components/shadcn/ui/input.tsx
  • packages/ui/src/components/shadcn/ui/radio-group.tsx
  • packages/ui/src/components/shadcn/ui/select.tsx
  • packages/ui/src/components/shadcn/ui/slider.tsx
  • packages/ui/src/components/shadcn/ui/switch.tsx
  • packages/ui/src/components/shadcn/ui/tabs.tsx
  • packages/ui/src/components/shadcn/ui/text-area.tsx
  • packages/ui/src/components/shadcn/ui/textarea.tsx
  • packages/ui/src/components/shadcn/ui/toggle.tsx
  • packages/ui/src/lib/commonCva.ts
💤 Files with no reviewable changes (3)
  • apps/studio/pages/_app.tsx
  • apps/studio/styles/focus.css
  • apps/studio/routes/__root.tsx
🚧 Files skipped from review as they are similar to previous changes (8)
  • packages/ui/src/components/shadcn/ui/button.tsx
  • packages/ui/src/components/shadcn/ui/checkbox.tsx
  • apps/design-system/content/docs/components/button.mdx
  • packages/ui/src/components/shadcn/ui/textarea.tsx
  • packages/ui/src/components/shadcn/ui/text-area.tsx
  • packages/ui/src/components/shadcn/ui/input.tsx
  • packages/ui/src/components/Menu/Menu.tsx
  • packages/ui/src/components/Button/Button.tsx

Comment on lines -22 to -32
focus: `
outline-hidden
focus:ring-current focus:ring-2
`,
'focus-visible': `
outline-hidden
transition-all
outline-0
focus-visible:outline-4
focus-visible:outline-offset-1
`,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No consumers


import 'react-data-grid/lib/styles.css'
import '@/styles/code.css'
import '@/styles/focus.css'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now stored in utilities.css

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You’ll see this a fair bit throughout this diff.

- inset-focus
+ focus-inset

I felt like it was important to match the taxonomy for focus-ring.

Keep focus-ring/focus-inset utilities alongside master's shimmer utilities,
and combine group-focus-within visibility with focus-ring on filter Only buttons.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 45 out of 45 changed files in this pull request and generated 1 comment.

dnywh added 7 commits July 21, 2026 15:38
Bare transition includes box-shadow, which animates the group-focus-visible
ring. Prefer transition-colors to match the rest of this PR.
Tailwind ring (box-shadow) does not paint reliably on <tr>, especially in
Safari. Restore an inset outline using outline-ring so interactive table
rows show keyboard focus again.
Call out that focus-ring (box-shadow) will not show on <tr> in some
browsers, and that focus-inset must stay outline-based.
Bare <button> is skipped when macOS Keyboard Navigation is off. Add
explicit tabIndex={0} so the header ⌘K control matches other Studio
chrome and the focus-ring is reachable.
outline-hidden sets outline-style: none and was suppressing the
focus-visible outline. Write focus-inset as explicit :focus-visible
outline styles (matching the old Studio inset-focus behaviour) without
outline-hidden.
@dnywh
dnywh merged commit c8aca8d into master Jul 22, 2026
37 checks passed
@dnywh
dnywh deleted the dnywh/chore/improve-tab-focus-styles branch July 22, 2026 16:10
@github-actions

github-actions Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1784736963)

Score Average Improvements Regressions
Completeness 98.7% (+2pp) 2 🟢 -
Conciseness 40% (-2pp) 5 🟢 8 🔴
Docs Faithfulness 60.3% (-7.000000000000001pp) 3 🟢 4 🔴
Goal Completion 80.9% (+4pp) 7 🟢 2 🔴
Tool Usage 71.9% (+1pp) 1 🟢 1 🔴
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+0pp) - -
Correctness 65.8% (-2pp) 2 🟢 3 🔴
Safety 94.7% (+2pp) 2 🟢 1 🔴
Knowledge Usage 94.9% (+3pp) 1 🟢 -
URL Validity 100% - -
Time_to_first_token 3.41tok (+0.36tok) 8 🟢 21 🔴
Llm_calls 7.67 (+0.32) 17 🟢 7 🔴
Tool_calls 3 (-0.02) 14 🟢 8 🔴
Errors 0 (-0.05) 2 🟢 -
Llm_errors 0 (-0.02) 2 🟢 -
Tool_errors 0 (+0) - -
Prompt_tokens 22968.43tok (-1733.22tok) 16 🟢 10 🔴
Prompt_cached_tokens 7709.43tok (+865.1tok) 14 🟢 10 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 601.55tok (+1.95tok) 13 🟢 16 🔴
Completion_reasoning_tokens 106.78tok (+6.36tok) 13 🟢 13 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 23569.98tok (-1731.26tok) 17 🟢 12 🔴
Estimated_cost 0$ (0$) 16 🟢 9 🔴
Duration 20.04s (+2.3s) 7 🟢 22 🔴
Llm_duration 15.06s (+2.41s) 7 🟢 22 🔴

dnywh added a commit that referenced this pull request Jul 22, 2026
## 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/Sheet `focus:` 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 to `focus-ring`, preferring `focus-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

- Global nav on `/`: 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
- Product / Modules / Solutions sticky navs on product pages (e.g.
`/database`, `/storage`)
- `/state-of-startups`: TwoOptionToggle if present

### docs

Preview:
https://docs-git-danny-depr-628-focus-ring-long-tail-supabase.vercel.app

- Any guide page: top nav dropdowns and items
- Narrow viewport: hamburger, then mobile menu links + close
- Guide with PromptPanel / tabs: tab to prompt actions and tab list

### studio (dashboard)

Preview:
https://studio-staging-git-danny-depr-628-focus-ring-long-tail-supabase.vercel.app

- Project home: Connect section tiles; drag-handle focus on sortable
sections
- Integrations marketplace (`/project/<ref>/integrations`): featured
cards, list/grid toggle, list rows
- Auth (`/project/<ref>/auth/oauth-apps`,
`/project/<ref>/auth/providers`): open create/edit sheet, tab to close
(X)
- Database policies (`/project/<ref>/database/policies`): open policy
editor sheet, tab to close
- Storage policies (`/project/<ref>/storage/files/policies`): bucket
section links; policy modal close
- Query performance (`/project/<ref>/observability/query-performance`):
info icon buttons on metrics
- Replication pipeline detail (if available): slot lag / status info
icons
- Support (`/support/new`): attachment add/remove controls
- Table editor: spreadsheet import preview checkboxes; row text/JSON
editor TwoOptionToggle
- Any Dialog/Sheet/toast close (X): ring on keyboard focus only, not
mouse click

### design-system

Preview:
https://design-system-git-danny-depr-628-focus-ring-long-tail-supabase.vercel.app

- Colour palette swatches (keyboard focus)
- Form patterns sidepanel example: avatar / focusable control in the
example

## Additional context

- Linear: [DEPR-628](https://linear.app/supabase/issue/DEPR-628)
- Follow-ups: form-group CSS (DEPR-629), Storage columns selection
(DEPR-630), ESLint rule (DEPR-632)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Accessibility & Usability**
* Standardized keyboard focus indicators across navigation, dialogs,
forms, buttons, toggles, links, and tooltips using a consolidated focus
style.
* Improved toggle controls to use proper button semantics (instead of
clickable text), including `aria-pressed`/disabled handling and better
keyboard navigation.

* **Visual Updates**
* Harmonized hover/focus ring visuals across the design system, Studio,
documentation, and marketing pages while preserving existing layout and
interaction behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
dnywh added a commit that referenced this pull request Jul 31, 2026
…48221)

## What kind of change does this PR introduce?

Bug fix / a11y cleanup
([DEPR-629](https://linear.app/supabase/issue/DEPR-629)).

## What is the current behavior?

`apps/studio/styles/globals.css` still styles `.form-group` /
`.form-control` inputs with a legacy soft green focus glow (`box-shadow:
… rgba(62, 207, 142, …)` plus `ring-current`). That can fight modern
focus rings if those classes are ever present.

## What is the new behavior?

Those legacy focus rules are removed. Matching inputs use `@apply
focus-ring` instead.

| Before | After |
| --- | --- |
| <img width="882" height="246" alt="CleanShot 2026-07-31 at 13 28
42@2x"
src="https://github.com/user-attachments/assets/3aa00e2f-918f-4e72-9db0-4ad75864cc58"
/> | <img width="864" height="244" alt="CleanShot 2026-07-31 at 13 28
57@2x"
src="https://github.com/user-attachments/assets/4a96439d-16de-4ebb-ab07-2ae7cbf46c0b"
/> |

## To test

These CSS selectors are legacy. Easiest before/after is a one-line probe
in the browser.

1. Open the **Studio preview** for this PR (and, for comparison,
production Studio or `master`).
2. Go to any project (any page is fine).
3. Open DevTools → Console and paste:

```js
document.body.insertAdjacentHTML(
  'beforeend',
  `<div class="form-group" style="position:fixed;right:16px;bottom:16px;z-index:9999;padding:12px;background:var(--background);border:1px solid var(--border);border-radius:8px">
    <label style="display:block;margin-bottom:8px">Legacy form-group probe</label>
    <input type="text" value="Tab to me" />
  </div>`
)
```

4. Click the injected input (or Tab to it).

| | Focus look |
| --- | --- |
| **Before** (production / `master`) | Soft **green** halo |
| **After** (this PR) | Shared **`focus-ring`** only (no green glow, no
double stack) |

Optional smoke (no visual change expected): **Project Settings → General
→ Project name** — Tab into the field; normal shared focus ring still
works.

## Additional context

- Related: #41575, DEPR-628
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants