Repository navigation
Conversation
|
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 Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR replaces direct ChangesStudio form subscriptions
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 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. |
5ba2bfd to
9848f1e
Compare
🎭 Playwright Test Results (tanstack)Details
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.
there's also a refactor to remove unnecessary useState for enableSmtp
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (3)
apps/studio/components/interfaces/BranchManagement/CreateBranchModal.tsx (1)
114-117: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRename the boolean local to communicate its predicate.
Alias
withDatatohasData(and update its local consumers) so boolean conditions read naturally.🤖 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/interfaces/BranchManagement/CreateBranchModal.tsx` around lines 114 - 117, Rename the destructured withData value from useWatch in CreateBranchModal to hasData, and update all local consumers to use hasData so boolean conditions read naturally. Keep the form field name withData unchanged.Source: Coding guidelines
apps/studio/components/interfaces/Auth/AuditLogsForm.tsx (1)
72-74: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winScope this watcher to
AUDIT_LOG_DISABLE_POSTGRES.This currently watches the entire form although only one value is consumed. Add
name: 'AUDIT_LOG_DISABLE_POSTGRES'and assign the returned boolean directly. This also fulfills the PR’s “name what you watch” objective.🤖 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/interfaces/Auth/AuditLogsForm.tsx` around lines 72 - 74, Update the useWatch call in the audit logs form to specify name: 'AUDIT_LOG_DISABLE_POSTGRES' and assign its returned boolean directly to formValueDisablePostgres, removing the whole-form destructuring. Preserve the existing control binding and downstream usage.apps/studio/components/interfaces/Integrations/Queues/QueuesSettings.tsx (1)
51-51: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse state-prefixed names for newly introduced boolean locals.
These watched booleans should use
is,has,can, orshouldprefixes while preserving their existing RHF field names.
apps/studio/components/interfaces/Integrations/Queues/QueuesSettings.tsx#L51-L51: renameenabletoisEnabled.apps/studio/components/interfaces/Organization/NewOrg/NewOrgForm.tsx#L204-L205: renameselectedSpendCaptoisSpendCapEnabled.apps/studio/components/interfaces/Organization/SSO/JoinOrganizationOnSignup.tsx#L22-L22: renamejoinOrgOnSignuptoshouldJoinOrgOnSignuporisJoinOrgOnSignupEnabled.apps/studio/components/interfaces/Organization/SSO/SSOConfig.tsx#L132-L133: renameenableSpInitiatedtoisSpInitiatedEnabled.apps/studio/components/interfaces/Organization/TeamSettings/InviteMemberButton.tsx#L154-L157: renameapplyToOrgtoshouldApplyToOrg.apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooksEndpointSheet.tsx#L199-L200: renamesubscribeAlltoshouldSubscribeToAllorisSubscribedToAll.apps/studio/components/interfaces/Realtime/RealtimeSettings.tsx#L138-L141: renameallow_publicandsuspendtoisPublicAllowedandisSuspended.As per coding guidelines: “Boolean variables and props should read as
is,has,can, orshould.”🤖 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/interfaces/Integrations/Queues/QueuesSettings.tsx` at line 51, Rename the boolean locals and all their references to state-prefixed names while preserving the existing RHF field names: in apps/studio/components/interfaces/Integrations/Queues/QueuesSettings.tsx:51 use isEnabled; apps/studio/components/interfaces/Organization/NewOrg/NewOrgForm.tsx:204-205 use isSpendCapEnabled; apps/studio/components/interfaces/Organization/SSO/JoinOrganizationOnSignup.tsx:22 use shouldJoinOrgOnSignup or isJoinOrgOnSignupEnabled; apps/studio/components/interfaces/Organization/SSO/SSOConfig.tsx:132-133 use isSpInitiatedEnabled; apps/studio/components/interfaces/Organization/TeamSettings/InviteMemberButton.tsx:154-157 use shouldApplyToOrg; apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooksEndpointSheet.tsx:199-200 use shouldSubscribeToAll or isSubscribedToAll; and apps/studio/components/interfaces/Realtime/RealtimeSettings.tsx:138-141 use isPublicAllowed and isSuspended.Source: Coding guidelines
🤖 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/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/CreateTable/CreateTableSheet.tsx`:
- Around line 243-251: Update the columns rendering to map over the
useFieldArray fields collection, using each field’s id as the ColumnRow key
while retaining the index for the dynamic form path and removeColumn callback.
Preserve the existing ColumnRow props and behavior.
- Around line 288-349: Remove the `as keyof typeof COLUMN_TYPE_FIELDS` and `as
any` casts in `ColumnRow`. Properly type `COLUMN_TYPE_FIELDS` and the related
`COLUMN_TYPES`/field-name definitions so `columnType` indexing and
`columns.${idx}.${x.name}` are valid typed paths, then pass the inferred `name`
directly to `FormField`.
---
Nitpick comments:
In `@apps/studio/components/interfaces/Auth/AuditLogsForm.tsx`:
- Around line 72-74: Update the useWatch call in the audit logs form to specify
name: 'AUDIT_LOG_DISABLE_POSTGRES' and assign its returned boolean directly to
formValueDisablePostgres, removing the whole-form destructuring. Preserve the
existing control binding and downstream usage.
In `@apps/studio/components/interfaces/BranchManagement/CreateBranchModal.tsx`:
- Around line 114-117: Rename the destructured withData value from useWatch in
CreateBranchModal to hasData, and update all local consumers to use hasData so
boolean conditions read naturally. Keep the form field name withData unchanged.
In `@apps/studio/components/interfaces/Integrations/Queues/QueuesSettings.tsx`:
- Line 51: Rename the boolean locals and all their references to state-prefixed
names while preserving the existing RHF field names: in
apps/studio/components/interfaces/Integrations/Queues/QueuesSettings.tsx:51 use
isEnabled;
apps/studio/components/interfaces/Organization/NewOrg/NewOrgForm.tsx:204-205 use
isSpendCapEnabled;
apps/studio/components/interfaces/Organization/SSO/JoinOrganizationOnSignup.tsx:22
use shouldJoinOrgOnSignup or isJoinOrgOnSignupEnabled;
apps/studio/components/interfaces/Organization/SSO/SSOConfig.tsx:132-133 use
isSpInitiatedEnabled;
apps/studio/components/interfaces/Organization/TeamSettings/InviteMemberButton.tsx:154-157
use shouldApplyToOrg;
apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooksEndpointSheet.tsx:199-200
use shouldSubscribeToAll or isSubscribedToAll; and
apps/studio/components/interfaces/Realtime/RealtimeSettings.tsx:138-141 use
isPublicAllowed and isSuspended.
🪄 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 Plus
Run ID: 17882d4d-d470-4eca-b54a-b81326a5a0d4
📒 Files selected for processing (69)
apps/studio/components/interfaces/Account/AccessTokens/Scoped/NewScopedTokenSheet.tsxapps/studio/components/interfaces/Account/Preferences/DeleteAccountButton.tsxapps/studio/components/interfaces/Advisors/CreateRuleSheet.tsxapps/studio/components/interfaces/Auth/AuditLogsForm.tsxapps/studio/components/interfaces/Auth/BasicAuthSettingsForm.tsxapps/studio/components/interfaces/Auth/EmailTemplates/TemplateEditor.tsxapps/studio/components/interfaces/Auth/Hooks/CreateHookSheet.tsxapps/studio/components/interfaces/Auth/MfaAuthSettingsForm/MfaAuthSettingsForm.tsxapps/studio/components/interfaces/Auth/OAuthApps/CreateOrUpdateOAuthAppSheet.tsxapps/studio/components/interfaces/Auth/OAuthApps/OAuthServerSettingsForm.tsxapps/studio/components/interfaces/Auth/PerformanceSettingsForm.tsxapps/studio/components/interfaces/Auth/RateLimits/RateLimits.tsxapps/studio/components/interfaces/Auth/RedirectUrls/AddNewURLModal.tsxapps/studio/components/interfaces/Auth/SmtpForm/SmtpForm.tsxapps/studio/components/interfaces/Auth/ThirdPartyAuthForm/CreateAwsCognitoAuthDialog.tsxapps/studio/components/interfaces/Auth/Users/BanUserModal.tsxapps/studio/components/interfaces/Billing/Payment/PaymentMethods/NewPaymentMethodElement.tsxapps/studio/components/interfaces/BranchManagement/CreateBranchModal.tsxapps/studio/components/interfaces/Database/Extensions/EnableExtensionModal.tsxapps/studio/components/interfaces/Database/Functions/CreateFunction/index.tsxapps/studio/components/interfaces/Database/Policies/PolicyEditorPanel/index.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/AnalyticsBucket/Fields.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/DuckLake/Fields.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/PublicationSelection.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/TableCopySelection.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/index.tsxapps/studio/components/interfaces/Database/Triggers/TriggerSheet.tsxapps/studio/components/interfaces/DiskManagement/DiskManagementForm.tsxapps/studio/components/interfaces/DiskManagement/fields/AutoScaleFields.tsxapps/studio/components/interfaces/DiskManagement/fields/ComputeSizeField.tsxapps/studio/components/interfaces/DiskManagement/fields/IOPSField.tsxapps/studio/components/interfaces/DiskManagement/fields/ThroughputField.tsxapps/studio/components/interfaces/DiskManagement/ui/ComputeSizeRecommendationSection.tsxapps/studio/components/interfaces/DiskManagement/ui/DiskSpaceBar.tsxapps/studio/components/interfaces/DiskManagement/ui/DiskTypeRecommendationSection.tsxapps/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionTesterSheet.tsxapps/studio/components/interfaces/Integrations/CronJobs/CreateCronJobSheet/CronJobScheduleSection.tsxapps/studio/components/interfaces/Integrations/CronJobs/SqlFunctionSection.tsxapps/studio/components/interfaces/Integrations/Queues/CreateQueueSheet/PartitionConfigFields.tsxapps/studio/components/interfaces/Integrations/Queues/QueuesSettings.tsxapps/studio/components/interfaces/Integrations/Wrappers/CreateIcebergWrapperSheet.tsxapps/studio/components/interfaces/LogDrains/LogDrainDestinationSheetForm.tsxapps/studio/components/interfaces/Organization/BillingSettings/BillingCustomerData/BillingCustomerDataForm.tsxapps/studio/components/interfaces/Organization/BillingSettings/BillingEmail.tsxapps/studio/components/interfaces/Organization/BillingSettings/CreditTopUp.tsxapps/studio/components/interfaces/Organization/CloudMarketplace/NewAwsMarketplaceOrgForm.tsxapps/studio/components/interfaces/Organization/NewOrg/NewOrgForm.tsxapps/studio/components/interfaces/Organization/SSO/JoinOrganizationOnSignup.tsxapps/studio/components/interfaces/Organization/SSO/SSOConfig.tsxapps/studio/components/interfaces/Organization/TeamSettings/InviteMemberButton.tsxapps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooksEndpointSheet.tsxapps/studio/components/interfaces/ProjectCreation/PostgresVersionSelector.tsxapps/studio/components/interfaces/Realtime/RealtimeSettings.tsxapps/studio/components/interfaces/Settings/API/DataApiEnableSwitchForm.tsxapps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsxapps/studio/components/interfaces/Settings/Database/JitDatabaseAccess/JitDbAccessRuleSheet.tsxapps/studio/components/interfaces/Settings/General/CustomDomainConfig/CustomDomainsConfigureHostname.tsxapps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GitHubIntegrationConnectionForm.tsxapps/studio/components/interfaces/Settings/Integrations/GithubIntegration/GitHubRepositoryField.tsxapps/studio/components/interfaces/SignIn/ResetPasswordForm.tsxapps/studio/components/interfaces/SignIn/SignInMfaForm.tsxapps/studio/components/interfaces/SignIn/SignUpForm.tsxapps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/CreateTable/CreateTableSheet.tsxapps/studio/components/interfaces/Storage/CreateBucketModal.tsxapps/studio/components/interfaces/Storage/EditBucketModal.tsxapps/studio/components/interfaces/Storage/StorageSettings/StorageSettings.tsxapps/studio/components/interfaces/Support/LinkSupportTicketForm.tsxapps/studio/components/interfaces/Support/SupportFormV2.tsxapps/studio/components/interfaces/Support/SupportFormV3.tsx
There was a problem hiding this comment.
Preview test — ✅ all pass
The PR doesn't have a "To test" section, so I smoke-tested a broad sample of the refactored forms on the studio-staging preview — for each one: open the surface, change a watched field, and confirm the reactive UI still responds (conditional fields, live previews, warnings, dirty-state save buttons). Nothing was saved or submitted.
| # | Surface | Result |
|---|---|---|
| 1 | Sign-up form (password requirements) | ✅ requirement indicators update live weak → strong, button enables |
| 2 | Auth → Sign In / Providers | ✅ toggling "Allow new users to sign up" flips dirty state correctly both ways |
| 3 | Auth → Rate limits | ✅ "requests per hour" helper text recomputes live on value change |
| 4 | Auth → SMTP (biggest refactor) | ✅ Enable custom SMTP toggle shows/hides all 6 credential fields both directions |
| 5 | Auth → Email templates | ✅ subject edit enables Save, preview toggle renders body, dirty state resets on revert |
| 6 | Auth → MFA settings | ✅ all 3 sections render, switch toggles track dirty state correctly |
| 7 | Settings → Compute and Disk | ✅ selecting a different compute size shows the review bar; reverting hides it |
| 8 | Settings → Database / Connect (pooling) | ✅ pooling section renders; connection string flips 5432 ↔ 6543 with pooler selection |
| 9 | Settings → Storage (file size limit) | ✅ value change enables Save |
| 10 | Storage → New bucket modal | ✅ public-bucket warning appears/disappears; restrict-file-size reveals numeric input |
| 11 | Database → Enable extension modal | ✅ schema selector swaps between new-schema input and existing-schema dropdown |
| 12 | Database → Create function sheet | ✅ opens cleanly; argument rows add/remove reactively |
| 13 | Database → Create trigger sheet | ⚪ skipped — test project has no user tables, so "New trigger" is disabled (env limitation) |
| 14 | Org → Invite member dialog | ✅ opens, role radio + email input register (cancelled, no invite sent) |
| 15 | Org → Billing (email + address forms) | ✅ both forms' Save buttons track edits; email dirty state resets on revert |
| 16 | New org form | ✅ Free → Pro reveals spend cap + payment sections; reverting hides them |
| 17 | Support form (sidebar) | ✅ category change swaps contextual troubleshooting note; typing registers (not submitted) |
| 18 | Account → Scoped access token sheet | ✅ "Selected orgs" reveals org picker; adding a permission row updates the table reactively |
Notes:
- No new console errors attributable to the refactor on any surface, and no crashes/error boundaries anywhere.
- One quirk spotted but pre-existing, not from this PR: on number fields (Rate limits, Storage file size limit), retyping the exact original value doesn't re-disable Save, while text fields and switches reset correctly. The diff only changes how those values are read (
form.watch→useWatch), not dirty tracking, so it's unrelated — likely the usual string-vs-numberisDirtycomparison. - Paid/infra-gated surfaces (SSO config, custom domains, log drains, replication destinations, marketplace, payment methods) and destructive flows (delete account, ban user) weren't exercised.
Braintrust eval report
|
Context
Replaces all usage of
form.watch()to useuseWatchinstead + follows the "name what you watch" convention as specified in the react-hook-form skills.There's also a small refactor in
SmtpForm.tsxwhich removes the unnecessary use of auseStateto track if SMTP is enabled or notSummary by CodeRabbit