Skip to content

Add read replicas details page from database replication - #41784

Merged
joshenlim merged 6 commits into
masterfrom
joshen/fe-2286-read-replicas-details-page
Jan 19, 2026
Merged

joshenlim merged 6 commits into
masterfrom
joshen/fe-2286-read-replicas-details-page

Conversation

@joshenlim

@joshenlim joshenlim commented Jan 8, 2026 •

Copy link
Copy Markdown
Member

Context

Part of unifying replication interfaces in the dashboard into database replication page
Adds a details page for Read Replicas when clicking "View replication"

NOTE: There's something potentially wrong with the infra-monitoring data for replication lag as the endpoint does not seem to return any data for both staging and prod. I've got a ticket to investigate this separately here but am otherwise temporarily hard coding some random numbers to render the graph

image

Summary by CodeRabbit

Release Notes

  • New Features

    • Added read replica details page displaying replication lag metrics and replica configuration information (Load Balancer URL, region, compute size).
  • Improvements

    • Enhanced read replica status handling and navigation with clearer status labels.
    • Added database identifier filtering support across logs pages.
    • Improved page header to support flexible title and subtitle rendering.

✏️ 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 8, 2026 08:41
@vercel

vercel Bot commented Jan 8, 2026 •

Copy link
Copy Markdown

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

Project Deployment Review Updated (UTC)
design-system Ready Ready Preview, Comment Jan 19, 2026 3:35am
docs Ready Ready Preview, Comment Jan 19, 2026 3:35am
studio-self-hosted Ready Ready Preview, Comment Jan 19, 2026 3:35am
studio-staging Ready Ready Preview, Comment Jan 19, 2026 3:35am
ui-library Ready Ready Preview, Comment Jan 19, 2026 3:35am
zone-www-dot-com Ready Ready Preview, Comment Jan 19, 2026 3:35am
2 Skipped Deployments
Project Deployment Review Updated (UTC)
cms Ignored Ignored Jan 19, 2026 3:35am
studio Ignored Ignored Jan 19, 2026 3:35am

Request Review

@supabase

supabase Bot commented Jan 8, 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 ↗︎.

@coderabbitai

coderabbitai Bot commented Jan 8, 2026 •

Copy link
Copy Markdown
Contributor

Walkthrough

This PR introduces a new read replica detail view with dedicated page and component, refactors read replica status handling into utility functions, converts a confirmation modal to named export, updates multiple log pages with identifier-based filtering, and makes minor cleanup changes across database replication UI.

Changes

Cohort / File(s) Summary
Read Replica Detail Page & Components
apps/studio/pages/project/[ref]/database/replication/replica/[replicaId].tsx, apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaDetails.tsx
New page component with replica details view rendering load balancer URL, replica URL, region, and compute size. New ReadReplicaDetails component displays replication lag chart and metadata. Includes polling mechanism for status transitions and modal integrations for restart/drop actions.
Read Replica Status Utilities & Row Updates
apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicas.utils.ts, apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaRow.tsx
New utility module exports getIsInTransition and getStatusLabel for centralized status handling. ReadReplicaRow refactored to use utilities via useMemo, adds Next.js Link routing to replica details page, and conditionally disables restart/drop actions based on replica status.
Confirmation Modal Export Changes
apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DropReplicaConfirmationModal.tsx, apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.tsx, apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaRow.tsx
DropReplicaConfirmationModal converted from default export to named export. Dependent imports in InstanceConfiguration and ReadReplicaRow updated accordingly.
Logs Pages Identifier Filtering
apps/studio/pages/project/[ref]/logs/edge-logs.tsx, apps/studio/pages/project/[ref]/logs/pooler-logs.tsx, apps/studio/pages/project/[ref]/logs/postgres-logs.tsx, apps/studio/pages/project/[ref]/logs/postgrest-logs.tsx
Multiple log pages updated to extract identifier from query parameter 'db' using nuqs and pass filterOverride to LogsPreviewer for identifier-based filtering.
Database Replication & UI Pattern Updates
apps/studio/components/interfaces/Database/Replication/Destinations.tsx, apps/studio/data/analytics/infra-monitoring-query.ts, packages/ui-patterns/index.tsx
Removed unused useSelectedOrganizationQuery from Destinations. Added 'physical_replication_lag_physical_replica_lag_seconds' to InfraMonitoringAttribute union. Exported Chart module from ui-patterns.
Page Layout & Other Minor Changes
apps/studio/components/layouts/PageLayout/PageHeader.tsx, apps/studio/components/interfaces/Support/SupportFormPage.tsx, apps/studio/components/interfaces/Settings/Logs/Logs.utils.ts, apps/studio/pages/project/[ref]/observability/database.tsx
PageHeader now supports ReactNode for title and subtitle. Removed useOrganizationsQuery from SupportFormPage. Minor whitespace addition in Logs.utils. Removed unused isOrgPlanLoading from DatabaseUsage.

Sequence Diagram

sequenceDiagram
    participant User
    participant Page as [replicaId] Page
    participant ReplicaDetailsComp as ReadReplicaDetails
    participant Query as useReadReplicas<br/>Queries
    participant Modal as Confirmation<br/>Modals
    
    User->>Page: Navigate to replica detail
    Page->>Query: Fetch read replicas & statuses
    Query-->>Page: Return replica data
    Page->>Page: Compute status & polling strategy
    Page->>ReplicaDetailsComp: Render with replica data
    ReplicaDetailsComp->>ReplicaDetailsComp: Fetch lag & load balancer data
    ReplicaDetailsComp-->>User: Display lag chart + metadata
    User->>Page: Click restart/drop action
    Page->>Modal: Open confirmation modal
    Modal->>User: Request confirmation
    User->>Modal: Confirm action
    Modal->>Page: Trigger mutation & navigate
Loading

Possibly related PRs

Suggested reviewers

  • alaister
  • pamelachia
🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The PR description provides context, explains the feature being added, and acknowledges a known data issue with a reference to a follow-up ticket; however, it does not follow the required template structure. Structure the description to match the template: confirm CONTRIBUTING.md review, specify change type (feature), describe current/new behavior, and add context/screenshots.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding a details page for read replicas within the database replication interface.

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

✨ Finishing touches
  • 📝 Generate docstrings

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.

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

🤖 Fix all issues with AI agents
In
@apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaDetails.tsx:
- Around line 92-96: lagDuration can be undefined when the lag query is
disabled, causing ChartMetric to render "undefineds"; update the ChartMetric
value expression (where ChartMetric is rendered alongside
isLoading={isLoadingLag || isFetchingInfraMonitoring}) to render a safe
placeholder when lagDuration is null/undefined (e.g., lagDuration != null ?
`${lagDuration}s` : '—' or 'N/A') so the unit is only appended for numeric
values and a clear placeholder is shown when unavailable.

In @apps/studio/hooks/analytics/useLogsPreview.tsx:
- Line 82: Remove the debug console.log call that prints mergedFilters from the
useLogsPreview hook; locate the console.log({ mergedFilters }) inside the
useLogsPreview.tsx file (where mergedFilters is computed) and delete that
statement so the hook no longer logs to the browser console on re-renders.

In
@apps/studio/pages/project/[ref]/database/replication/replica/[replicaId].tsx:
- Around line 146-152: The href construction in the Button/Link block produces a
double question mark because it uses `?${!!identifier ? \`?db=\${identifier}\` :
''}`; update the Link href to only include a single `?` when identifier exists
(e.g., `href={\`/project/\${ref}/logs/postgres-logs\${identifier ?
\`?db=\${identifier}\` : ''}\`}`) or build query via URLSearchParams; adjust the
code around the Button, Link, identifier and ref usage so the final URL is
`/project/{ref}/logs/postgres-logs` or
`/project/{ref}/logs/postgres-logs?db={identifier}` without `??`.
🧹 Nitpick comments (9)
apps/studio/pages/project/[ref]/logs/edge-logs.tsx (1)

4-4: Use named import for DefaultLayout.

Based on learnings, DefaultLayout should use a named import instead of a default import to align with the new practice being adopted across the studio app.

♻️ Proposed fix
-import DefaultLayout from 'components/layouts/DefaultLayout'
+import { DefaultLayout } from 'components/layouts/DefaultLayout'
apps/studio/pages/project/[ref]/logs/postgres-logs.tsx (1)

6-6: Use named import for DefaultLayout.

Based on learnings, DefaultLayout should use a named import instead of a default import to align with the new practice being adopted across the studio app.

♻️ Proposed fix
-import DefaultLayout from 'components/layouts/DefaultLayout'
+import { DefaultLayout } from 'components/layouts/DefaultLayout'
apps/studio/pages/project/[ref]/logs/pooler-logs.tsx (1)

6-6: Use named import for DefaultLayout.

Based on learnings, DefaultLayout should use a named import instead of a default import to align with the new practice being adopted across the studio app.

♻️ Proposed fix
-import DefaultLayout from 'components/layouts/DefaultLayout'
+import { DefaultLayout } from 'components/layouts/DefaultLayout'
apps/studio/pages/project/[ref]/logs/postgrest-logs.tsx (1)

7-7: Use named import for DefaultLayout.

Based on learnings, DefaultLayout should use a named import instead of a default import to align with the new practice being adopted across the studio app.

♻️ Proposed fix
-import DefaultLayout from 'components/layouts/DefaultLayout'
+import { DefaultLayout } from 'components/layouts/DefaultLayout'
apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicas.utils.ts (1)

11-22: Consider avoiding the type cast.

Per coding guidelines, type casting (e.g., as string[]) should be avoided. You could define the array outside with explicit typing or use a const assertion to preserve the type.

♻️ Suggested refactor
+const TRANSITION_STATUSES = [
+  REPLICA_STATUS.UNKNOWN,
+  REPLICA_STATUS.COMING_UP,
+  REPLICA_STATUS.GOING_DOWN,
+  REPLICA_STATUS.RESTORING,
+  REPLICA_STATUS.RESTARTING,
+  REPLICA_STATUS.RESIZING,
+  REPLICA_STATUS.INIT_READ_REPLICA,
+] as const
+
 export const getIsInTransition = ({
   initStatus,
   status,
 }: {
   initStatus?: string
   status?: string
 }) => {
   return (
-    (
-      [
-        REPLICA_STATUS.UNKNOWN,
-        REPLICA_STATUS.COMING_UP,
-        REPLICA_STATUS.GOING_DOWN,
-        REPLICA_STATUS.RESTORING,
-        REPLICA_STATUS.RESTARTING,
-        REPLICA_STATUS.RESIZING,
-        REPLICA_STATUS.INIT_READ_REPLICA,
-      ] as string[]
-    ).includes(status ?? '') || initStatus === ReplicaInitializationStatus.InProgress
+    TRANSITION_STATUSES.includes(status as typeof TRANSITION_STATUSES[number]) ||
+    initStatus === ReplicaInitializationStatus.InProgress
   )
 }
apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaDetails.tsx (1)

45-47: Variable shadowing reduces readability.

The inner callback parameter x shadows the outer x, making the code harder to follow. Consider using distinct names.

♻️ Suggested fix
-  const loadBalancer = loadBalancers.find((x) =>
-    x.databases.some((x) => x.identifier === identifier)
+  const loadBalancer = loadBalancers.find((lb) =>
+    lb.databases.some((db) => db.identifier === identifier)
   )
apps/studio/pages/project/[ref]/database/replication/replica/[replicaId].tsx (1)

153-160: Use REPLICA_STATUS constants instead of string literals.

For consistency and maintainability, use the imported REPLICA_STATUS.ACTIVE_HEALTHY constant instead of the string literal 'ACTIVE_HEALTHY'.

♻️ Suggested fix
         <Button
           key="drop"
           type="default"
-          disabled={status !== 'ACTIVE_HEALTHY'}
+          disabled={status !== REPLICA_STATUS.ACTIVE_HEALTHY}
           onClick={() => setShowConfirmRestart(true)}
         >
           Restart replica
         </Button>,
apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaRow.tsx (2)

114-118: Use REPLICA_STATUS.GOING_DOWN constant instead of string literal.

For consistency with the imported constants, use REPLICA_STATUS.GOING_DOWN instead of the string literal 'GOING_DOWN'.

♻️ Suggested fix
-            <Button asChild type="default" className="relative" disabled={status === 'GOING_DOWN'}>
+            <Button asChild type="default" className="relative" disabled={status === REPLICA_STATUS.GOING_DOWN}>
               <Link href={`/project/${ref}/database/replication/replica/${replica.identifier}`}>
                 View replication
               </Link>
             </Button>

124-140: Use REPLICA_STATUS constants for consistency.

Replace string literals with the imported REPLICA_STATUS constants for both the restart and drop menu item disabled conditions.

♻️ Suggested fix
                 <DropdownMenuItem
                   className="gap-x-2"
-                  disabled={status !== 'ACTIVE_HEALTHY'}
+                  disabled={status !== REPLICA_STATUS.ACTIVE_HEALTHY}
                   onClick={() => setShowConfirmRestart(true)}
                 >
                   <RotateCcw size={14} />
                   <span>Restart replica</span>
                 </DropdownMenuItem>
                 <DropdownMenuSeparator />
                 <DropdownMenuItem
                   className="gap-x-2"
-                  disabled={status === 'GOING_DOWN'}
+                  disabled={status === REPLICA_STATUS.GOING_DOWN}
                   onClick={() => setShowConfirmDrop(true)}
                 >
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8af0274 and acbbeff.

📒 Files selected for processing (18)
  • apps/studio/components/interfaces/Database/Replication/Destinations.tsx
  • apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaDetails.tsx
  • apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaRow.tsx
  • apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicas.utils.ts
  • apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DropReplicaConfirmationModal.tsx
  • apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.tsx
  • apps/studio/components/interfaces/Settings/Logs/Logs.utils.ts
  • apps/studio/components/interfaces/Support/SupportFormPage.tsx
  • apps/studio/components/layouts/PageLayout/PageHeader.tsx
  • apps/studio/data/analytics/infra-monitoring-query.ts
  • apps/studio/hooks/analytics/useLogsPreview.tsx
  • apps/studio/pages/project/[ref]/database/replication/replica/[replicaId].tsx
  • apps/studio/pages/project/[ref]/logs/edge-logs.tsx
  • apps/studio/pages/project/[ref]/logs/pooler-logs.tsx
  • apps/studio/pages/project/[ref]/logs/postgres-logs.tsx
  • apps/studio/pages/project/[ref]/logs/postgrest-logs.tsx
  • apps/studio/pages/project/[ref]/observability/database.tsx
  • packages/ui-patterns/index.tsx
💤 Files with no reviewable changes (3)
  • apps/studio/components/interfaces/Database/Replication/Destinations.tsx
  • apps/studio/components/interfaces/Support/SupportFormPage.tsx
  • apps/studio/pages/project/[ref]/observability/database.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/Settings/Logs/Logs.utils.ts
  • apps/studio/hooks/analytics/useLogsPreview.tsx
  • apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.tsx
  • apps/studio/pages/project/[ref]/database/replication/replica/[replicaId].tsx
  • apps/studio/pages/project/[ref]/logs/edge-logs.tsx
  • apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DropReplicaConfirmationModal.tsx
  • apps/studio/components/layouts/PageLayout/PageHeader.tsx
  • apps/studio/pages/project/[ref]/logs/postgrest-logs.tsx
  • apps/studio/data/analytics/infra-monitoring-query.ts
  • apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaDetails.tsx
  • apps/studio/pages/project/[ref]/logs/pooler-logs.tsx
  • apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicas.utils.ts
  • apps/studio/pages/project/[ref]/logs/postgres-logs.tsx
  • apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaRow.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/hooks/analytics/useLogsPreview.tsx
  • apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.tsx
  • apps/studio/pages/project/[ref]/database/replication/replica/[replicaId].tsx
  • apps/studio/pages/project/[ref]/logs/edge-logs.tsx
  • apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DropReplicaConfirmationModal.tsx
  • apps/studio/components/layouts/PageLayout/PageHeader.tsx
  • apps/studio/pages/project/[ref]/logs/postgrest-logs.tsx
  • apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaDetails.tsx
  • apps/studio/pages/project/[ref]/logs/pooler-logs.tsx
  • apps/studio/pages/project/[ref]/logs/postgres-logs.tsx
  • apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaRow.tsx
🧠 Learnings (15)
📚 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/Settings/Logs/Logs.utils.ts
  • apps/studio/hooks/analytics/useLogsPreview.tsx
  • apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.tsx
  • apps/studio/pages/project/[ref]/database/replication/replica/[replicaId].tsx
  • apps/studio/pages/project/[ref]/logs/edge-logs.tsx
  • apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DropReplicaConfirmationModal.tsx
  • apps/studio/components/layouts/PageLayout/PageHeader.tsx
  • apps/studio/pages/project/[ref]/logs/postgrest-logs.tsx
  • apps/studio/data/analytics/infra-monitoring-query.ts
  • apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaDetails.tsx
  • apps/studio/pages/project/[ref]/logs/pooler-logs.tsx
  • apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicas.utils.ts
  • apps/studio/pages/project/[ref]/logs/postgres-logs.tsx
  • apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaRow.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/Settings/Logs/Logs.utils.ts
  • apps/studio/hooks/analytics/useLogsPreview.tsx
  • apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.tsx
  • apps/studio/pages/project/[ref]/database/replication/replica/[replicaId].tsx
  • apps/studio/pages/project/[ref]/logs/edge-logs.tsx
  • apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DropReplicaConfirmationModal.tsx
  • apps/studio/components/layouts/PageLayout/PageHeader.tsx
  • apps/studio/pages/project/[ref]/logs/postgrest-logs.tsx
  • apps/studio/data/analytics/infra-monitoring-query.ts
  • apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaDetails.tsx
  • apps/studio/pages/project/[ref]/logs/pooler-logs.tsx
  • apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicas.utils.ts
  • apps/studio/pages/project/[ref]/logs/postgres-logs.tsx
  • packages/ui-patterns/index.tsx
  • apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaRow.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/**/*.{ts,tsx} : Import primitive UI components from packages/ui package for use across apps, not from individual component files

Applied to files:

  • apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.tsx
  • packages/ui-patterns/index.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/interfaces/**/*.{ts,tsx} : Create a new component in apps/studio/components/interfaces for the contents of each new page

Applied to files:

  • apps/studio/pages/project/[ref]/database/replication/replica/[replicaId].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/pages/**/*.{ts,tsx} : When creating a new page, use the PageLayout component with appropriate props (title, subtitle, icon, breadcrumbs, primaryActions, secondaryActions, navigationItems, className, size, isCompact)

Applied to files:

  • apps/studio/pages/project/[ref]/database/replication/replica/[replicaId].tsx
  • apps/studio/components/layouts/PageLayout/PageHeader.tsx
  • apps/studio/pages/project/[ref]/logs/postgrest-logs.tsx
  • apps/studio/pages/project/[ref]/logs/pooler-logs.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/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/pages/project/[ref]/database/replication/replica/[replicaId].tsx
  • apps/studio/components/layouts/PageLayout/PageHeader.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/pages/**/*.{ts,tsx} : Place pages in apps/studio/pages directory, with project-related pages in apps/studio/pages/projects/[ref] and organization-related pages in apps/studio/pages/org/[slug]

Applied to files:

  • apps/studio/pages/project/[ref]/database/replication/replica/[replicaId].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/pages/**/*.{ts,tsx} : Use related layout components (e.g., AuthLayout) for pages within existing sections

Applied to files:

  • apps/studio/pages/project/[ref]/database/replication/replica/[replicaId].tsx
  • apps/studio/components/layouts/PageLayout/PageHeader.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/**/*.{ts,tsx} : Use ScaffoldSection, ScaffoldSectionTitle, and ScaffoldSectionDescription for pages with multiple sections

Applied to files:

  • apps/studio/components/layouts/PageLayout/PageHeader.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/**/*.{ts,tsx} : Place Admonition at the top of page contents (below page title) or at the top of the related ScaffoldSection below ScaffoldTitle

Applied to files:

  • apps/studio/components/layouts/PageLayout/PageHeader.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 SheetHeader, SheetTitle, SheetSection, and SheetFooter for consistent sheet structure

Applied to files:

  • apps/studio/components/layouts/PageLayout/PageHeader.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} : Only use CardHeader and CardTitle if card content has not been described by surrounding content, or when using multiple cards to group related pieces of content

Applied to files:

  • apps/studio/components/layouts/PageLayout/PageHeader.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/interfaces/**/*.{ts,tsx} : Add table actions to the right of ScaffoldSectionTitle if table is main content of a page section without search or filters

Applied to files:

  • apps/studio/components/layouts/PageLayout/PageHeader.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/**/*.{ts,tsx} : Use ScaffoldContainer for center-aligned page content in a container

Applied to files:

  • apps/studio/components/layouts/PageLayout/PageHeader.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} : Contain tables within a card

Applied to files:

  • apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaDetails.tsx
🧬 Code graph analysis (3)
apps/studio/pages/project/[ref]/logs/edge-logs.tsx (2)
apps/studio/pages/project/[ref]/logs/pooler-logs.tsx (1)
  • LogPage (12-29)
apps/studio/pages/project/[ref]/logs/postgres-logs.tsx (1)
  • LogPage (10-23)
apps/studio/components/layouts/PageLayout/PageHeader.tsx (1)
apps/studio/components/layouts/Scaffold.tsx (2)
  • ScaffoldTitle (67-71)
  • ScaffoldDescription (79-84)
apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaRow.tsx (1)
apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicas.utils.ts (2)
  • getIsInTransition (4-24)
  • getStatusLabel (26-63)
⏰ 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 (16)
apps/studio/components/interfaces/Settings/Logs/Logs.utils.ts (1)

80-80: LGTM - Formatting improvement.

The added whitespace improves readability by visually separating the variable declaration from the function definition below.

packages/ui-patterns/index.tsx (1)

11-11: LGTM - Public API expansion.

The Chart export follows the established pattern of making ui-patterns components available for import. This supports the new read replica details page that displays replication lag graphs.

apps/studio/components/layouts/PageLayout/PageHeader.tsx (1)

114-123: LGTM - Enhanced flexibility for custom title/subtitle rendering.

The conditional rendering based on type checks maintains backward compatibility for string titles/subtitles while enabling custom ReactNode content. This provides consumers with greater control over title and subtitle presentation when needed.

apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DropReplicaConfirmationModal.tsx (1)

18-18: LGTM - Export pattern aligns with codebase standards.

The switch from default to named export is consistent with the studio app's adoption of named exports for better refactorability and IDE support.

Based on learnings, named exports are the preferred pattern being adopted across the studio app.

apps/studio/data/analytics/infra-monitoring-query.ts (1)

4-4: LGTM! Infrastructure for read replicas monitoring.

The addition of UseCustomQueryOptions import and the new physical_replication_lag_physical_replica_lag_seconds attribute properly support the read replicas replication lag monitoring feature introduced in this PR.

Also applies to: 26-26

apps/studio/pages/project/[ref]/logs/edge-logs.tsx (1)

10-11: LGTM! Consistent identifier-based filtering.

The implementation correctly extracts the database identifier from the query string and applies it as a filter override. This pattern is consistent across all log pages in this PR and enables filtering logs by specific database instances (e.g., read replicas).

Also applies to: 19-19

apps/studio/pages/project/[ref]/logs/postgres-logs.tsx (1)

11-12: LGTM! Consistent identifier-based filtering.

The implementation correctly uses useParams and useQueryState to extract the database identifier and applies it as a filter override, enabling database-specific log filtering for features like read replicas.

Also applies to: 20-20

apps/studio/pages/project/[ref]/logs/pooler-logs.tsx (1)

14-14: LGTM! Consistent identifier-based filtering.

The identifier extraction and filterOverride implementation follows the same pattern as other log pages. The existing isLoading guard ensures the component waits for configuration before rendering with potential filters.

Also applies to: 26-26

apps/studio/pages/project/[ref]/logs/postgrest-logs.tsx (1)

12-13: LGTM! Consistent identifier-based filtering.

The implementation correctly extracts the database identifier from the query string and applies it as a filter override. This enables filtering PostgREST logs by specific database instances, consistent with the pattern applied across all log pages in this PR.

Also applies to: 27-27

apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.tsx (1)

39-39: LGTM!

The import change to use named export aligns with the updated export pattern in DropReplicaConfirmationModal.tsx and follows the project convention for named imports. Based on learnings, this is the new practice being adopted across the studio app.

apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicas.utils.ts (1)

26-63: LGTM!

The getStatusLabel function has clear priority-based logic with early returns for initialization states and a comprehensive switch statement for other statuses. Good fallback to 'Unhealthy' for edge cases.

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

76-88: Acknowledged: Mock data placeholder.

The hardcoded chart data is documented with a Linear issue reference. Ensure the TODO is tracked for cleanup once the infra-monitoring endpoint is fixed.

apps/studio/pages/project/[ref]/database/replication/replica/[replicaId].tsx (2)

61-85: LGTM!

The polling logic appropriately stops refetching when all replicas reach a stable state. The pattern is consistent with InstanceConfiguration.tsx.


180-184: LGTM!

The layout composition follows project conventions with named import for DefaultLayout. Based on learnings, this aligns with the new practice being adopted across the studio app.

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

61-65: LGTM!

Good refactoring to use the shared utility functions. The useMemo usage ensures consistent computation when status changes.


1-27: LGTM!

Import changes are clean: named export for DropReplicaConfirmationModal aligns with project conventions, and the new utility imports support the refactored status logic.

@github-actions

github-actions Bot commented Jan 8, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results

passed  66 passed
flaky  1 flaky
skipped  4 skipped

Details

stats  71 tests across 12 suites
duration  7 minutes, 16 seconds
commit  3a8c11c

Flaky tests

Features › sql-editor.spec.ts › SQL Editor › should check if SQL editor is working as expected

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

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 68.038%. remained the same
when pulling 13902c8 on joshen/fe-2286-read-replicas-details-page
into bd96fd7 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: 0

🧹 Nitpick comments (7)
apps/studio/pages/project/[ref]/database/replication/replica/[replicaId].tsx (4)

45-52: Potential mismatch when replica is not found.

When replica is undefined (e.g., during initial load or if the replica doesn't exist), identifier will be undefined. The find on line 50 will then search for a status with identifier === undefined, which could lead to unexpected behavior.

Consider using replicaId directly for consistency:

Suggested improvement
- const replicaStatus = statuses.find((x) => x.identifier === identifier)
+ const replicaStatus = statuses.find((x) => x.identifier === replicaId)

61-85: Unnecessary async function.

The pollReplicas function is declared as async but contains no await expressions. This adds unnecessary overhead.

Simplify by removing async
  useEffect(() => {
    if (!isSuccessReplicasStatuses) return

-   const pollReplicas = async () => {
+   const pollReplicas = () => {
      const fixedStatuses = [
        REPLICA_STATUS.ACTIVE_HEALTHY,
        REPLICA_STATUS.ACTIVE_UNHEALTHY,
        REPLICA_STATUS.INIT_READ_REPLICA_FAILED,
      ]
      const replicasInTransition = statuses.filter((db) => {
        const { status } = db.replicaInitializationStatus || {}
        return (
          !fixedStatuses.includes(db.status) || status === ReplicaInitializationStatus.InProgress
        )
      })
      const hasTransientStatus = replicasInTransition.length > 0

      // If all replicas are active healthy, stop fetching statuses
      if (!hasTransientStatus && statuses.length === databases.length) {
        setStatusRefetchInterval(false)
      }
    }

    pollReplicas()
  }, [databases.length, isSuccessReplicasStatuses, statuses])

94-104: Consider extracting badge variant logic.

Per coding guidelines, nested ternaries in JSX should be avoided. Extract the variant computation to a descriptive variable for clarity.

Extract to descriptive variable
+ const badgeVariant = statusLabel === 'Healthy'
+   ? 'success'
+   : statusLabel === 'Failed'
+     ? 'destructive'
+     : 'default'
+
  // Then in JSX:
  <Badge
-   variant={
-     statusLabel === 'Healthy'
-       ? 'success'
-       : statusLabel === 'Failed'
-         ? 'destructive'
-         : 'default'
-   }
+   variant={badgeVariant}
  >

153-160: Misleading key and inconsistent status check.

  1. The key="drop" is misleading since this is the restart button.
  2. The status comparison uses a string literal instead of the REPLICA_STATUS constant that's already imported and used elsewhere in this file.
Fix key and use constant
  <Button
-   key="drop"
+   key="restart"
    type="default"
-   disabled={status !== 'ACTIVE_HEALTHY'}
+   disabled={status !== REPLICA_STATUS.ACTIVE_HEALTHY}
    onClick={() => setShowConfirmRestart(true)}
  >
    Restart replica
  </Button>,
apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaDetails.tsx (3)

44-47: Shadowed variable name in nested callback.

The variable x is used in both the outer and inner callbacks, which can be confusing.

Use distinct variable names
- const loadBalancer = loadBalancers.find((x) =>
-   x.databases.some((x) => x.identifier === identifier)
+ const loadBalancer = loadBalancers.find((lb) =>
+   lb.databases.some((db) => db.identifier === identifier)
  )

76-88: Temporary mock data is documented and tracked.

The hardcoded random data is acknowledged in comments with a Linear ticket reference (INDATA-325). The useMemo with empty dependencies ensures stable data per mount.

Consider adding a TODO comment to make it more discoverable in code searches:

Add TODO marker
- // [Joshen] Temporarily hardcoding the data as the query to retrieve replication lag doesn't seem to be working
+ // TODO: [Joshen] Temporarily hardcoding the data as the query to retrieve replication lag doesn't seem to be working
  // https://linear.app/supabase/issue/INDATA-325/investigate-infra-monitoring-for-physical-replication-lag-physical

31-42: Consider adding error state handling.

The component handles loading states but doesn't explicitly handle error states from the queries. While the UI gracefully degrades with undefined values, consider adding explicit error handling for better UX.

For example, you could destructure isError from the primary query and show an error message:

const { data = [], isPending: isLoadingDatabases, isError } = useReadReplicasQuery({ projectRef })

// Then early return or conditional render for error state
if (isError) {
  return <AlertError subject="Failed to load replica details" />
}
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between acbbeff and 13902c8.

📒 Files selected for processing (3)
  • apps/studio/components/interfaces/Database/Replication/Destinations.tsx
  • apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaDetails.tsx
  • apps/studio/pages/project/[ref]/database/replication/replica/[replicaId].tsx
💤 Files with no reviewable changes (1)
  • apps/studio/components/interfaces/Database/Replication/Destinations.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/pages/project/[ref]/database/replication/replica/[replicaId].tsx
  • apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaDetails.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/pages/project/[ref]/database/replication/replica/[replicaId].tsx
  • apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaDetails.tsx
🧠 Learnings (5)
📚 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/interfaces/**/*.{ts,tsx} : Create a new component in apps/studio/components/interfaces for the contents of each new page

Applied to files:

  • apps/studio/pages/project/[ref]/database/replication/replica/[replicaId].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/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/pages/project/[ref]/database/replication/replica/[replicaId].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/pages/**/*.{ts,tsx} : When creating a new page, use the PageLayout component with appropriate props (title, subtitle, icon, breadcrumbs, primaryActions, secondaryActions, navigationItems, className, size, isCompact)

Applied to files:

  • apps/studio/pages/project/[ref]/database/replication/replica/[replicaId].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/pages/project/[ref]/database/replication/replica/[replicaId].tsx
  • apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaDetails.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/pages/project/[ref]/database/replication/replica/[replicaId].tsx
  • apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaDetails.tsx
🧬 Code graph analysis (1)
apps/studio/pages/project/[ref]/database/replication/replica/[replicaId].tsx (6)
apps/studio/data/read-replicas/replicas-status-query.ts (1)
  • useReadReplicasStatusesQuery (44-57)
apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicas.utils.ts (2)
  • getStatusLabel (26-63)
  • getIsInTransition (4-24)
apps/studio/components/layouts/Scaffold.tsx (2)
  • ScaffoldTitle (67-71)
  • ScaffoldDescription (79-84)
apps/studio/components/interfaces/Database/Replication/ReadReplicas/ReadReplicaDetails.tsx (1)
  • ReadReplicaDetails (31-180)
apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DropReplicaConfirmationModal.tsx (1)
  • DropReplicaConfirmationModal (18-85)
apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/RestartReplicaConfirmationModal.tsx (1)
  • RestartReplicaConfirmationModal (18-93)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: typecheck
  • GitHub Check: test
  • GitHub Check: test (1)
🔇 Additional comments (7)
apps/studio/pages/project/[ref]/database/replication/replica/[replicaId].tsx (4)

1-30: LGTM on imports!

Good use of named imports for DefaultLayout as per the project convention. The imports are well-organized and follow the established patterns.


36-38: LGTM!

State management is appropriately scoped. The modal visibility states are simple booleans, and the refetch interval state correctly controls polling behavior.


165-175: LGTM!

Modal integration follows the established pattern. The visibility control via selectedReplica prop and the success/cancel handlers are correctly implemented.


180-186: LGTM!

Layout setup follows project conventions with proper nesting of DefaultLayout and DatabaseLayout. The named import for DefaultLayout aligns with established practices.

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

1-29: LGTM on imports!

Imports are well-organized and follow project conventions.


92-123: LGTM!

Chart implementation is well-structured with proper loading and empty states. The current mock data will always have 46 items, but once real data is integrated, the empty state handling will function correctly.


130-174: LGTM!

Good implementation of the loading/success pattern with GenericSkeletonLoader. The form layout is clean and consistent. Input values correctly handle potential undefined values gracefully.

@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

@joshenlim
joshenlim merged commit 3b7bba9 into master Jan 19, 2026
@joshenlim
joshenlim deleted the joshen/fe-2286-read-replicas-details-page branch January 19, 2026 05:44
@github-actions

github-actions Bot commented Jan 19, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1768801585)

Score Average Improvements Regressions
Completeness 100% (+0pp) - -
Conciseness 6.3% (+6pp) 1 🟢 -
Correctness 100% (+0pp) - -
Docs Faithfulness 62.5% (+0pp) - -
Goal Completion 93.8% (+6pp) 1 🟢 -
Tool Usage 75% (+0pp) - -
SQL Validity 100% (+0pp) - -
Time_to_first_token 0.14tok (+0.03tok) 2 🟢 6 🔴
Llm_calls 8.13 (+0) 2 🟢 2 🔴
Tool_calls 2.63 (+0.13) 2 🟢 1 🔴
Errors 0 (+0) - -
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 113095.25tok (+32755tok) 4 🟢 3 🔴
Prompt_cached_tokens 51904tok (+5088tok) 3 🟢 3 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Completion_tokens 4732.75tok (-263.25tok) 6 🟢 2 🔴
Completion_reasoning_tokens 3456tok (-240tok) 5 🟢 2 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 117828tok (+32491.75tok) 5 🟢 3 🔴
Estimated_cost 0.03$ (+0.01$) 5 🟢 3 🔴
Duration 41.59s (-6.2s) 6 🟢 2 🔴
Llm_duration 82.3s (-12.52s) 6 🟢 2 🔴

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