Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
6 Skipped Deployments
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
WalkthroughThe 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 ( Changes
Sequence DiagramsequenceDiagram
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~35 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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.erroris 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-4applies 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
createIcebergWrapperfails after the bucket is created, the user may see an orphaned bucket.Consider either:
- Adding cleanup logic in the catch block to delete the created bucket on wrapper creation failure
- 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) usesInputfrom ui-patterns with theactionsprop. 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:
Inputis 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
📒 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:isprefix for state/identity,hasprefix for possession,canprefix for capability/permission,shouldprefix 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.tsxapps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsxapps/studio/components/interfaces/Database/Replication/NewPublicationPanel.tsxapps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketSheet.tsxapps/studio/components/interfaces/Storage/AnalyticsBuckets/index.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsxapps/studio/components/interfaces/Database/Replication/PublicationsComboBox.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationNameInput.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/AdvancedSettings.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanelFields.tsxapps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketModal.tsxapps/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: useonprefix for prop callbacks andhandleprefix 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.tsxapps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsxapps/studio/components/interfaces/Database/Replication/NewPublicationPanel.tsxapps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketSheet.tsxapps/studio/components/interfaces/Storage/AnalyticsBuckets/index.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsxapps/studio/components/interfaces/Database/Replication/PublicationsComboBox.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationNameInput.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/AdvancedSettings.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanelFields.tsxapps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketModal.tsxapps/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.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationNameInput.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/AdvancedSettings.tsxapps/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.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationNameInput.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/AdvancedSettings.tsxapps/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.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationNameInput.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/AdvancedSettings.tsxapps/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.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationNameInput.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/AdvancedSettings.tsxapps/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.tsxapps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketForm.tsxapps/studio/components/interfaces/Database/Replication/NewPublicationPanel.tsxapps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketSheet.tsxapps/studio/components/interfaces/Storage/AnalyticsBuckets/index.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsxapps/studio/components/interfaces/Database/Replication/PublicationsComboBox.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationNameInput.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/AdvancedSettings.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanelFields.tsxapps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketModal.tsxapps/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.tsxapps/studio/components/interfaces/Database/Replication/NewPublicationPanel.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsxapps/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.tsxapps/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.tsxapps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketSheet.tsxapps/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.tsxapps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketSheet.tsxapps/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.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsxapps/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.tsxapps/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.tsxapps/studio/components/interfaces/Storage/AnalyticsBuckets/CreateAnalyticsBucketSheet.tsxapps/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.tsxapps/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.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationNameInput.tsxapps/studio/components/interfaces/Database/Replication/DestinationPanel/AdvancedSettings.tsxapps/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.tsxapps/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
SheetTitleandSheetDescriptiondirectly is clean and follows the learnings for consistent sheet layout. Thesize="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
2maintains 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
FormItemLayoutaligns 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/SheetTitlefor consistent structure. The form delegates toCreateAnalyticsBucketFormwithtype="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-20offset prevents the main panel from being obscured when either nested sheet is open. Thesize="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
onSelectNewBucketcallback enabling the inline bucket creation flow.
528-531: LGTM!The
CreateAnalyticsBucketSheetis properly wired to thenewBucketSheetVisiblestate 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/Footerpattern 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.
🎭 Playwright Test ResultsDetails
Skipped testsFeatures › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected |
alaister
left a comment
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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: anywhich bypasses type safety. Consider usingunknownand 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 unnecessarykeyprop.The
key="name"attribute onFormField_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
📒 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:isprefix for state/identity,hasprefix for possession,canprefix for capability/permission,shouldprefix 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: useonprefix for prop callbacks andhandleprefix 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
superRefinefor 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
typediscriminator enables flexible rendering in dialog or sheet contexts.
117-149: LGTM!Good use of derived state for
isCreatingcombining multiple pending states. The silenced error handler inuseAnalyticsBucketCreateMutationis appropriately documented with a comment explaining it's handled inonSubmit.
191-192: LGTM!Clean pattern for conditionally selecting container components based on the
typeprop.
265-277: LGTM!Footer buttons correctly implement disabled and loading states, with proper form association via
formIdfor the submit button.
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 feedbacksProject: 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
Changes involved
CreateAnalyticsBucketModal, extracting the form into a single component to allow it to be rendered in either a Dialog or SheetTo test
Summary by CodeRabbit
New Features
UI/UX Improvements
✏️ Tip: You can customize this high-level summary in your review settings.