Skip to content

chore: db settings form pattern#41263

Merged
fsansalvadore merged 7 commits into
masterfrom
chore/db-settings-forms
Dec 11, 2025
Merged

chore: db settings form pattern#41263
fsansalvadore merged 7 commits into
masterfrom
chore/db-settings-forms

Conversation

@fsansalvadore

@fsansalvadore fsansalvadore commented Dec 11, 2025

Copy link
Copy Markdown
Contributor

Align the Database settings form to the new standardized form patterns.

Before After
image image

Summary by CodeRabbit

  • Style

    • Unified layout using consistent page sections and card scaffolding across database settings for cleaner spacing and alignment; minor visual text color refinements.
  • New Features

    • Key settings components now load dynamically to improve initial page load.
  • UX

    • Loading, error and empty states use card-based placeholders; notices, docs links and existing actions retain prior behavior but are reorganized for clarity.

✏️ Tip: You can customize this high-level summary in your review settings.

@fsansalvadore fsansalvadore requested review from a team as code owners December 11, 2025 11:32
@vercel

vercel Bot commented Dec 11, 2025

Copy link
Copy Markdown

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

Project Deployment Preview Comments Updated (UTC)
cms Ready Ready Preview Comment Dec 11, 2025 5:14pm
design-system Ready Ready Preview Comment Dec 11, 2025 5:14pm
docs Ready Ready Preview Comment Dec 11, 2025 5:14pm
studio-self-hosted Ready Ready Preview Comment Dec 11, 2025 5:14pm
studio-staging Ready Ready Preview Comment Dec 11, 2025 5:14pm
ui-library Ready Ready Preview Comment Dec 11, 2025 5:14pm
zone-www-dot-com Ready Ready Preview Comment Dec 11, 2025 5:14pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
studio Ignored Ignored Dec 11, 2025 5:14pm

@supabase

supabase Bot commented Dec 11, 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 ↗︎.

@coderabbitai

coderabbitai Bot commented Dec 11, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Refactors multiple database/settings UI components from legacy FormHeader/FormPanel layouts to PageSection and Card-based primitives, converts several static imports to dynamic next/dynamic on the settings page, and applies small shared UI classname adjustments. No public APIs or component signatures changed.

Changes

Cohort / File(s) Summary
Database settings — PageSection / Card migration
apps/studio/components/interfaces/DiskManagement/DiskManagementPanelForm.tsx, apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx, apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsx, apps/studio/components/interfaces/Settings/Database/DatabaseSettings/ResetDbPassword.tsx, apps/studio/components/interfaces/Settings/Database/DiskSizeConfiguration.tsx, apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx, apps/studio/components/interfaces/Settings/Database/SSLConfiguration.tsx
Replaced FormHeader/FormPanel/FormSection and ad-hoc div layouts with PageSection composition and Card/CardContent scaffolding; moved DocsButton into section meta where applicable; reorganized content into PageSectionMeta/PageSectionContent and used FormLayout/PrePostTab in places. Existing modals, permissions, tooltips, and behavior preserved.
Settings page — dynamic loading
apps/studio/pages/project/[ref]/database/settings.tsx
Replaced static imports with next/dynamic for several settings components, simplified wrappers, and adjusted spacing utilities (space-y-4 md:space-y-8); retained feature-flag conditional rendering.
Shared UI packages — small style tweaks
packages/ui-patterns/src/form/Layout/FormLayout.tsx, packages/ui/src/components/shadcn/ui/card.tsx, packages/ui/src/components/PrePostTab/PrePostTab.tsx
Minor classname updates: flex-row-reverse variant gained flex-grow; CardDescription class updated to text-foreground-lighter; pre/post tab label color slightly adjusted. No API/signature changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Areas to inspect:
    • Consistent PageSection nesting (Meta, Content, Aside) and DocsButton placement.
    • Loading/error/success UI states moved into Card scaffolds (BannedIPs, NetworkRestrictions, SSLConfiguration).
    • PrePostTab usage and responsive layout changes in ConnectionPooling (flex-row-reverse, width classes).
    • Dynamic imports in settings.tsx for typing and SSR behavior.

Possibly related PRs

Suggested reviewers

  • kemaldotearth
  • joshenlim

Poem

🐇 I hopped through sections, swapped panels for cards,

Docs buttons tucked in like hidden rewards.
Dynamic imports — I leapt with delight,
Layouts refreshed for both day and night.
A tiny rabbit cheers this tidy rewrite.

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'chore: db settings form pattern' is vague and uses non-descriptive terms that don't clearly convey the specific changes being made. Consider a more specific title such as 'refactor: migrate database settings to standardized form patterns' to better describe the scope of changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The PR description partially follows the template structure by explaining the change objective, but omits required sections like 'What kind of change', 'Current/new behavior', and contribution confirmation.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/db-settings-forms

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 022b1bb and d693cf7.

📒 Files selected for processing (1)
  • packages/ui-patterns/src/form/Layout/FormLayout.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/ui-patterns/src/form/Layout/FormLayout.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: typecheck
  • GitHub Check: test
  • GitHub Check: test (1)

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

@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 (1)
apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx (1)

10-11: Remove unused imports.

The FormHeader and FormPanel imports are no longer used after the migration to PageSection and Card patterns.

Apply this diff:

-import { FormHeader } from 'components/ui/Forms/FormHeader'
-import { FormPanel } from 'components/ui/Forms/FormPanel'
🧹 Nitpick comments (2)
apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsx (1)

241-252: Avoid mixing FormField_Shadcn_ with form.register and prefer ?? over || for controlled values

Inside both FormField_Shadcn_ render blocks you’re:

  • Spreading ...field and ...form.register(...) onto the same Input_Shadcn_.
  • For default_pool_size, using value={field.value || ''}.

With Shadcn form primitives the recommended pattern is to rely on FormField_Shadcn_’s field props only, and not call form.register again. Also, || will treat 0 as falsy and replace it with '', which can be surprising even if 0 isn’t expected here.

Consider simplifying to something like this for default_pool_size:

-                      <FormControl_Shadcn_>
-                        <PrePostTab postTab="connections" className="uppercase">
-                          <Input_Shadcn_
-                            {...field}
-                            type="number"
-                            className="w-full"
-                            value={field.value || ''}
-                            placeholder={defaultPoolSize.toString()}
-                            {...form.register('default_pool_size', {
-                              setValueAs: setValueAsNullableNumber,
-                            })}
-                          />
-                        </PrePostTab>
-                      </FormControl_Shadcn_>
+                      <FormControl_Shadcn_>
+                        <PrePostTab postTab="connections" className="uppercase">
+                          <Input_Shadcn_
+                            type="number"
+                            className="w-full"
+                            value={field.value ?? ''}
+                            onChange={(event) =>
+                              field.onChange(
+                                setValueAsNullableNumber(event.target.value)
+                              )
+                            }
+                            placeholder={defaultPoolSize.toString()}
+                          />
+                        </PrePostTab>
+                      </FormControl_Shadcn_>

And for max_client_conn, since the field is disabled and not submitted, you can drop form.register (and even field) entirely and just render a read-only value via PrePostTab:

-                      <FormControl_Shadcn_>
-                        <PrePostTab postTab="clients" className="uppercase">
-                          <Input_Shadcn_
-                            {...field}
-                            type="number"
-                            className="w-full"
-                            value={pgbouncerConfig?.max_client_conn || ''}
-                            disabled={true}
-                            placeholder={defaultMaxClientConn.toString()}
-                            {...form.register('max_client_conn', {
-                              setValueAs: setValueAsNullableNumber,
-                            })}
-                          />
-                        </PrePostTab>
-                      </FormControl_Shadcn_>
+                      <FormControl_Shadcn_>
+                        <PrePostTab postTab="clients" className="uppercase">
+                          <Input_Shadcn_
+                            type="number"
+                            className="w-full"
+                            value={pgbouncerConfig?.max_client_conn ?? defaultMaxClientConn}
+                            disabled
+                          />
+                        </PrePostTab>
+                      </FormControl_Shadcn_>

This keeps the implementation closer to the standard Shadcn form pattern, avoids double-registration with react-hook-form, and handles controlled values more predictably. As per coding guidelines for Studio Shadcn forms.

Also applies to: 301-311

apps/studio/components/interfaces/Settings/Database/DiskSizeConfiguration.tsx (1)

77-208: Consider removing nested Panel usage for consistency.

The migration to PageSection is well-executed, but Line 87 still uses the old Panel component inside the new PageSectionContent. For full consistency with the new patterns, consider replacing Panel with Card throughout.

Apply this pattern to remove the nested Panel:

-          {organization?.usage_billing_enabled === true ? (
-            <div className="flex flex-col gap-3">
-              <Panel className="!m-0">
-                <Panel.Content>
+          {organization?.usage_billing_enabled === true ? (
+            <Card>
+              <CardContent>
                  <div>
                    ...
                  </div>
-                </Panel.Content>
-              </Panel>
-            </div>
+              </CardContent>
+            </Card>

Based on learnings, Card components should be used instead of Panel for grouping related information.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 008dc93 and 800b44e.

📒 Files selected for processing (10)
  • apps/studio/components/interfaces/DiskManagement/DiskManagementPanelForm.tsx (1 hunks)
  • apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx (3 hunks)
  • apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsx (6 hunks)
  • apps/studio/components/interfaces/Settings/Database/DatabaseSettings/ResetDbPassword.tsx (3 hunks)
  • apps/studio/components/interfaces/Settings/Database/DiskSizeConfiguration.tsx (2 hunks)
  • apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx (5 hunks)
  • apps/studio/components/interfaces/Settings/Database/SSLConfiguration.tsx (2 hunks)
  • apps/studio/pages/project/[ref]/database/settings.tsx (3 hunks)
  • packages/ui-patterns/src/form/Layout/FormLayout.tsx (1 hunks)
  • packages/ui/src/components/shadcn/ui/card.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (22)
📓 Common learnings
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to apps/studio/**/*.{ts,tsx} : Use generic ui table components for most tables, contained within a Card
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to apps/studio/pages/**/*.{ts,tsx} : Use related layout components (e.g., AuthLayout) when a page is within an existing section
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to apps/studio/**/*.{ts,tsx} : Use _Shadcn_ form primitives (Form_Shadcn_, FormField_Shadcn_, FormControl_Shadcn_) and prefer FormItemLayout with layout='flex-row-reverse' for form controls
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to apps/studio/**/*.{ts,tsx} : Use ScaffoldSection, ScaffoldSectionTitle, and ScaffoldSectionDescription for multi-section page layouts
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to apps/studio/pages/**/*.{ts,tsx} : Use PageLayout component for new page structures with props: children, title, subtitle, icon, breadcrumbs, primaryActions, secondaryActions, navigationItems, className, size, isCompact
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to apps/studio/**/*.{ts,tsx} : UI components from packages/ui should be imported with _Shadcn_ suffix where applicable (e.g., Input_Shadcn_)
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to apps/studio/**/*.{ts,tsx} : Use CardContent for card sections, CardFooter for actions, and CardHeader/CardTitle only when card content is not described by surrounding content or when using multiple Cards to group related pieces
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to apps/studio/**/*.{ts,tsx} : Wrap forms in a Card component unless specified otherwise
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Read packages/ui/index.tsx file for full list of available components before composing interfaces
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to packages/ui/**/*.{ts,tsx} : Do not introduce new UI components in packages/ui unless explicitly asked to; use existing shadcn/ui-based components
📚 Learning: 2025-12-11T02:40:11.135Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to apps/studio/**/*.{ts,tsx} : Wrap forms in a Card component unless specified otherwise

Applied to files:

  • apps/studio/components/interfaces/Settings/Database/DatabaseSettings/ResetDbPassword.tsx
  • apps/studio/components/interfaces/DiskManagement/DiskManagementPanelForm.tsx
  • apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx
  • apps/studio/components/interfaces/Settings/Database/SSLConfiguration.tsx
  • packages/ui/src/components/shadcn/ui/card.tsx
  • apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx
📚 Learning: 2025-12-11T02:40:11.135Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to apps/studio/**/*.{ts,tsx} : Use CardContent for card sections, CardFooter for actions, and CardHeader/CardTitle only when card content is not described by surrounding content or when using multiple Cards to group related pieces

Applied to files:

  • apps/studio/components/interfaces/Settings/Database/DatabaseSettings/ResetDbPassword.tsx
  • apps/studio/components/interfaces/DiskManagement/DiskManagementPanelForm.tsx
  • apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx
  • apps/studio/components/interfaces/Settings/Database/SSLConfiguration.tsx
  • packages/ui/src/components/shadcn/ui/card.tsx
  • apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx
📚 Learning: 2025-12-11T02:40:11.135Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to apps/studio/**/*.{ts,tsx} : Use _Shadcn_ form primitives (Form_Shadcn_, FormField_Shadcn_, FormControl_Shadcn_) and prefer FormItemLayout with layout='flex-row-reverse' for form controls

Applied to files:

  • apps/studio/components/interfaces/Settings/Database/DatabaseSettings/ResetDbPassword.tsx
  • apps/studio/components/interfaces/Settings/Database/DiskSizeConfiguration.tsx
  • apps/studio/components/interfaces/DiskManagement/DiskManagementPanelForm.tsx
  • apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsx
  • packages/ui-patterns/src/form/Layout/FormLayout.tsx
  • apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx
  • apps/studio/components/interfaces/Settings/Database/SSLConfiguration.tsx
  • packages/ui/src/components/shadcn/ui/card.tsx
  • apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx
  • apps/studio/pages/project/[ref]/database/settings.tsx
📚 Learning: 2025-12-11T02:40:11.135Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to apps/studio/**/*.{ts,tsx} : Use Card component to group related pieces of information

Applied to files:

  • apps/studio/components/interfaces/Settings/Database/DatabaseSettings/ResetDbPassword.tsx
  • apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx
  • packages/ui/src/components/shadcn/ui/card.tsx
  • apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx
📚 Learning: 2025-12-11T02:40:11.135Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to apps/studio/**/*.{ts,tsx} : Use generic ui table components for most tables, contained within a Card

Applied to files:

  • apps/studio/components/interfaces/Settings/Database/DatabaseSettings/ResetDbPassword.tsx
  • apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx
  • apps/studio/components/interfaces/Settings/Database/SSLConfiguration.tsx
  • packages/ui/src/components/shadcn/ui/card.tsx
  • apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx
📚 Learning: 2025-12-11T02:40:11.135Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to apps/studio/pages/**/*.{ts,tsx} : Use PageLayout component for new page structures with props: children, title, subtitle, icon, breadcrumbs, primaryActions, secondaryActions, navigationItems, className, size, isCompact

Applied to files:

  • apps/studio/components/interfaces/Settings/Database/DiskSizeConfiguration.tsx
  • apps/studio/components/interfaces/DiskManagement/DiskManagementPanelForm.tsx
  • packages/ui-patterns/src/form/Layout/FormLayout.tsx
  • apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx
  • apps/studio/pages/project/[ref]/database/settings.tsx
📚 Learning: 2025-12-11T02:40:11.135Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to apps/studio/**/*.{ts,tsx} : Use ScaffoldSection, ScaffoldSectionTitle, and ScaffoldSectionDescription for multi-section page layouts

Applied to files:

  • apps/studio/components/interfaces/Settings/Database/DiskSizeConfiguration.tsx
  • apps/studio/components/interfaces/DiskManagement/DiskManagementPanelForm.tsx
  • apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx
  • apps/studio/components/interfaces/Settings/Database/SSLConfiguration.tsx
  • apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx
  • apps/studio/pages/project/[ref]/database/settings.tsx
📚 Learning: 2025-12-11T02:40:11.135Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to apps/studio/components/interfaces/**/*.{ts,tsx} : Studio-specific components related to individual pages should be placed in apps/studio/components/interfaces

Applied to files:

  • apps/studio/components/interfaces/Settings/Database/DiskSizeConfiguration.tsx
  • apps/studio/components/interfaces/DiskManagement/DiskManagementPanelForm.tsx
  • apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx
  • apps/studio/components/interfaces/Settings/Database/SSLConfiguration.tsx
  • apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx
  • apps/studio/pages/project/[ref]/database/settings.tsx
📚 Learning: 2025-12-11T02:40:11.135Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to apps/studio/pages/**/*.{ts,tsx} : Use related layout components (e.g., AuthLayout) when a page is within an existing section

Applied to files:

  • apps/studio/components/interfaces/Settings/Database/DiskSizeConfiguration.tsx
  • apps/studio/components/interfaces/DiskManagement/DiskManagementPanelForm.tsx
  • apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx
  • apps/studio/pages/project/[ref]/database/settings.tsx
📚 Learning: 2025-12-11T02:40:11.135Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Read packages/ui/index.tsx file for full list of available components before composing interfaces

Applied to files:

  • apps/studio/components/interfaces/Settings/Database/DiskSizeConfiguration.tsx
  • apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx
  • apps/studio/components/interfaces/Settings/Database/SSLConfiguration.tsx
  • apps/studio/pages/project/[ref]/database/settings.tsx
📚 Learning: 2025-12-11T00:21:01.839Z
Learnt from: dnywh
Repo: supabase/supabase PR: 41215
File: apps/design-system/content/docs/accessibility.mdx:30-30
Timestamp: 2025-12-11T00:21:01.839Z
Learning: In apps/design-system/content/docs/, MDX files use different relative path formats based on their location: root-level docs use `components/button` format, while subdirectory docs (ui-patterns/, components/) use `../components/button` format for linking to components.

Applied to files:

  • apps/studio/components/interfaces/Settings/Database/DiskSizeConfiguration.tsx
  • apps/studio/components/interfaces/DiskManagement/DiskManagementPanelForm.tsx
📚 Learning: 2025-12-11T02:40:11.135Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to apps/studio/components/interfaces/**/*.{ts,tsx} : Create a new component in apps/studio/components/interfaces for page contents

Applied to files:

  • apps/studio/components/interfaces/DiskManagement/DiskManagementPanelForm.tsx
  • apps/studio/pages/project/[ref]/database/settings.tsx
📚 Learning: 2025-12-11T02:40:11.135Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to apps/studio/**/*.{ts,tsx} : UI components from packages/ui should be imported with _Shadcn_ suffix where applicable (e.g., Input_Shadcn_)

Applied to files:

  • apps/studio/components/interfaces/DiskManagement/DiskManagementPanelForm.tsx
  • apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsx
  • apps/studio/components/interfaces/Settings/Database/SSLConfiguration.tsx
  • packages/ui/src/components/shadcn/ui/card.tsx
  • apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx
  • apps/studio/pages/project/[ref]/database/settings.tsx
📚 Learning: 2025-12-11T02:40:11.135Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to apps/studio/**/*.{ts,tsx} : Use Sheet component to reveal complicated forms or information relating to an object without context switching to a new page

Applied to files:

  • apps/studio/components/interfaces/DiskManagement/DiskManagementPanelForm.tsx
📚 Learning: 2025-12-11T02:40:11.135Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to apps/studio/**/*.{ts,tsx} : If a form's submit button is outside the form element, create a formId variable and set it as the id prop on the form and formId on the button

Applied to files:

  • apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsx
📚 Learning: 2025-12-11T02:40:11.135Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to apps/studio/**/*.{ts,tsx} : Use Admonition component to alert users of important actions or restrictions

Applied to files:

  • apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx
📚 Learning: 2025-12-11T02:40:11.135Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to apps/studio/**/*.{ts,tsx} : Build forms with react-hook-form + zod

Applied to files:

  • apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx
  • apps/studio/components/interfaces/Settings/Database/SSLConfiguration.tsx
📚 Learning: 2025-12-11T02:40:11.135Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to apps/studio/**/*.{ts,tsx} : Use typography classes from apps/studio/styles/typography.scss instead of hard-coding Tailwind classes (e.g., use 'heading-default' instead of 'text-sm font-medium')

Applied to files:

  • packages/ui/src/components/shadcn/ui/card.tsx
📚 Learning: 2025-12-11T02:40:11.135Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to packages/ui/**/*.{ts,tsx} : Do not introduce new UI components in packages/ui unless explicitly asked to; use existing shadcn/ui-based components

Applied to files:

  • packages/ui/src/components/shadcn/ui/card.tsx
  • apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx
📚 Learning: 2025-12-11T02:40:11.135Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to apps/studio/components/ui/**/*.{ts,tsx} : Studio-specific generic UI components should be placed in apps/studio/components/ui

Applied to files:

  • apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx
📚 Learning: 2025-12-11T02:40:11.135Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T02:40:11.135Z
Learning: Applies to apps/studio/pages/projects/[ref]/**/*.{ts,tsx} : Project-related pages should be organized in apps/studio/pages/projects/[ref]

Applied to files:

  • apps/studio/pages/project/[ref]/database/settings.tsx
🧬 Code graph analysis (4)
apps/studio/components/interfaces/Settings/Database/DatabaseSettings/ResetDbPassword.tsx (1)
packages/ui/src/components/shadcn/ui/card.tsx (2)
  • Card (70-70)
  • CardContent (70-70)
apps/studio/components/interfaces/Settings/Database/DiskSizeConfiguration.tsx (4)
packages/ui-patterns/src/PageSection/index.tsx (4)
  • PageSectionMeta (204-204)
  • PageSectionSummary (205-205)
  • PageSectionTitle (206-206)
  • PageSectionContent (202-202)
apps/studio/lib/constants/index.ts (1)
  • DOCS_URL (48-48)
apps/studio/lib/helpers.ts (1)
  • formatBytes (130-149)
packages/ui/src/components/StatusIcon.tsx (1)
  • InfoIcon (195-195)
apps/studio/components/interfaces/DiskManagement/DiskManagementPanelForm.tsx (4)
packages/common/hooks/useDocsSearch.ts (1)
  • PageSection (297-297)
packages/ui-patterns/src/PageSection/index.tsx (4)
  • PageSectionMeta (204-204)
  • PageSectionSummary (205-205)
  • PageSectionTitle (206-206)
  • PageSectionContent (202-202)
apps/studio/lib/constants/index.ts (1)
  • DOCS_URL (48-48)
apps/studio/components/interfaces/DiskManagement/ui/NoticeBar.tsx (1)
  • NoticeBar (14-34)
apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx (5)
packages/ui-patterns/src/PageSection/index.tsx (5)
  • PageSectionMeta (204-204)
  • PageSectionSummary (205-205)
  • PageSectionTitle (206-206)
  • PageSectionDescription (203-203)
  • PageSectionContent (202-202)
apps/studio/lib/constants/index.ts (1)
  • DOCS_URL (48-48)
packages/ui/src/components/shadcn/ui/card.tsx (2)
  • Card (70-70)
  • CardContent (70-70)
apps/studio/components/ui/AlertError.tsx (1)
  • AlertError (46-89)
packages/ui/src/components/shadcn/ui/badge.tsx (1)
  • Badge (39-39)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: test
  • GitHub Check: test (1)
  • GitHub Check: typecheck
  • GitHub Check: format
🔇 Additional comments (13)
apps/studio/components/interfaces/Settings/Database/ConnectionPooling/ConnectionPooling.tsx (2)

141-173: Layout tweaks (Panel noMargin, form gap, and full-width separator look consistent with the new patterns)

Using noMargin on Panel, tightening the form vertical gap (gap-y-4), and adding the full-width Separator with -mx-6 w-[calc(100%+3rem)] aligns this block with the newer card/section layout patterns and keeps the footer FormActions visually attached to the form. No functional concerns from these changes.

Also applies to: 221-272


229-238: FormItemLayout updates match studio Shadcn form guidelines

Switching both fields to layout="flex-row-reverse" and constraining the control column with [&>div]:md:w-1/2 [&>div]:xl:w-2/5 etc. matches the documented layout pattern for Shadcn-based forms in Studio and will keep labels/descriptions and controls aligned across breakpoints. Looks good as an alignment step with the standardized form pattern.

Also applies to: 278-280

packages/ui-patterns/src/form/Layout/FormLayout.tsx (1)

85-85: LGTM! Layout enhancement aligns with the new form patterns.

Adding flex-grow to the flex-row-reverse layout improves the label container's space utilization, which supports the standardized form patterns being adopted across this PR.

apps/studio/components/interfaces/Settings/Database/DatabaseSettings/ResetDbPassword.tsx (1)

89-117: LGTM! Successfully migrated to standardized form pattern.

The migration from Panel to Card/CardContent with FormLayout follows the established patterns. The flex-row-reverse layout properly places the action button on the right while maintaining the label and description on the left.

Based on learnings, this correctly uses Card to wrap forms and FormLayout with layout='flex-row-reverse' for form controls.

apps/studio/components/interfaces/DiskManagement/DiskManagementPanelForm.tsx (1)

21-46: LGTM! Clean migration to PageSection pattern.

The component successfully adopts the PageSection-based layout with proper meta/content separation and integrated docs access via DocsButton. The NoticeBar functionality is preserved within the new structure.

Based on learnings, this correctly uses PageSection components for multi-section page layouts.

apps/studio/pages/project/[ref]/database/settings.tsx (2)

20-36: LGTM! Dynamic imports optimize page load performance.

Converting static imports to dynamic imports for these settings components improves initial page load time by code-splitting. The proper typing with Next.js dynamic imports is maintained.


53-69: LGTM! Simplified page structure with improved spacing.

The updated PageContainer structure with responsive spacing (space-y-4 md:space-y-8) and direct component rendering creates a cleaner, more maintainable layout.

apps/studio/components/interfaces/Settings/Database/NetworkRestrictions/NetworkRestrictions.tsx (1)

114-301: LGTM! Comprehensive migration to PageSection and Card patterns.

The refactor successfully adopts the standardized layout patterns while preserving all functionality. The proper use of CardHeader (only when listing restrictions) and CardContent for different states aligns with the established guidelines. The PageSectionAside effectively groups action controls.

Based on learnings, this correctly uses CardHeader only when content is not described by surrounding content and CardContent for card sections.

apps/studio/components/interfaces/Settings/Database/BannedIPs.tsx (3)

97-97: TODO comment indicates work in progress.

The TODO comment mentions using mock data for UI testing. Ensure this is intentional for this PR or create a follow-up issue to address it.

Do you want me to create a follow-up issue to track the removal of mock data usage?


112-144: LGTM! Card-based content rendering with proper permission handling.

The conditional rendering with Card components for different states (loading, error, content, empty) is well-structured. The per-IP Unban action with ButtonTooltip properly handles permissions and provides clear user feedback.

Based on learnings, this correctly uses Card to group related information and CardContent for card sections.


95-95: Empty PageSectionContent may be intentional but worth verifying.

The PageSectionContent is empty, with actual content rendered below as sibling elements. This might be by design, but verify if content should be nested inside PageSectionContent instead.

#!/bin/bash
# Description: Check PageSectionContent usage patterns in similar components

# Search for PageSectionContent usage in other database settings files
rg -n "PageSectionContent" apps/studio/components/interfaces/Settings/Database/ -A 5 -B 2
packages/ui/src/components/shadcn/ui/card.tsx (1)

44-44: The CardDescription color change improves accessibility. Both light and dark themes now exceed WCAG AAA contrast requirements (light: 20.38:1, dark: 12.41:1), compared to the previous values. No accessibility concerns exist with this modification.

Likely an incorrect or invalid review comment.

apps/studio/components/interfaces/Settings/Database/SSLConfiguration.tsx (1)

19-37: Imports for new UI and layout primitives look consistent

The new imports from ui and ui-patterns (Card/CardContent, PageSection*, FormLayout, Tooltip bits, Switch, etc.) are all used and align with the standardized Card + PageSection form pattern. No issues here.

@github-actions

github-actions Bot commented Dec 11, 2025

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results

passed  65 passed
skipped  4 skipped

Details

stats  69 tests across 11 suites
duration  9 minutes, 52 seconds
commit  d693cf7

Skipped tests

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

@kemaldotearth kemaldotearth 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.

:shipit:

@fsansalvadore fsansalvadore enabled auto-merge (squash) December 11, 2025 17:17
@coveralls

Copy link
Copy Markdown

Coverage Status

Changes unknown
when pulling d693cf7 on chore/db-settings-forms
into ** on master**.

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.

4 participants