Skip to content

Joshen/fe 2300 alpha notices for replication all needs to be shifted into - #41765

Merged
joshenlim merged 6 commits into
masterfrom
joshen/fe-2300-alpha-notices-for-replication-all-needs-to-be-shifted-into
Jan 8, 2026
Merged

joshenlim merged 6 commits into
masterfrom
joshen/fe-2300-alpha-notices-for-replication-all-needs-to-be-shifted-into

Conversation

@joshenlim

@joshenlim joshenlim commented Jan 7, 2026 •

Copy link
Copy Markdown
Member

Context

Part of unifying replication UI - shifts the CTA to enable replication into the Destination Panel if the feature flag is on, as enabling replication only applies for creating destinations to BigQuery and Analytics Buckets

image

Summary by CodeRabbit

  • New Features

    • Improved replication enablement UI with readiness validation and an interactive callout to guide setup
    • Alpha badges added to BigQuery and Analytics Bucket destination options
    • Plan-aware upgrade prompts for users on free plans, plus direct links to replication docs
  • Improvements

    • Refactored destinations view into a table/card layout for clearer organization of replicas and destinations

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

@joshenlim
joshenlim requested a review from a team as a code owner January 7, 2026 11:00
@vercel

vercel Bot commented Jan 7, 2026 •

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 Jan 8, 2026 4:01am
studio-staging Ready Ready Preview, Comment Jan 8, 2026 4:01am
6 Skipped Deployments
Project Deployment Review Updated (UTC)
cms Ignored Ignored Jan 8, 2026 4:01am
studio Ignored Ignored Jan 8, 2026 4:01am
design-system Skipped Skipped Jan 8, 2026 4:01am
docs Skipped Skipped Jan 8, 2026 4:01am
ui-library Skipped Skipped Jan 8, 2026 4:01am
zone-www-dot-com Skipped Skipped Jan 8, 2026 4:01am

@supabase

supabase Bot commented Jan 7, 2026

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 ↗︎.

@joshenlim
joshenlim changed the base branch from master to joshen/fe-2302-replication-ui-to-also-show-rows-for-read-replicas January 7, 2026 11:00
@coderabbitai

coderabbitai Bot commented Jan 7, 2026 •

Copy link
Copy Markdown
Contributor

Walkthrough

Adds replication readiness wiring to DestinationPanel, conditionally rendering an EnableReplicationCallout when replication isn’t enabled, displays Alpha badges for certain destination types, refactors Destinations into a Card/Table with ReadReplica rows, and extends component props to support callbacks and children.

Changes

Cohort / File(s) Summary
Destination panel & type selection
apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx, apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx
DestinationPanel now reads projectRef, queries replication sources, computes replication readiness, and conditionally renders EnableReplicationCallout instead of the form when appropriate. Adds optional onSuccessCreateReadReplica prop. DestinationTypeSelection shows Alpha badges for BigQuery and Analytics Bucket when unified replication is enabled.
Destinations list & enablement UI
apps/studio/components/interfaces/Database/Replication/Destinations.tsx, apps/studio/components/interfaces/Database/Replication/EnableReplicationCallout.tsx
Replaces previous enablement modal usage with EnableReplicationCallout and refactors destinations into a Card > Table layout, adding ReadReplicaRow rendering and adjusting loading/empty-state flows. EnableReplicationCallout chooses between modal (paid) and upgrade button (unpaid).
UI utility
apps/studio/components/ui/AlphaNotice.tsx
AlphaNotice now accepts children (typed via PropsWithChildren) and renders them inside the admonition.

Sequence Diagram

sequenceDiagram
    participant User as User/UI
    participant DP as DestinationPanel
    participant OrgQ as useSelectedOrganizationQuery
    participant SrcQ as useReplicationSourcesQuery
    participant Callout as EnableReplicationCallout

    User->>DP: mount
    DP->>DP: read route params (projectRef)
    DP->>OrgQ: fetch org / plan status
    OrgQ-->>DP: isPaidPlan
    DP->>SrcQ: fetch replication sources (projectRef)
    SrcQ-->>DP: sources + status

    rect rgb(247, 250, 255)
    Note over DP: compute replicationNotEnabled = (sources fetched && no matching source)
    end

    alt replicationNotEnabled && unifiedReplicationEnabled
        DP->>Callout: render EnableReplicationCallout
        Callout->>OrgQ: use plan status
        alt paid plan
            Callout->>Callout: render EnableReplicationModal
        else unpaid plan
            Callout->>Callout: render UpgradePlanButton
        end
    else replication enabled or read-replica selected
        DP->>DP: render DestinationForm or ReadReplicaForm/path
    end

    Callout-->>User: display enablement UI
    DP-->>User: display destination UI
Loading

Possibly related PRs

Suggested reviewers

  • alaister
  • kemaldotearth
🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description provides context about the change but does not follow the repository's required template structure with sections for contribution guidelines, change type, current behavior, new behavior, and additional context. Fill out the required template sections: confirm CONTRIBUTING.md, specify change type, describe current/new behavior, and add any additional context needed.
Title check ❓ Inconclusive The title is incomplete and cut off mid-sentence, making it vague and unclear about the actual primary change. Complete the title with the actual destination or clarify the change, e.g., 'Move replication enablement CTA to Destination Panel' or similar.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 675a7dc and 6785a16.

📒 Files selected for processing (2)
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx
  • apps/studio/components/interfaces/Database/Replication/EnableReplicationCallout.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/Database/Replication/EnableReplicationCallout.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/EnableReplicationCallout.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx
🧠 Learnings (7)
📚 Learning: 2025-12-11T17:04:40.037Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.037Z
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/Database/Replication/EnableReplicationCallout.tsx
📚 Learning: 2025-12-11T17:04:40.037Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.037Z
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/Database/Replication/EnableReplicationCallout.tsx
📚 Learning: 2025-12-11T16:46:18.701Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-best-practices.mdc:0-0
Timestamp: 2025-12-11T16:46:18.701Z
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/EnableReplicationCallout.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx
📚 Learning: 2025-12-11T17:04:40.037Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.037Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : Use mutateAsync only if the mutation is part of multiple async actions, wrapping the call with try/catch block and adding toast.success and toast.error

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/EnableReplicationCallout.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/EnableReplicationCallout.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx
📚 Learning: 2026-01-02T05:58:55.226Z
Learnt from: meGauravJain
Repo: supabase/supabase PR: 41658
File: apps/studio/components/interfaces/Connect/content/prisma/content.tsx:70-85
Timestamp: 2026-01-02T05:58:55.226Z
Learning: In Prisma configuration or related connection setup code, prefer the environment variable name DIRECT_URL for direct/non-pooled database connections instead of DATABASE_URL_UNPOOLED, per Prisma documentation. Update code that reads database connection strings to use DIRECT_URL where applicable, and document why this is preferred (explicit, documented behavior). Ensure your environment provides DIRECT_URL when using direct connections and fallback handling if needed.

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/EnableReplicationCallout.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx
📚 Learning: 2025-12-11T17:04:40.037Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.037Z
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/DestinationPanel/DestinationPanel.tsx
🧬 Code graph analysis (1)
apps/studio/components/interfaces/Database/Replication/EnableReplicationCallout.tsx (4)
apps/studio/hooks/misc/useSelectedOrganization.ts (1)
  • useSelectedOrganizationQuery (5-21)
blocks/vue/registry/default/lib/utils.ts (1)
  • cn (5-7)
apps/studio/components/ui/UpgradePlanButton.tsx (1)
  • UpgradePlanButton (34-117)
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). (1)
  • GitHub Check: test
🔇 Additional comments (7)
apps/studio/components/interfaces/Database/Replication/EnableReplicationCallout.tsx (4)

1-23: LGTM!

The imports are well-organized and all are actively used in the component.


24-83: LGTM!

The modal implementation follows best practices with proper mutation callbacks, toast notifications, and loading state management.


85-94: LGTM!

The loading state is handled conservatively by checking isSuccess before computing isPaidPlan. During loading or error states, the component defaults to showing the upgrade path, which is safer than prematurely showing the enable replication modal.


95-114: LGTM!

The UI implementation is clean with appropriate conditional rendering and helpful documentation link. The component follows established patterns for callout components.

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

1-41: LGTM!

The imports are appropriately added and the new onSuccessCreateReadReplica prop is properly typed and integrated. Past review feedback has been addressed.


42-55: LGTM!

The replication source query and derived state logic is well-structured. The replicationNotEnabled flag correctly checks for a successful fetch without a matching source, preventing false positives during loading.


83-89: LGTM!

The conditional rendering logic is clean and handles three distinct cases appropriately. The integration of EnableReplicationCallout is well-placed within the sheet context with proper prop passing.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions

github-actions Bot commented Jan 7, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results

passed  67 passed
skipped  4 skipped

Details

stats  71 tests across 12 suites
duration  7 minutes, 27 seconds
commit  6785a16

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

Base automatically changed from joshen/fe-2302-replication-ui-to-also-show-rows-for-read-replicas to master January 7, 2026 15:22
@coveralls

coveralls commented Jan 7, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 68.038% (-0.2%) from 68.24%
when pulling 6785a16 on joshen/fe-2300-alpha-notices-for-replication-all-needs-to-be-shifted-into
into 1195c8e on master.

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/studio/components/interfaces/Database/Replication/Destinations.tsx (1)

44-45: Remove unused variable isPaidPlan.

The isPaidPlan variable is derived from the organization query but is never used in this component. The plan-based gating logic is handled internally by EnableReplicationCallout.

🧹 Suggested fix
-  const { data: organization } = useSelectedOrganizationQuery()
-  const isPaidPlan = organization?.plan.id !== 'free'
🤖 Fix all issues with AI agents
In
@apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx:
- Around line 44-45: The derived variable isPaidPlan is unused; remove the
isPaidPlan declaration and, if the organization data returned by
useSelectedOrganizationQuery() isn't used elsewhere in DestinationPanel, remove
the entire call to useSelectedOrganizationQuery (and the organization const) so
the component no longer fetches unused org data; keep EnableReplicationCallout
as the source of plan logic.

In
@apps/studio/components/interfaces/Database/Replication/EnableReplicationCallout.tsx:
- Around line 92-93: The component currently computes isPaidPlan =
organization?.plan.id !== 'free' which treats undefined organization (loading)
as false and can show the upgrade CTA prematurely; update the logic in
EnableReplicationCallout to handle the loading state from
useSelectedOrganizationQuery (e.g., check isLoading/isFetching or whether
organization is undefined), and either render a loading placeholder or set
isPaidPlan to null/undefined and guard UI (disable/hide the upgrade button or
return early) until organization is resolved; reference
useSelectedOrganizationQuery, organization, and isPaidPlan when making the
change.
🧹 Nitpick comments (1)
apps/studio/components/interfaces/Database/Replication/EnableReplicationCallout.tsx (1)

39-42: Ensure early return after guard clause.

The console.error is followed by implicit undefined return, which is correct behavior but could be more explicit. The current pattern works but adding return makes the intent clearer.

♻️ Optional clarification
   const onEnableReplication = async () => {
-    if (!projectRef) return console.error('Project ref is required')
+    if (!projectRef) {
+      console.error('Project ref is required')
+      return
+    }
     createTenantSource({ projectRef })
   }
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1195c8e and 675a7dc.

📒 Files selected for processing (5)
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx
  • apps/studio/components/interfaces/Database/Replication/Destinations.tsx
  • apps/studio/components/interfaces/Database/Replication/EnableReplicationCallout.tsx
  • apps/studio/components/ui/AlphaNotice.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/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx
  • apps/studio/components/interfaces/Database/Replication/EnableReplicationCallout.tsx
  • apps/studio/components/ui/AlphaNotice.tsx
  • apps/studio/components/interfaces/Database/Replication/Destinations.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/DestinationTypeSelection.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx
  • apps/studio/components/interfaces/Database/Replication/EnableReplicationCallout.tsx
  • apps/studio/components/ui/AlphaNotice.tsx
  • apps/studio/components/interfaces/Database/Replication/Destinations.tsx
🧠 Learnings (10)
📚 Learning: 2025-12-11T17:04:40.037Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.037Z
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-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/DestinationTypeSelection.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx
  • apps/studio/components/interfaces/Database/Replication/EnableReplicationCallout.tsx
  • apps/studio/components/ui/AlphaNotice.tsx
  • apps/studio/components/interfaces/Database/Replication/Destinations.tsx
📚 Learning: 2026-01-02T05:58:55.226Z
Learnt from: meGauravJain
Repo: supabase/supabase PR: 41658
File: apps/studio/components/interfaces/Connect/content/prisma/content.tsx:70-85
Timestamp: 2026-01-02T05:58:55.226Z
Learning: In Prisma configuration or related connection setup code, prefer the environment variable name DIRECT_URL for direct/non-pooled database connections instead of DATABASE_URL_UNPOOLED, per Prisma documentation. Update code that reads database connection strings to use DIRECT_URL where applicable, and document why this is preferred (explicit, documented behavior). Ensure your environment provides DIRECT_URL when using direct connections and fallback handling if needed.

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx
  • apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx
  • apps/studio/components/interfaces/Database/Replication/EnableReplicationCallout.tsx
  • apps/studio/components/ui/AlphaNotice.tsx
  • apps/studio/components/interfaces/Database/Replication/Destinations.tsx
📚 Learning: 2025-12-11T16:46:18.701Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-best-practices.mdc:0-0
Timestamp: 2025-12-11T16:46:18.701Z
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/DestinationPanel.tsx
  • apps/studio/components/interfaces/Database/Replication/EnableReplicationCallout.tsx
📚 Learning: 2025-12-11T17:04:40.037Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.037Z
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/DestinationPanel/DestinationPanel.tsx
📚 Learning: 2025-12-11T17:04:40.037Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.037Z
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/Database/Replication/EnableReplicationCallout.tsx
📚 Learning: 2025-12-11T17:04:40.037Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.037Z
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/Database/Replication/EnableReplicationCallout.tsx
📚 Learning: 2025-12-11T17:04:40.037Z
Learnt from: CR
Repo: supabase/supabase PR: 0
File: .cursor/rules/studio-ui.mdc:0-0
Timestamp: 2025-12-11T17:04:40.037Z
Learning: Applies to apps/studio/components/**/*.{ts,tsx} : Use mutateAsync only if the mutation is part of multiple async actions, wrapping the call with try/catch block and adding toast.success and toast.error

Applied to files:

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

Applied to files:

  • apps/studio/components/ui/AlphaNotice.tsx
📚 Learning: 2025-12-11T00:21:05.527Z
Learnt from: dnywh
Repo: supabase/supabase PR: 41215
File: apps/design-system/content/docs/accessibility.mdx:30-30
Timestamp: 2025-12-11T00:21:05.527Z
Learning: In apps/design-system/content/docs/, MDX files use different relative path formats based on their location: root-level docs use `components/button` format, while subdirectory docs (ui-patterns/, components/) use `../components/button` format for linking to components.

Applied to files:

  • apps/studio/components/ui/AlphaNotice.tsx
🧬 Code graph analysis (2)
apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx (4)
apps/studio/hooks/misc/useSelectedOrganization.ts (1)
  • useSelectedOrganizationQuery (5-21)
apps/studio/data/replication/sources-query.ts (1)
  • useReplicationSourcesQuery (29-44)
packages/ui/src/components/shadcn/ui/sheet.tsx (1)
  • SheetSection (237-237)
apps/studio/components/interfaces/Database/Replication/EnableReplicationCallout.tsx (1)
  • EnableReplicationCallout (85-114)
apps/studio/components/interfaces/Database/Replication/Destinations.tsx (1)
apps/studio/components/interfaces/Database/Replication/EnableReplicationCallout.tsx (1)
  • EnableReplicationCallout (85-114)
⏰ 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 (6)
apps/studio/components/ui/AlphaNotice.tsx (1)

15-20: LGTM!

The addition of children support via PropsWithChildren<AlphaNoticeProps> is a clean and idiomatic approach for extending the component's content. The placement after the description paragraph allows for flexible additional content insertion.

Also applies to: 64-64

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

69-72: LGTM!

The Alpha badge conditional rendering is correctly implemented. The pattern {unifiedReplication && <Badge>Alpha</Badge>} follows the coding guidelines for simple show/hide conditional rendering.

Also applies to: 91-94

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

218-219: LGTM!

The conditional rendering correctly gates the EnableReplicationCallout to display only when unified replication is disabled and replication is not yet enabled. This aligns with the PR objective of moving the CTA into the Destination Panel when the feature flag is on.

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

24-83: LGTM on the modal implementation.

The EnableReplicationModal correctly uses the mutation pattern with onSuccess and onError callbacks including toast.success and toast.error, following the established patterns from learnings.

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

87-100: LGTM on the conditional flow.

The rendering logic correctly implements the feature flag behavior:

  • Read Replica → ReadReplicaForm
  • Unified replication enabled but replication not set up → EnableReplicationCallout
  • Otherwise → DestinationForm

This aligns with the PR objective of shifting the enable-replication CTA into the Destination Panel when the unified replication flag is on.


55-59: Consider handling loading state for sources query.

When sources are still loading, replicationNotEnabled is false, causing DestinationForm to render. If the user doesn't have replication enabled, there may be a brief flash when the form switches to the callout after loading completes.

This is acceptable behavior but worth noting. If smoother UX is desired, consider showing a skeleton loader while isSourcesLoading.

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

Minor code rabbit changes need to be done

@joshenlim
joshenlim merged commit 6153d2c into master Jan 8, 2026
@joshenlim
joshenlim deleted the joshen/fe-2300-alpha-notices-for-replication-all-needs-to-be-shifted-into branch January 8, 2026 04:10
@github-actions

github-actions Bot commented Jan 8, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1767845540)

Score Average Improvements Regressions
Completeness 100% (+0pp) - -
Conciseness 0% (+0pp) - -
Goal Completion 90% (+0pp) - -
Tool Usage 60% (+0pp) - -
SQL Validity 100% (+0pp) - -
Time_to_first_token 0.2tok (-0.02tok) 4 🟢 1 🔴
Llm_calls 7.8 (-0.6) - 2 🔴
Tool_calls 4.6 (+0) 1 🟢 1 🔴
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 69125.6tok (+3767.2tok) 3 🟢 2 🔴
Prompt_cached_tokens 38656tok (-3891.2tok) 1 🟢 4 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 6129.2tok (-384tok) 3 🟢 2 🔴
Completion_reasoning_tokens 4249.6tok (-486.4tok) 3 🟢 2 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 75254.8tok (+3383.2tok) 3 🟢 2 🔴
Estimated_cost 0.02$ (+0$) 3 🟢 2 🔴
Duration 56.8s (-0.54s) 2 🟢 3 🔴
Llm_duration 112.91s (-1.03s) 2 🟢 3 🔴

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.

3 participants