Repository navigation
fix sheets stealing focus - #48521
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (12)
💤 Files with no reviewable changes (2)
📝 WalkthroughWalkthrough
ChangesSheetContent focus behavior
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
| size="lg" | ||
| showClose={false} | ||
| className="flex flex-col gap-0" | ||
| tabIndex={undefined} |
There was a problem hiding this comment.
This tabIndex={undefined} (and all the other removed ones in other files below) was a caller-level workaround.
There was a problem hiding this comment.
Pull request overview
Adjusts the shared SheetContent (Radix-based sheet) to prevent the sheet wrapper from becoming focusable by default, fixing cases where focus jumps to the wrapper after a focused child unmounts and disrupts tab order across Studio sheets.
Changes:
- Set
SheetContent’s defaulttabIndextoundefined(non-focusable wrapper), while still allowing callers to opt-in by passing an explicittabIndex. - Add
SheetContentbehavior tests covering initial autofocus, explicittabIndexopt-in, and avoiding wrapper-focus after child removal. - Remove now-unnecessary
tabIndex={undefined}overrides from multiple Studio sheet call sites.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/ui/src/components/shadcn/ui/sheet.tsx | Makes the sheet wrapper non-focusable by default via tabIndex={undefined}, preserving opt-in override via props. |
| packages/ui/src/components/shadcn/ui/sheet.test.tsx | Adds regression tests for focus behavior and explicit wrapper focusability opt-in. |
| apps/studio/components/interfaces/Storage/VectorBuckets/VectorBucketDetails/VectorBucketTableExamplesSheet.tsx | Removes redundant tabIndex={undefined} on SheetContent. |
| apps/studio/components/interfaces/LogDrains/LogDrainDestinationSheetForm.tsx | Removes redundant tabIndex={undefined} on SheetContent. |
| apps/studio/components/interfaces/Integrations/Wrappers/WrapperTable.tsx | Removes redundant tabIndex={undefined} on SheetContent. |
| apps/studio/components/interfaces/Integrations/Wrappers/WrappersTab.tsx | Removes redundant tabIndex={undefined} on SheetContent. |
| apps/studio/components/interfaces/Integrations/Wrappers/OverviewTab.tsx | Removes redundant tabIndex={undefined} on SheetContent. |
| apps/studio/components/interfaces/Integrations/templates/StripeSyncEngine/OverviewTab.tsx | Removes redundant tabIndex={undefined} on SheetContent. |
| apps/studio/components/interfaces/Integrations/Queues/CreateQueueSheet/CreateQueueSheet.tsx | Removes redundant tabIndex={undefined} on SheetContent. |
| apps/studio/components/interfaces/ConnectSheet/ConnectSheet.tsx | Removes redundant tabIndex={undefined} on SheetContent. |
| apps/studio/components/interfaces/Auth/OAuthApps/CreateOrUpdateOAuthAppSheet.tsx | Removes redundant tabIndex={undefined} on SheetContent. |
| apps/studio/components/interfaces/Auth/CustomAuthProviders/CreateOrUpdateCustomProviderSheet.tsx | Removes redundant tabIndex={undefined} on SheetContent. |
| <SheetPrimitive.Content | ||
| ref={ref} | ||
| className={cn(sheetVariants({ side, size }), className)} | ||
| tabIndex={undefined} |
There was a problem hiding this comment.
So SheetContent is now no longer programmatically focusable by default. This should be the experience in almost all cases anyway: interactive content should get focus.
🎭 Playwright Test Results (next)Details
Skipped testsFeatures › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled |
kemaldotearth
left a comment
There was a problem hiding this comment.
Working as intended ![]()
Braintrust eval report
|
The permissions accordion now starts fully collapsed, so the tests expand the Project category before configuring a permission. The review step also renders the risk as a badge plus a separate description, which the assertions now match. Copying the token needs a real click as well: since #48521 the sheet wrapper is no longer focusable, so nothing holds focus once the form unmounts and copyToClipboard bails out on !document.hasFocus().
What kind of change does this PR introduce?
Bug fix. Resolves DEPR-539.
What is the current behavior?
When a focused child unmounts, Radix can move focus to the Sheet wrapper and break the expected tab order. Several callsites suppress the wrapper's tabindex individually.
What is the new behavior?
Sheet still focuses its first interactive child when opened, but the wrapper itself is no longer focusable by default. Callers can opt in with an explicit
tabIndexwhen needed.Additional context
Testing
Compare this Studio experience on both this branch and
master:On
master, focus can jump to the whole Sheet. On this branch, focus stays on the controls in order.Summary by CodeRabbit