Skip to content

Update layout of existing destination panel + add some improvements - #41429

Merged
joshenlim merged 4 commits into
masterfrom
joshen/fe-2284-update-existing-replication-panel-ui-bigquery-analytics
Dec 17, 2025
Merged

joshenlim merged 4 commits into
masterfrom
joshen/fe-2284-update-existing-replication-panel-ui-bigquery-analytics

Conversation

@joshenlim

@joshenlim joshenlim commented Dec 17, 2025 •

Copy link
Copy Markdown
Member

Context

Initial groundwork for unifying read replicas + replication into a single UI, changes here are mainly to update the existing DestinationPanel + add some improvements from past feedbacks

Project: https://linear.app/supabase/project/dashboard-replication-ui-32556f2d3e60/updates
Ticket: https://linear.app/supabase/issue/FE-2284/update-existing-replication-panel-ui-bigquery-analytics-bucket

image

Changes involved

  • Update "Type" section of destination panel + shift it up top
  • Change form input layouts to horizontal (originally vertical)
  • Removed a number of section descriptions (fields are pretty self explanatory, so they felt unnecessary, makes UI less wordy as well)
  • Added support for creating an analytics bucket while setting up destination (opens the form in a sheet)
    • Refactored CreateAnalyticsBucketModal, extracting the form into a single component to allow it to be rendered in either a Dialog or Sheet
  • A number of other minor clean ups (e.g padding, spacing, etc)

To test

  • Verify that you can create an analytics bucket through the Storage UI
  • Verify that you can create an analytics bucket through the Destination panel
  • Verify that you can set up a destination (some fake values will work, just need to ensure that the creation itself is successful)

Summary by CodeRabbit

  • New Features

    • Create analytics buckets inline from the replication workflow via a new creation sheet and form.
    • Option to create new namespaces during bucket selection.
  • UI/UX Improvements

    • Redesigned destination panel with more compact, horizontal field layouts and clearer grouping.
    • Improved bucket/S3 key guidance, inline badges, and admonitions.
    • Dynamic bucket limits now reflect project configuration.

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

@joshenlim
joshenlim requested a review from a team as a code owner December 17, 2025 10:23
@vercel

vercel Bot commented Dec 17, 2025 •

Copy link
Copy Markdown

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

Project Deployment Review Updated (UTC)
studio-self-hosted Ready Ready Preview, Comment Dec 17, 2025 1:24pm
studio-staging Ready Ready Preview, Comment Dec 17, 2025 1:24pm
6 Skipped Deployments
Project Deployment Review Updated (UTC)
studio Ignored Ignored Dec 17, 2025 1:24pm
cms Skipped Skipped Dec 17, 2025 1:24pm
design-system Skipped Skipped Dec 17, 2025 1:24pm
docs Skipped Skipped Dec 17, 2025 1:24pm
ui-library Skipped Skipped Dec 17, 2025 1:24pm
zone-www-dot-com Skipped Skipped Dec 17, 2025 1:24pm

@supabase

supabase Bot commented Dec 17, 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 17, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

The pull request refactors the Replication DestinationPanel UI by converting form layouts from vertical to horizontal across multiple fields, introduces a new bucket creation workflow for Analytics Buckets, and adds new components (CreateAnalyticsBucketForm, CreateAnalyticsBucketSheet) to enable in-UI bucket creation integrated with the destination selection flow.

Changes

Cohort / File(s) Change Summary
DestinationPanel Layout & Form Structure
AdvancedSettings.tsx, DestinationNameInput.tsx, PublicationSelection.tsx
Converted FormItemLayout components from vertical to horizontal orientation. Removed descriptions or restructured label presentation. Updated wrapper styling and accordion content for flexible column layout.
DestinationTypeSelection UI Redesign
DestinationTypeSelection.tsx
Replaced static headers with compact labels and conditional Admonition banners. Enhanced radio group options with custom rendering: BigQuery and Analytics Bucket now display styled blocks with icons, titles, and descriptions instead of plain labels.
DestinationPanel Core & Field Management
DestinationPanel.tsx, DestinationPanelFields.tsx
Integrated CreateAnalyticsBucketSheet import and state management. Restructured form layout to include DestinationTypeSelection and DialogSectionSeparator. Updated AnalyticsBucketFields to accept onSelectNewBucket callback and added "Create a new bucket" dropdown option. Enhanced S3 key selection with dynamic descriptions and admonition handling. Converted all field FormItemLayout alignments to horizontal.
Supporting Panel Components
NewPublicationPanel.tsx, PublicationsComboBox.tsx
Simplified SheetContent and SheetHeader structure in NewPublicationPanel. Updated MultiSelector Trigger with badgeLimit and mode props. Added align and text sizing adjustments to PublicationsComboBox PopoverContent and CommandInput.
Analytics Bucket Creation Flow
CreateAnalyticsBucketForm.tsx, CreateAnalyticsBucketSheet.tsx, CreateAnalyticsBucketModal.tsx, AnalyticsBuckets/index.tsx
Introduced CreateAnalyticsBucketForm with form validation (zod schema), mutation handling (bucket creation, wrappers extension, Iceberg wrapper), and dual UI modes (dialog/sheet). Added CreateAnalyticsBucketSheet for sheet-based bucket creation. Refactored CreateAnalyticsBucketModal to delegate logic to CreateAnalyticsBucketForm. Made max bucket limit dynamic in AnalyticsBuckets index.

Sequence Diagram

sequenceDiagram
    participant User
    participant DP as DestinationPanel
    participant DPBF as DestinationPanelFields
    participant CABS as CreateAnalyticsBucketSheet
    participant CABF as CreateAnalyticsBucketForm
    participant API as Backend API

    User->>DP: Opens destination panel for Analytics Bucket
    activate DP
    DP->>DPBF: Renders AnalyticsBucketFields with onSelectNewBucket
    deactivate DP
    activate DPBF
    
    User->>DPBF: Clicks "Create a new bucket" in dropdown
    DPBF->>DP: Calls onSelectNewBucket()
    deactivate DPBF
    
    activate DP
    DP->>DP: Sets newBucketSheetVisible = true
    DP->>CABS: Renders sheet with open=true
    deactivate DP
    
    activate CABS
    CABS->>CABF: Renders CreateAnalyticsBucketForm (type="sheet")
    deactivate CABS
    
    activate CABF
    User->>CABF: Enters bucket name and submits form
    CABF->>CABF: Validates form data against zod schema
    
    alt Validation Success
        CABF->>API: Create bucket mutation
        activate API
        API-->>CABF: Bucket created
        deactivate API
        
        CABF->>API: Enable wrappers extension (if needed)
        activate API
        API-->>CABF: Extension enabled
        deactivate API
        
        CABF->>API: Create Iceberg wrapper
        activate API
        API-->>CABF: Wrapper created
        deactivate API
        
        CABF->>CABF: Log telemetry event
        CABF->>CABF: Show success toast
        CABF->>CABF: Call onOpenChange(false)
    else Validation Failed
        CABF->>CABF: Show error toast
    end
    deactivate CABF
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~35 minutes

  • CreateAnalyticsBucketForm: Complex form logic with zod validation, multiple mutations (bucket creation, wrappers extension, Iceberg wrapper), conditional UI for upgrade notices, and telemetry tracking—requires careful validation of error handling and mutation sequencing.
  • DestinationPanel and DestinationPanelFields integration: New callback wiring, state management for sheet visibility, and dropdown option handling need verification for correct prop passing and state flow.
  • FormItemLayout consistency: Multiple files converting from vertical to horizontal layouts—verify all changes are applied uniformly and that responsive behavior is preserved.

Possibly related PRs

Suggested reviewers

  • charislam
  • dnywh
  • soedirgo

Poem

🐰 A hop, skip, and a schema bound,
Forms lay flat where once they'd round,
Buckets bloom from sheets anew,
Mutations dance—validation's true!
Horizontal vibes, the panels sing,
New workflows wing by wing! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main changes: updating the destination panel layout and adding improvements, which aligns with the primary objectives of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description follows the repository template, includes context with linear project/ticket links, clearly describes all changes involved, provides test steps with checkboxes, and includes a visual screenshot.
✨ 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 joshen/fe-2284-update-existing-replication-panel-ui-bigquery-analytics

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: 2

🧹 Nitpick comments (6)
apps/studio/components/interfaces/Database/Replication/NewPublicationPanel.tsx (1)

56-75: Form submission and reset logic is sound.

The form properly resets after submission (success or error), and early returns for guard clauses prevent invalid submissions. However, consider whether console.error is the appropriate mechanism for internal guard clause violations—these typically indicate a bug rather than a recoverable error. A more structured logging approach or error boundary might be more appropriate for production code.

apps/studio/components/interfaces/Database/Replication/DestinationPanel/AdvancedSettings.tsx (1)

38-38: Consider a more explicit approach for child layout.

The CSS selector [&>div]:flex [&>div]:flex-col [&>div]:gap-y-4 applies styling to the internal structure of AccordionContent_Shadcn_. While functional, this approach is fragile and depends on the component's internal DOM structure. If the internal structure changes, this styling will break.

Consider wrapping the form fields in an explicit container:

-          <AccordionContent_Shadcn_ className="!pb-0 pt-3 [&>div]:flex [&>div]:flex-col [&>div]:gap-y-4">
+          <AccordionContent_Shadcn_ className="!pb-0 pt-3">
+            <div className="flex flex-col gap-y-4">
             {/* Batch wait time - applies to all destinations */}
             <FormField_Shadcn_
               ...
             />
             {/* BigQuery-specific: Max staleness */}
             ...
+            </div>
           </AccordionContent_Shadcn_>
apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx (1)

160-176: Consider rollback for partial failures.

The sequential operations (create bucket → enable extension → create wrapper) could leave inconsistent state if a later step fails. For example, if createIcebergWrapper fails after the bucket is created, the user may see an orphaned bucket.

Consider either:

  1. Adding cleanup logic in the catch block to delete the created bucket on wrapper creation failure
  2. Or documenting this behavior for users so they know to retry or manually clean up
apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanelFields.tsx (3)

462-490: Use Input from ui-patterns with actions prop for consistency.

The S3 Secret Access Key field uses Input_Shadcn_ with absolute positioning for the eye/eyeOff button (line 484: className="w-7 absolute right-6 top-[4px]"), while the Catalog Token field (lines 353-370) uses Input from ui-patterns with the actions prop. This inconsistency creates a maintenance issue and the absolute positioning is fragile.

Apply this pattern for consistency:

              <FormItemLayout
                layout="horizontal"
                label="S3 Secret Access Key"
-               className="relative px-5"
+               className="px-5"
                description="The secret key corresponding to your selected access key ID"
              >
                <FormControl_Shadcn_>
-                 <Input_Shadcn_
+                 <Input
                    {...field}
                    type={showSecretAccessKey ? 'text' : 'password'}
                    value={field.value ?? ''}
                    placeholder="Provide the secret access key"
+                   actions={
+                     <div className="flex items-center justify-center">
+                       <Button
+                         type="default"
+                         className="w-7"
+                         icon={showSecretAccessKey ? <Eye /> : <EyeOff />}
+                         onClick={() => setShowSecretAccessKey(!showSecretAccessKey)}
+                       />
+                     </div>
+                   }
                  />
                </FormControl_Shadcn_>
-               <Button
-                 type="default"
-                 icon={showSecretAccessKey ? <Eye /> : <EyeOff />}
-                 className="w-7 absolute right-6 top-[4px]"
-                 onClick={() => setShowSecretAccessKey(!showSecretAccessKey)}
-               />
              </FormItemLayout>

Note: Input is already imported from 'ui-patterns/DataInputs/Input' on line 28.


379-409: Consider simplifying the description prop.

The description contains complex conditional JSX with multiple Admonition components (lines 389-406). While this provides valuable user feedback, embedding complex conditional logic in the description prop reduces maintainability.

Consider rendering the conditional Admonitions as separate elements after the FormItemLayout:

<FormItemLayout
  layout="horizontal"
  label="S3 Access Key ID"
  description={
    <>
      Access keys are managed in your Storage{' '}
      <InlineLink href={`/project/${projectRef}/storage/s3`}>S3 settings</InlineLink>
    </>
  }
  className="px-5"
>
  {/* FormControl content */}
</FormItemLayout>

{isSuccessKeys && keyNoLongerExists && (
  <Admonition type="warning" title="Unable to find access key ID in project" className="mx-5">
    {/* Admonition content */}
  </Admonition>
)}

{s3AccessKeyId === CREATE_NEW_KEY && (
  <Admonition type="default" title="A new set of S3 access keys will be created" className="mx-5" />
)}

This separates concerns and makes the FormItemLayout more focused on the form field itself.


180-239: Consider extracting repeated loading/error/success pattern.

The loading/error/success button pattern is repeated across three select fields (bucket, namespace, and s3AccessKeyId). Each renders a disabled button with loader or warning icon based on query state.

Extracting this into a reusable component would reduce duplication and improve maintainability:

const SelectLoadingState = ({ 
  isLoading, 
  isError, 
  loadingText, 
  errorText 
}: { 
  isLoading: boolean
  isError: boolean
  loadingText: string
  errorText: string
}) => {
  if (isLoading) {
    return (
      <Button
        disabled
        type="default"
        className="w-full justify-between"
        size="small"
        iconRight={<Loader2 className="animate-spin" />}
      >
        {loadingText}
      </Button>
    )
  }
  
  if (isError) {
    return (
      <Button
        disabled
        type="default"
        className="w-full justify-start"
        size="small"
        icon={<WarningIcon />}
      >
        {errorText}
      </Button>
    )
  }
  
  return null
}

This would reduce the component length and make the pattern more consistent across fields.

Also applies to: 254-273, 411-457

📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e5f410f and 17679ad.

📒 Files selected for processing (12)
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/AdvancedSettings.tsx (2 hunks)
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationNameInput.tsx (1 hunks)
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx (6 hunks)
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanelFields.tsx (15 hunks)
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx (3 hunks)
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/PublicationSelection.tsx (1 hunks)
  • apps/studio/components/interfaces/Database/Replication/NewPublicationPanel.tsx (2 hunks)
  • apps/studio/components/interfaces/Database/Replication/PublicationsComboBox.tsx (1 hunks)
  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx (1 hunks)
  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketModal.tsx (2 hunks)
  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketSheet.tsx (1 hunks)
  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/index.tsx (3 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
apps/studio/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/studio-best-practices.mdc)

apps/studio/**/*.{ts,tsx}: Assign complex conditions to descriptive variables instead of using multiple conditions in a single expression
Use consistent naming conventions for boolean variables: is prefix for state/identity, has prefix for possession, can prefix for capability/permission, should prefix for conditional behavior
Derive boolean state from existing state instead of storing it separately
Use early returns for guard clauses instead of deeply nested conditionals
Extract complex logic into custom hooks when logic becomes reusable or complex
Return objects from custom hooks instead of arrays for better extensibility and clearer API
Use discriminated unions for complex state management instead of multiple independent state fields
Avoid type casting (e.g., as any, as Type); instead validate values at runtime using zod schemas

Files:

  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/PublicationSelection.tsx
  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx
  • apps/studio/components/interfaces/Database/Replication/NewPublicationPanel.tsx
  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketSheet.tsx
  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/index.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx
  • apps/studio/components/interfaces/Database/Replication/PublicationsComboBox.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationNameInput.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/AdvancedSettings.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanelFields.tsx
  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketModal.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx
apps/studio/**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/studio-best-practices.mdc)

apps/studio/**/*.tsx: Components should ideally be under 200-300 lines; break down large components with multiple distinct UI sections, complex conditional rendering, or multiple unrelated useState hooks
Extract repeated JSX patterns into reusable components instead of copying similar JSX blocks
Use consistent loading/error/success pattern: handle loading state first with early returns, then error state, then empty state, then render success state
Keep state as local as possible and only lift up when needed
Group related state using objects or reducers instead of multiple useState calls, preferring react-hook-form for form state management
Name event handlers consistently: use on prefix for prop callbacks and handle prefix for internal handlers
Avoid inline arrow functions for expensive operations; use useCallback to maintain stable function references
Use appropriate conditional rendering patterns: && for simple show/hide, ternary for binary choice, early returns or extracted components for multiple conditions
Avoid nested ternaries in JSX; use separate conditions or early returns instead
Use useMemo for expensive computations when the computation is genuinely expensive and the value is passed to memoized children
Define prop interfaces explicitly for React components with proper typing of props and callback handlers

Files:

  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/PublicationSelection.tsx
  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx
  • apps/studio/components/interfaces/Database/Replication/NewPublicationPanel.tsx
  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketSheet.tsx
  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/index.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx
  • apps/studio/components/interfaces/Database/Replication/PublicationsComboBox.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationNameInput.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/AdvancedSettings.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanelFields.tsx
  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketModal.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx
🧠 Learnings (28)
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : Use FormItemLayout with layout='horizontal' for side panel forms in wide panels (size='lg')

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/PublicationSelection.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationNameInput.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/AdvancedSettings.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanelFields.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : Always use FormItemLayout instead of manually composing FormItem, FormLabel, FormMessage, and FormDescription

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/PublicationSelection.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationNameInput.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/AdvancedSettings.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanelFields.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : Use FormItemLayout with layout='flex-row-reverse' for horizontal alignment in page layouts, wrapped in a Card with each field in CardContent and CardFooter for actions

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/PublicationSelection.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationNameInput.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/AdvancedSettings.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanelFields.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : Use FormItemLayout with layout='vertical' for side panel forms in narrow panels (size='sm' or below)

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/PublicationSelection.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationNameInput.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/AdvancedSettings.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanelFields.tsx
📚 Learning: 2025-12-12T05:20:17.409Z
Learnt from: joshenlim
Repo: supabase/supabase PR: 41258
File: apps/studio/pages/project/[ref]/storage/vectors/buckets/[bucketId].tsx:9-9
Timestamp: 2025-12-12T05:20:17.409Z
Learning: In apps/studio/**/*.{ts,tsx}, use named imports for DefaultLayout: import { DefaultLayout } from 'components/layouts/DefaultLayout' instead of default import. This is the new practice being adopted across the studio app.

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/PublicationSelection.tsx
  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx
  • apps/studio/components/interfaces/Database/Replication/NewPublicationPanel.tsx
  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketSheet.tsx
  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/index.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx
  • apps/studio/components/interfaces/Database/Replication/PublicationsComboBox.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationNameInput.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/AdvancedSettings.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanelFields.tsx
  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketModal.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/pages/**/*.{ts,tsx} : Add table actions to primary and secondary actions of PageLayout if table is main content of a page without search or filters

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/PublicationSelection.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : Build forms with react-hook-form and zod for validation

Applied to files:

  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx
  • apps/studio/components/interfaces/Database/Replication/NewPublicationPanel.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx
  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketModal.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/interfaces/**/*.{ts,tsx} : Create a new component in apps/studio/components/interfaces for the contents of each new page

Applied to files:

  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx
  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketSheet.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : When submit button is outside the form, add a formId variable outside the component, set it as id on form element and form prop on the button

Applied to files:

  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx
📚 Learning: 2025-12-11T16:46:18.690Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-best-practices.mdc:0-0
Timestamp: 2025-12-11T16:46:18.690Z
Learning: Applies to apps/studio/**/*.tsx : Define prop interfaces explicitly for React components with proper typing of props and callback handlers

Applied to files:

  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : Use SheetHeader, SheetTitle, SheetSection, and SheetFooter for consistent sheet structure

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/NewPublicationPanel.tsx
  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketSheet.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : Use sheets when revealing complicated forms or information relating to an object where context switching to a new page would be disruptive

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/NewPublicationPanel.tsx
  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketSheet.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx
📚 Learning: 2025-12-11T17:04:40.001Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.001Z
Learning: Applies to apps/studio/**/*.{ts,tsx} : Use _Shadcn_ suffixed components (e.g., Input_Shadcn_, Button_Shadcn_) from the ui package where possible

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/NewPublicationPanel.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : Use Select_Shadcn_ with SelectTrigger_Shadcn_, SelectContent_Shadcn_, and SelectItem_Shadcn_ for select form fields

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/NewPublicationPanel.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanelFields.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : Place submit/cancel buttons in SheetFooter for forms in sheets

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/NewPublicationPanel.tsx
  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketSheet.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : Use SheetContent with size='lg' for forms that need horizontal layout in sheets

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/NewPublicationPanel.tsx
  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketSheet.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : Use MultiSelector component from ui-patterns/multi-select for multi-select form fields

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/NewPublicationPanel.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : Use RadioGroupStacked with RadioGroupStackedItem for stacked radio options with descriptions

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : Use useFieldArray from react-hook-form for dynamic add/remove form fields

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx
📚 Learning: 2025-12-11T16:46:18.690Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-best-practices.mdc:0-0
Timestamp: 2025-12-11T16:46:18.690Z
Learning: Applies to apps/studio/**/*.tsx : Group related state using objects or reducers instead of multiple useState calls, preferring react-hook-form for form state management

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : Use Checkbox_Shadcn_ with label for checkbox form fields, and multiple checkboxes for checkbox groups

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : Use FormItemLayout without form control for action fields with buttons for navigation or performable actions, wrapping buttons in a div with justify-end

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationNameInput.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/AdvancedSettings.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanelFields.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : Use Switch component with checked and onCheckedChange props for toggle form fields

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : Use Calendar inside Popover_Shadcn_ with a trigger button for date picker form fields

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/PublicationsComboBox.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : Use Input_Shadcn_ with placeholder for text input form fields

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationNameInput.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanelFields.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : Use Input_Shadcn_ with type='number' and onChange handler for number input form fields

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/AdvancedSettings.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : Always wrap form inputs with FormControl_Shadcn_ to ensure proper form integration

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/AdvancedSettings.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : Use Input_Shadcn_ with type='password' for password input form fields

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanelFields.tsx
🧬 Code graph analysis (8)
apps/studio/components/interfaces/Database/Replication/DestinationPanel/PublicationSelection.tsx (3)
apps/studio/components/interfaces/Database/Replication/PublicationsComboBox.tsx (1)
  • PublicationsComboBox (28-145)
packages/ui-patterns/src/admonition.tsx (1)
  • Admonition (83-180)
apps/studio/components/ui/InlineLink.tsx (1)
  • InlineLink (17-44)
apps/studio/components/interfaces/Database/Replication/NewPublicationPanel.tsx (1)
packages/ui/src/components/shadcn/ui/sheet.tsx (4)
  • SheetContent (233-233)
  • SheetHeader (236-236)
  • SheetTitle (238-238)
  • SheetDescription (234-234)
apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketSheet.tsx (3)
apps/studio/components/interfaces/Storage/Storage.constants.ts (1)
  • BUCKET_TYPES (63-88)
packages/ui/src/components/shadcn/ui/sheet.tsx (4)
  • Sheet (231-231)
  • SheetContent (233-233)
  • SheetHeader (236-236)
  • SheetTitle (238-238)
apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx (2)
  • CreateAnalyticsBucketForm (110-110)
  • CreateAnalyticsBucketForm (118-281)
apps/studio/components/interfaces/Storage/AnalyticsBuckets/index.tsx (2)
apps/studio/data/config/project-storage-config-query.ts (1)
  • useProjectStorageConfigQuery (41-53)
packages/ui/index.tsx (2)
  • TooltipTrigger (240-240)
  • TooltipContent (241-241)
apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx (4)
packages/ui-patterns/src/admonition.tsx (1)
  • Admonition (83-180)
blocks/vue/registry/default/lib/utils.ts (1)
  • cn (5-7)
packages/ui/src/components/radio-group-stacked.tsx (1)
  • RadioGroupStackedItem (108-108)
apps/studio/data/storage/analytics-buckets-query.ts (1)
  • AnalyticsBucket (12-12)
apps/studio/components/interfaces/Database/Replication/DestinationPanel/AdvancedSettings.tsx (1)
packages/ui/src/components/shadcn/ui/badge.tsx (1)
  • Badge (43-43)
apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanelFields.tsx (4)
apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.schema.ts (1)
  • DestinationPanelSchemaType (69-69)
apps/studio/components/ui/InlineLink.tsx (1)
  • InlineLink (17-44)
packages/ui-patterns/src/admonition.tsx (1)
  • Admonition (83-180)
apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.constants.ts (1)
  • CREATE_NEW_KEY (2-2)
apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx (2)
apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx (1)
  • DestinationTypeSelection (20-95)
apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanelFields.tsx (1)
  • AnalyticsBucketFields (108-494)
⏰ 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: test
  • GitHub Check: typecheck
  • GitHub Check: test (1)
🔇 Additional comments (22)
apps/studio/components/interfaces/Database/Replication/NewPublicationPanel.tsx (3)

80-85: Sheet structure aligns well with UI patterns.

The simplification from a composite header structure to using SheetTitle and SheetDescription directly is clean and follows the learnings for consistent sheet layout. The size="default" prop is appropriate for this form.


118-122: MultiSelector.Trigger refactoring improves clarity.

The shift to a props-based API (badgeLimit="wrap", label="Select tables...", mode="inline-combobox") is more declarative and maintainable than the previous nested component structure. Ensure that this new API is used consistently across other forms in the codebase.


1-24: Imports are clean and all used.

All imports are consumed in the component. The removal of unused imports (like the X icon mentioned in the AI summary) maintains good import hygiene.

apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationNameInput.tsx (1)

17-17: LGTM! Layout change aligns with PR objectives.

The change to horizontal layout is consistent with the broader UI refactoring effort to convert form layouts from vertical to horizontal. This follows the established pattern for wide side panels.

Based on learnings, FormItemLayout with layout='horizontal' is the correct choice for side panel forms in wide panels (size='lg').

apps/studio/components/interfaces/Database/Replication/DestinationPanel/AdvancedSettings.tsx (2)

46-46: LGTM! Layout change aligns with PR objectives.

The conversion from vertical to horizontal layout for the "Batch wait time" field is correct and follows the established pattern for wide panel forms.

Based on learnings, FormItemLayout with layout='horizontal' is the correct approach for side panel forms in wide panels.


64-89: LGTM! BigQuery field successfully converted to horizontal layout.

The restructuring of the maxStalenessMins field correctly implements the horizontal layout pattern with proper form control integration. The label structure with the Badge inline is an appropriate solution for displaying the "BigQuery only" indicator in the horizontal layout.

Based on learnings, this follows the correct pattern for side panel forms with FormItemLayout horizontal layout, FormControl_Shadcn_ wrapping, and proper number input handling.

apps/studio/components/interfaces/Database/Replication/PublicationsComboBox.tsx (1)

81-88: LGTM!

Minor styling adjustments for popover alignment and input text sizing align well with the PR's UI layout updates.

apps/studio/components/interfaces/Storage/AnalyticsBuckets/index.tsx (2)

45-47: LGTM!

Good improvement replacing the hardcoded bucket limit with a dynamic value from the project storage config. The default fallback of 2 maintains backward compatibility when config is unavailable.


108-114: LGTM!

The UI correctly reflects the dynamic bucket limit in both the badge and tooltip.

apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketModal.tsx (1)

10-26: LGTM!

Good refactor extracting the form logic into CreateAnalyticsBucketForm, enabling reuse across both the modal and sheet contexts while maintaining the same public API.

apps/studio/components/interfaces/Database/Replication/DestinationPanel/PublicationSelection.tsx (1)

54-102: LGTM!

The horizontal FormItemLayout aligns with the PR's form layout updates and follows the coding guidelines for side panel forms in wide panels. The conditional rendering for warning admonitions is clean and preserves the existing validation feedback.

apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketSheet.tsx (1)

1-26: LGTM!

The sheet component follows the established pattern from the modal and correctly uses SheetHeader/SheetTitle for consistent structure. The form delegates to CreateAnalyticsBucketForm with type="sheet" to render appropriate section/footer components.

apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx (2)

26-34: LGTM!

Clean header structure with a helpful Admonition in edit mode clearly communicating the type immutability constraint.


44-88: LGTM!

The custom radio item rendering with icons and descriptions provides improved visual hierarchy. The grid layout and custom rounding classes create a polished card-style selection UI.

apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx (4)

95-95: LGTM!

New state for controlling the analytics bucket creation sheet visibility follows the existing pattern used for publicationPanelVisible.


441-445: LGTM!

Good UX consideration: the dynamic right-20 offset prevents the main panel from being obscured when either nested sheet is open. The size="lg" properly supports horizontal form layouts per coding guidelines.


463-491: LGTM!

The restructured form layout cleanly separates type selection from destination details, with proper section separators and the new onSelectNewBucket callback enabling the inline bucket creation flow.


528-531: LGTM!

The CreateAnalyticsBucketSheet is properly wired to the newBucketSheetVisible state for visibility control.

apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx (2)

37-106: LGTM!

Comprehensive Zod validation schema with well-structured refinements for bucket naming rules. The validation messages are clear and user-friendly.


192-278: LGTM!

The dynamic Section/Footer pattern elegantly handles both dialog and sheet modes. The conditional Admonition for extension upgrade requirements provides clear user guidance.

apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanelFields.tsx (2)

33-97: LGTM! Layout changes align with UI guidelines.

The conversion to horizontal layout for all form fields follows the established pattern for side panel forms. The inline heading (line 36) improves visual organization.

Based on learnings, FormItemLayout with layout='horizontal' is correct for side panel forms in wide panels.


205-234: LGTM! New bucket creation flow is well-implemented.

The logic correctly handles the "new-bucket" selection by invoking the callback, and appropriately resets the namespace field when switching buckets (since namespaces are bucket-specific). The SelectSeparator provides good visual separation for the action item.

@github-actions

github-actions Bot commented Dec 17, 2025 •

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results

passed  67 passed
skipped  4 skipped

Details

stats  71 tests across 12 suites
duration  6 minutes, 52 seconds
commit  0ab263b

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

@alaister alaister left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

  • Tested on preview

One small one I noticed was the "Create a new destination" panel is quite wide – it's taking up ~50% of my screen

@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: 0

🧹 Nitpick comments (2)
apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx (2)

151-189: Consider typing the caught error more safely.

Line 186 uses error: any which bypasses type safety. Consider using unknown and validating the error structure, or use a type guard.

-    } catch (error: any) {
-      toast.error(`Failed to create bucket: ${error.message}`)
+    } catch (error) {
+      const message = error instanceof Error ? error.message : 'Unknown error'
+      toast.error(`Failed to create bucket: ${message}`)
     }

199-224: Remove unnecessary key prop.

The key="name" attribute on FormField_Shadcn_ is unnecessary since this field is not rendered within a list or map iteration.

             <FormField_Shadcn_
-              key="name"
               name="name"
               control={form.control}
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 17679ad and 0ab263b.

📒 Files selected for processing (2)
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx (7 hunks)
  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx
🧰 Additional context used
📓 Path-based instructions (2)
apps/studio/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/studio-best-practices.mdc)

apps/studio/**/*.{ts,tsx}: Assign complex conditions to descriptive variables instead of using multiple conditions in a single expression
Use consistent naming conventions for boolean variables: is prefix for state/identity, has prefix for possession, can prefix for capability/permission, should prefix for conditional behavior
Derive boolean state from existing state instead of storing it separately
Use early returns for guard clauses instead of deeply nested conditionals
Extract complex logic into custom hooks when logic becomes reusable or complex
Return objects from custom hooks instead of arrays for better extensibility and clearer API
Use discriminated unions for complex state management instead of multiple independent state fields
Avoid type casting (e.g., as any, as Type); instead validate values at runtime using zod schemas

Files:

  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx
apps/studio/**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/studio-best-practices.mdc)

apps/studio/**/*.tsx: Components should ideally be under 200-300 lines; break down large components with multiple distinct UI sections, complex conditional rendering, or multiple unrelated useState hooks
Extract repeated JSX patterns into reusable components instead of copying similar JSX blocks
Use consistent loading/error/success pattern: handle loading state first with early returns, then error state, then empty state, then render success state
Keep state as local as possible and only lift up when needed
Group related state using objects or reducers instead of multiple useState calls, preferring react-hook-form for form state management
Name event handlers consistently: use on prefix for prop callbacks and handle prefix for internal handlers
Avoid inline arrow functions for expensive operations; use useCallback to maintain stable function references
Use appropriate conditional rendering patterns: && for simple show/hide, ternary for binary choice, early returns or extracted components for multiple conditions
Avoid nested ternaries in JSX; use separate conditions or early returns instead
Use useMemo for expensive computations when the computation is genuinely expensive and the value is passed to memoized children
Define prop interfaces explicitly for React components with proper typing of props and callback handlers

Files:

  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx
🧠 Learnings (11)
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : Build forms with react-hook-form and zod for validation

Applied to files:

  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/interfaces/**/*.{ts,tsx} : Create a new component in apps/studio/components/interfaces for the contents of each new page

Applied to files:

  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx
📚 Learning: 2025-12-11T16:46:18.690Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-best-practices.mdc:0-0
Timestamp: 2025-12-11T16:46:18.690Z
Learning: Applies to apps/studio/**/*.tsx : Define prop interfaces explicitly for React components with proper typing of props and callback handlers

Applied to files:

  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx
📚 Learning: 2025-12-11T17:04:40.001Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.001Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : Do not introduce new UI components unless asked to; check packages/ui/index.tsx for available components before composing interfaces

Applied to files:

  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : When submit button is outside the form, add a formId variable outside the component, set it as id on form element and form prop on the button

Applied to files:

  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx
📚 Learning: 2025-12-11T16:46:18.690Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-best-practices.mdc:0-0
Timestamp: 2025-12-11T16:46:18.690Z
Learning: Applies to apps/studio/**/*.tsx : Components should ideally be under 200-300 lines; break down large components with multiple distinct UI sections, complex conditional rendering, or multiple unrelated useState hooks

Applied to files:

  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx
📚 Learning: 2025-12-11T16:46:18.690Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-best-practices.mdc:0-0
Timestamp: 2025-12-11T16:46:18.690Z
Learning: Applies to apps/studio/**/*.tsx : Group related state using objects or reducers instead of multiple useState calls, preferring react-hook-form for form state management

Applied to files:

  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : Use useFieldArray from react-hook-form for dynamic add/remove form fields

Applied to files:

  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx
📚 Learning: 2025-12-11T17:04:40.002Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.002Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : When doing a mutation, always use the mutate function with onSuccess and onError callbacks that include toast.success and toast.error

Applied to files:

  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx
📚 Learning: 2025-12-11T16:46:18.690Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-best-practices.mdc:0-0
Timestamp: 2025-12-11T16:46:18.690Z
Learning: Applies to apps/studio/**/*.{ts,tsx} : Use consistent naming conventions for boolean variables: `is` prefix for state/identity, `has` prefix for possession, `can` prefix for capability/permission, `should` prefix for conditional behavior

Applied to files:

  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx
📚 Learning: 2025-12-12T05:20:17.409Z
Learnt from: joshenlim
Repo: supabase/supabase PR: 41258
File: apps/studio/pages/project/[ref]/storage/vectors/buckets/[bucketId].tsx:9-9
Timestamp: 2025-12-12T05:20:17.409Z
Learning: In apps/studio/**/*.{ts,tsx}, use named imports for DefaultLayout: import { DefaultLayout } from 'components/layouts/DefaultLayout' instead of default import. This is the new practice being adopted across the studio app.

Applied to files:

  • apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx
🧬 Code graph analysis (1)
apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx (8)
apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.utils.ts (3)
  • reservedPrefixes (12-12)
  • reservedSuffixes (13-13)
  • validBucketNameRegex (14-14)
apps/studio/hooks/misc/useSelectedOrganization.ts (1)
  • useSelectedOrganizationQuery (5-21)
apps/studio/hooks/misc/useSelectedProject.ts (1)
  • useSelectedProjectQuery (5-17)
apps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/useIcebergWrapper.tsx (1)
  • useIcebergWrapperExtension (5-35)
apps/studio/data/storage/analytics-buckets-query.ts (1)
  • useAnalyticsBucketsQuery (33-50)
apps/studio/data/storage/analytics-bucket-create-mutation.ts (1)
  • useAnalyticsBucketCreateMutation (30-60)
apps/studio/data/database-extensions/database-extension-enable-mutation.ts (1)
  • useDatabaseExtensionEnableMutation (46-79)
apps/studio/lib/constants/index.ts (1)
  • DOCS_URL (48-48)
⏰ 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: test (1)
  • GitHub Check: test
  • GitHub Check: typecheck
🔇 Additional comments (7)
apps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsx (7)

1-35: LGTM!

Imports are well-organized, using react-hook-form with zod resolver as per best practices, and all mutation/query hooks are appropriately imported.


37-106: LGTM!

The zod schema provides comprehensive validation with clear, specific error messages for each naming rule violation. Good use of superRefine for complex conditional validation logic.


108-110: LGTM!

Form ID correctly defined outside the component for the submit button reference pattern. Type export enables type-safe usage.


112-115: LGTM!

Clean props interface with explicit typing. The type discriminator enables flexible rendering in dialog or sheet contexts.


117-149: LGTM!

Good use of derived state for isCreating combining multiple pending states. The silenced error handler in useAnalyticsBucketCreateMutation is appropriately documented with a comment explaining it's handled in onSubmit.


191-192: LGTM!

Clean pattern for conditionally selecting container components based on the type prop.


265-277: LGTM!

Footer buttons correctly implement disabled and loading states, with proper form association via formId for the submit button.

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.

2 participants