Skip to content

Modernize compute and disk configuration - #48368

Merged
SaxonF merged 5 commits into
masterfrom
chore/infra-compute-1-config
Jul 29, 2026
Merged

SaxonF merged 5 commits into
masterfrom
chore/infra-compute-1-config

Conversation

@SaxonF

@SaxonF SaxonF commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This is a precursor to unifying "compute and disk" and "infrastructure pages". First step is just updating the existing compute and disk page to make use of standard page and form patterns.

  • Reorganizes the existing Compute and Disk form into the established settings layout pattern, with Scaling, Compute, Disk, and Advanced sections.
  • Moves billing deltas to section headers while retaining the sticky review footer.
  • Adds animated notices, validation-error scrolling, and a responsive compute-size selector (2 columns by default, 3 from 680px, and 4 from 900px).
  • Preserves permissions, entitlements, cooldowns, read-only warnings, replica pricing, GP3 validation, Nano/PITR locks, and the free Micro upgrade treatment.
  • Keeps the redesigned experience on /settings/compute-and-disk so it can be reviewed independently of the route cutover.

Stack

  1. Modernize compute and disk configuration #48368 (this PR)
  2. Add compute and disk usage charts #48369
  3. Merge compute and disk into Infrastructure #48370

How to test

  1. Check out chore/infra-compute-1-config and start Studio with pnpm dev:studio.
  2. Open /project/<ref>/settings/compute-and-disk.
  3. Confirm the page header and Scaling, Compute, Disk, and Advanced sections follow the standard settings-page spacing, with the plan notice directly below the Scaling header.
  4. Change the compute size and disk configuration. Confirm billing deltas appear in the relevant section headers and the sticky review footer summarizes and applies the pending changes.
  5. Enter invalid GP3 IOPS or throughput values and submit. Confirm the validation message is shown and the first invalid field is scrolled into view.
  6. Exercise representative project states: insufficient permissions, read-only mode, resize cooldown, Nano with PITR, a project with read replicas, and a free Micro upgrade. Confirm the existing locks, warnings, pricing, and upgrade treatment remain intact.
  7. Resize the viewport and confirm the compute cards use 2 columns by default, 3 columns from 680px, and no more than 4 columns from 900px.

Summary by CodeRabbit

  • New Features
    • Reworked the Compute and Disk settings UI into clearer sectioned pages, including smoother navigation to the first validation error.
    • Added a transitional in-form NoticeBar for consistent alert rendering.
    • Improved billing change badges to reflect accurate before/after totals.
  • Bug Fixes
    • Fixed disk IOPS/throughput pricing to include replica-based charges.
    • Strengthened disk sizing validation (GP3 limits, legacy/size edge cases, spend-cap behavior, and provider-specific constraints).
  • Refactor
    • Updated key form field layouts for improved readability.
  • Tests
    • Expanded schema validation and pricing/billing badge test coverage.

@supabase

supabase Bot commented Jul 27, 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 ↗︎.

@vercel

vercel Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
design-system Ready Ready Preview, Comment Jul 28, 2026 5:03pm
docs Ready Ready Preview, Comment, Open in v0 Jul 28, 2026 5:03pm
studio-self-hosted Ready Ready Preview, Comment Jul 28, 2026 5:03pm
studio-staging Ready Ready Preview, Comment Jul 28, 2026 5:03pm
ui-library Ready Ready Preview, Comment Jul 28, 2026 5:03pm
zone-www-dot-com Ready Ready Preview, Comment, Open in v0 Jul 28, 2026 5:03pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Jul 28, 2026 5:03pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6c1f6777-7a54-4532-b00d-cd6c8160d394

📥 Commits

Reviewing files that changed from the base of the PR and between 15f9611 and 7f20a00.

📒 Files selected for processing (3)
  • apps/studio/components/interfaces/DiskManagement/DiskManagementForm.sections.tsx
  • apps/studio/components/interfaces/DiskManagement/fields/AutoScaleFields.tsx
  • apps/studio/components/interfaces/DiskManagement/ui/NoticeBar.tsx
🚧 Files skipped from review as they are similar to previous changes (3)
  • apps/studio/components/interfaces/DiskManagement/fields/AutoScaleFields.tsx
  • apps/studio/components/interfaces/DiskManagement/ui/NoticeBar.tsx
  • apps/studio/components/interfaces/DiskManagement/DiskManagementForm.sections.tsx

📝 Walkthrough

Walkthrough

Disk management is reorganized into page sections with centralized pricing badges, updated compute and disk controls, targeted validation scrolling, animated notices, revised page headers, and expanded pricing and storage schema tests.

Changes

Compute and disk management

Layer / File(s) Summary
Centralize review pricing and billing state
apps/studio/components/interfaces/DiskManagement/DiskManagementReviewAndSubmitDialog/..., apps/studio/components/interfaces/DiskManagement/fields/{IOPSField,ThroughputField}.tsx, apps/studio/components/interfaces/DiskManagement/DiskManagementForm.tsx
Review pricing watches relevant fields, aggregates advanced charges, and drives billing badges in the form and sticky footer.
Redesign compute and disk field presentation
apps/studio/components/interfaces/DiskManagement/fields/*, apps/studio/components/interfaces/DiskManagement/ui/NoticeBar.tsx
Compute options use a full card grid, disk controls remove local pricing and advanced-state wiring, field layouts change alignment, and new micro-upgrade and animated notice components support the revised UI.
Integrate sections and error navigation
apps/studio/components/interfaces/DiskManagement/DiskManagementForm*.tsx, apps/studio/pages/project/[ref]/settings/compute-and-disk.tsx
The form uses page sections, scrolls to invalid subsections, wires section-level pricing, and adopts the PageHeader components.
Expand pricing and storage validation tests
apps/studio/components/interfaces/DiskManagement/*test.ts
Tests cover replica-aware IOPS and throughput charges and storage schema behavior for IOPS limits, legacy disks, spend caps, and cloud providers.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant DiskManagementForm
  participant useDiskManagementReviewChanges
  participant BillingChangeBadge
  User->>DiskManagementForm: edit compute or disk settings
  DiskManagementForm->>useDiskManagementReviewChanges: watch updated form fields
  useDiskManagementReviewChanges->>DiskManagementForm: return prices and badge visibility
  DiskManagementForm->>BillingChangeBadge: render section and footer billing changes
Loading

Possibly related PRs

Suggested reviewers: charislam, ivasilov, joshenlim

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is detailed, but it does not follow the required template sections or include the requested change type/current behavior fields. Add the template sections: confirmation of reading CONTRIBUTING.md, change type, current behavior with linked issues, new behavior, and additional context.
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.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: modernizing compute and disk configuration.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/infra-compute-1-config

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.

@github-actions

github-actions Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results (tanstack)

passed  243 passed
skipped  5 skipped

Details

stats  248 tests across 29 suites
duration  3 minutes, 58 seconds
commit  7f20a00

Skipped tests

Features › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled
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

@SaxonF
SaxonF marked this pull request as ready for review July 28, 2026 03:54
@SaxonF
SaxonF requested a review from a team as a code owner July 28, 2026 03:54

@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

🧹 Nitpick comments (7)
apps/studio/pages/project/[ref]/settings/compute-and-disk.tsx (1)

14-14: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Component is named AuthSettings on the Compute and Disk page.

Pre-existing, but this line is being touched — a rename to ComputeAndDiskSettings is cheap while you're here.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/studio/pages/project/`[ref]/settings/compute-and-disk.tsx at line 14,
Rename the AuthSettings component to ComputeAndDiskSettings in the Compute and
Disk page, updating its declaration and all references consistently while
preserving its existing behavior.
apps/studio/components/interfaces/DiskManagement/fields/ComputeSizeField.tsx (2)

141-144: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

INITIALLY_VISIBLE_COUNT is now just a skeleton count.

The show-more/show-fewer behaviour is gone, so the name no longer describes its use. Rename to something like SKELETON_PLACEHOLDER_COUNT.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/studio/components/interfaces/DiskManagement/fields/ComputeSizeField.tsx`
around lines 141 - 144, Rename INITIALLY_VISIBLE_COUNT to a skeleton-specific
constant such as SKELETON_PLACEHOLDER_COUNT, and update its usage in the loading
placeholder map within the compute-size field. Do not change the number of
rendered skeletons or surrounding loading behavior.

61-68: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate free-upgrade eligibility logic.

projectComputeSize / showUpgradeBadge are computed identically here and in ComputeSizeField (Lines 114-115), each firing its own useCheckEntitlements. Extract a small useShowMicroUpgradeBadge() hook in this folder and reuse it in both.

As per coding guidelines: "Search for and reuse existing hooks or helpers before creating new ones; new abstractions should be reusable, generally named, and placed where other callers can find them."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/studio/components/interfaces/DiskManagement/fields/ComputeSizeField.tsx`
around lines 61 - 68, Extract the duplicated project compute-size and
entitlement logic into a reusable useShowMicroUpgradeBadge() hook in the
DiskManagement fields folder, using the existing useSelectedProjectQuery and
useCheckEntitlements symbols. Replace both ComputeSizeField call sites with this
hook, ensuring it performs the entitlement check once per caller and preserves
the existing nano-size eligibility result.

Source: Coding guidelines

apps/studio/components/interfaces/DiskManagement/ui/NoticeBar.tsx (2)

6-17: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

@deprecated on a brand-new component reads oddly, and it's attached to the interface.

The JSDoc block sits directly above NoticeBarProps, so tooling will mark the type rather than the component. If the intent is "temporary shim until callers move to Admonition", say so in a plain comment (or put @deprecated on the function) and link the follow-up.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/studio/components/interfaces/DiskManagement/ui/NoticeBar.tsx` around
lines 6 - 17, The deprecation annotation is incorrectly attached to the new
NoticeBarProps interface. Replace the misleading JSDoc with a plain
temporary-shim comment describing migration to Admonition, or move `@deprecated`
to the NoticeBar component function and include the follow-up reference if
available.

28-33: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use Admonition's own description and actions props instead of re-implementing them as children.

description is deliberately omitted from the prop type and then rendered as children, which bypasses AlertDescription, and actions is hand-rolled even though Admonition already has a layout-aware actions slot (packages/ui-patterns/src/Admonition/Admonition.tsx). The outer flex flex-col gap-2 div also renders empty whenever actions is undefined.

♻️ Proposed simplification
-          <Admonition {...props} className={cn(props.className, 'mb-0')}>
-            {description}
-            <div className="flex flex-col gap-2">
-              {actions && <div className="mt-2">{actions}</div>}
-            </div>
-          </Admonition>
+          <Admonition
+            {...props}
+            description={description}
+            actions={actions}
+            className={cn(props.className, 'mb-0')}
+          />
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/studio/components/interfaces/DiskManagement/ui/NoticeBar.tsx` around
lines 28 - 33, Update NoticeBar’s Admonition usage to pass description and
actions through Admonition’s native props/slots instead of rendering them as
children or wrapping actions manually. Restore those props in the NoticeBar prop
type as needed, remove the custom actions container, and preserve the existing
className merge.
apps/studio/components/interfaces/DiskManagement/DiskManagementReviewAndSubmitDialog/DiskManagementReviewAndSubmitDialog.hooks.ts (1)

96-107: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Compute badge gating is inconsistent with the other two.

showComputeBillingBadge keys off dirtyFields.computeSize while disk/advanced key off an actual price delta. Selecting a different compute size at the same price will render a $X → $X badge, unlike the other sections. Consider aligning compute on a price-delta check too.

♻️ Suggested alignment
-  const showComputeBillingBadge = isDirty && !!dirtyFields.computeSize && !errors.computeSize
+  const showComputeBillingBadge =
+    isDirty &&
+    !errors.computeSize &&
+    Number(computeSizePrice.oldPrice) !== Number(computeSizePrice.newPrice)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@apps/studio/components/interfaces/DiskManagement/DiskManagementReviewAndSubmitDialog/DiskManagementReviewAndSubmitDialog.hooks.ts`
around lines 96 - 107, Update showComputeBillingBadge to use the compute pricing
values’ actual old-versus-new price difference, matching showDiskBillingBadge
and showAdvancedBillingBadge, instead of relying on dirtyFields.computeSize.
Preserve the existing isDirty and computeSize error gating so the badge only
appears for a changed, valid compute price.
apps/studio/components/interfaces/DiskManagement/DiskManagementForm.tsx (1)

402-657: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Consider extracting the section subtrees into co-located components.

The component is now ~625 lines with clearly separable Compute / Disk / Advanced sections plus their own notices and handlers. Extracting ComputeSection, DiskSection, and AdvancedSection (co-located in this folder) would keep each under the size guidance and make the refs/badges wiring easier to follow.

As per coding guidelines: "Split components at roughly 200–300 lines or sooner when they contain distinct UI sections, tangled conditionals, or unrelated state."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/studio/components/interfaces/DiskManagement/DiskManagementForm.tsx`
around lines 402 - 657, The DiskManagementForm render is oversized and mixes
distinct Compute, Disk, and Advanced UI trees. Extract these subtrees into
co-located ComputeSection, DiskSection, and AdvancedSection components, moving
their related notices, handlers, refs, badges, and field props while preserving
existing visibility, disabled-state, and form behavior; have DiskManagementForm
compose the extracted sections.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/studio/components/interfaces/DiskManagement/DiskManagementForm.tsx`:
- Line 503: Correct the typo in the user-facing fallback message near
DiskManagementForm by changing “AWS cloud prov” to “AWS cloud provider,” while
preserving the rest of the deprecation and migration guidance unchanged.
- Around line 380-391: Replace the nested ternary assignment for scrollTarget in
DiskManagementForm with a flat ordered lookup or equivalent sequential
conditional logic. Preserve the existing field-error priority and ref mappings:
autoscale, storage, disk size, compute, then null when no match applies.

In `@apps/studio/components/interfaces/DiskManagement/fields/DiskSizeField.tsx`:
- Around line 164-167: Update the disk-size reset handler in DiskSizeField so it
triggers validation for both provisionedIOPS and throughput, matching the
existing onChange behavior and clearing stale throughput errors after totalSize
is reset.

---

Nitpick comments:
In `@apps/studio/components/interfaces/DiskManagement/DiskManagementForm.tsx`:
- Around line 402-657: The DiskManagementForm render is oversized and mixes
distinct Compute, Disk, and Advanced UI trees. Extract these subtrees into
co-located ComputeSection, DiskSection, and AdvancedSection components, moving
their related notices, handlers, refs, badges, and field props while preserving
existing visibility, disabled-state, and form behavior; have DiskManagementForm
compose the extracted sections.

In
`@apps/studio/components/interfaces/DiskManagement/DiskManagementReviewAndSubmitDialog/DiskManagementReviewAndSubmitDialog.hooks.ts`:
- Around line 96-107: Update showComputeBillingBadge to use the compute pricing
values’ actual old-versus-new price difference, matching showDiskBillingBadge
and showAdvancedBillingBadge, instead of relying on dirtyFields.computeSize.
Preserve the existing isDirty and computeSize error gating so the badge only
appears for a changed, valid compute price.

In
`@apps/studio/components/interfaces/DiskManagement/fields/ComputeSizeField.tsx`:
- Around line 141-144: Rename INITIALLY_VISIBLE_COUNT to a skeleton-specific
constant such as SKELETON_PLACEHOLDER_COUNT, and update its usage in the loading
placeholder map within the compute-size field. Do not change the number of
rendered skeletons or surrounding loading behavior.
- Around line 61-68: Extract the duplicated project compute-size and entitlement
logic into a reusable useShowMicroUpgradeBadge() hook in the DiskManagement
fields folder, using the existing useSelectedProjectQuery and
useCheckEntitlements symbols. Replace both ComputeSizeField call sites with this
hook, ensuring it performs the entitlement check once per caller and preserves
the existing nano-size eligibility result.

In `@apps/studio/components/interfaces/DiskManagement/ui/NoticeBar.tsx`:
- Around line 6-17: The deprecation annotation is incorrectly attached to the
new NoticeBarProps interface. Replace the misleading JSDoc with a plain
temporary-shim comment describing migration to Admonition, or move `@deprecated`
to the NoticeBar component function and include the follow-up reference if
available.
- Around line 28-33: Update NoticeBar’s Admonition usage to pass description and
actions through Admonition’s native props/slots instead of rendering them as
children or wrapping actions manually. Restore those props in the NoticeBar prop
type as needed, remove the custom actions container, and preserve the existing
className merge.

In `@apps/studio/pages/project/`[ref]/settings/compute-and-disk.tsx:
- Line 14: Rename the AuthSettings component to ComputeAndDiskSettings in the
Compute and Disk page, updating its declaration and all references consistently
while preserving its existing behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ed79f854-17b1-4d46-a27a-f13bc6edda5a

📥 Commits

Reviewing files that changed from the base of the PR and between c9ed51c and 165be6c.

📒 Files selected for processing (11)
  • apps/studio/components/interfaces/DiskManagement/DiskManagement.test.ts
  • apps/studio/components/interfaces/DiskManagement/DiskManagementForm.tsx
  • apps/studio/components/interfaces/DiskManagement/DiskManagementReviewAndSubmitDialog/DiskManagementReviewAndSubmitDialog.hooks.ts
  • apps/studio/components/interfaces/DiskManagement/fields/AutoScaleFields.tsx
  • apps/studio/components/interfaces/DiskManagement/fields/ComputeSizeField.tsx
  • apps/studio/components/interfaces/DiskManagement/fields/DiskSizeField.tsx
  • apps/studio/components/interfaces/DiskManagement/fields/IOPSField.tsx
  • apps/studio/components/interfaces/DiskManagement/fields/StorageTypeField.tsx
  • apps/studio/components/interfaces/DiskManagement/fields/ThroughputField.tsx
  • apps/studio/components/interfaces/DiskManagement/ui/NoticeBar.tsx
  • apps/studio/pages/project/[ref]/settings/compute-and-disk.tsx

SaxonF and others added 2 commits July 28, 2026 19:17
useDiskManagementReviewChanges and DiskSizeField read form values via
form.watch() and form.formState off a form that arrives as a prop. Those
subscriptions re-render the component that owns useForm, not the caller, so
the review dialog was only updating as a knock-on effect of its parent
re-rendering, and would go stale if either side were memoized.

- Subscribe locally with useWatch({ control }) and useFormState({ control }),
  and consume the returned values instead of re-reading via getValues(), so
  the subscribed set and the read set cannot drift apart
- Watch growthPercent, minIncrementGb and maxSizeGb, which were read but never
  subscribed to
- Guard against the NaN that an empty disk size input produces, which was
  propagating into the price calculations and read replica sizing
- Flatten the nested fetch-state ternary in ComputeSizeField into named,
  mutually exclusive guards per the Studio conventions

Claude-Session: https://claude.ai/code/session_01RTy2gyfjnzF96p2aW56VfH

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

Tested this on the staging preview and locally – everything in "How to test" checks out.

# Test Result
3 Page header + Scaling / Compute / Disk / Advanced sections, plan notice under Scaling ✅ Sections render in order, notice sits directly under the Scaling heading
4 Billing deltas in section headers + sticky review footer ✅ $9.68 › $14.83/month in the Compute header and footer, correct on the first render. Dialog totals line up (+$99.54), Cancel reverts cleanly
5 Invalid values + submit → validation message, scroll to first invalid field ✅ Scroll works on submit – rect.top went 1729 → 320. See note below on GP3
6 Representative project states ⚠️ Partial – free Micro upgrade treatment confirmed, rest weren't reproducible
7 Responsive compute cards (2 / 3 / 4 cols) ✅ Confirmed at 4 container widths. Worth noting these are container queries, so they key off the grid's own width, not the viewport

Also checked the loading and error states of the compute grid by stubbing the addons request – skeletons render 6-up in the grid, and the error admonition renders full width. Neighbouring settings pages and a nav round-trip are all clean, no console errors.

A couple I couldn't get to: GP3 IOPS/throughput are gated behind isSpendCapEnabled in disableDiskInputs, which disables them regardless of compute size – so I couldn't exercise the GP3 validation path specifically. I verified the scroll-to-error mechanism itself using Max disk size instead. Read replicas, resize cooldown, read-only and Nano+PITR weren't reproducible on a test account either.

I pushed a commit (15f9611). It builds on the useWatch/useFormState change you already made in 576e531:

  • useWatch and useFormState now take a name list and the returned values get consumed, instead of re-reading through getValues() / form.formState.defaultValues. The defaultValues reads were still going through the useForm-owned Proxy, so they weren't actually subscribed in the dialog – and keeping the watch list and the read list in sync by hand had already drifted (growthPercent, minIncrementGb and maxSizeGb were read but never watched)
  • Guarded the NaN that valueAsNumber produces on an empty disk size input – it was landing in form state and flowing into the price calcs and replica sizing
  • Flattened the nested isLoading ? … : addonsError ? … : (…) in ComputeSizeField into named guards, since it wrapped ~200 lines

Few things I noticed that predate this PR – all confirmed by stashing my changes and re-testing, so none of them are from this branch. Not blockers, but the first one might be worth a look since this PR makes it a lot more visible:

  • calculateComputeSizePrice only applies the nano → micro override to oldComputeSize, never to newComputeSize (DiskManagement.utils.ts:64-73). On a paid-plan project running nano that means any dirty form shows a phantom Compute size $9.68 › $0.00/month even when compute wasn't touched, and the footer total drops the base compute cost. Master's footer just said "N changes" so it didn't show – with a price badge it's pretty noticeable. Worth folding into this PR or a follow-up, wdyt?
  • The three autoscale fields come back as null from the API but display 50 / 4 / 60000 as placeholders, so form.reset() on footer Cancel flips them controlled → uncontrolled and the typed value sticks in the DOM. Also means the Growth percent row can't be undone by hand – you get a 50% → 50% row that won't go away. Fires a React warning each time
  • The Advanced autoscale fields aren't disabled on a free plan, so they're editable under the "Only available on Pro Plan and above" notice. Long-standing, but this PR drops the collapsible so they're visible without clicking now

Conflicts were both in import blocks that master's Admonition casing fix
(#48374) touched and this branch had rewritten:

- DiskManagementForm.tsx: kept this branch's PageSection imports; master's
  side was the pre-PR Collapsible/Separator/Admonition block, none of which
  this branch still uses
- ComputeSizeField.tsx: dropped the Admonition import, unused here since the
  branch moved to FormMessage

Master also removed the lowercase ui-patterns/admonition shim, so the two
files still importing it (DiskManagementForm.sections.tsx, ui/NoticeBar.tsx)
now import from ui-patterns/Admonition.

Claude-Session: https://claude.ai/code/session_01RTy2gyfjnzF96p2aW56VfH
@SaxonF
SaxonF merged commit 618e003 into master Jul 29, 2026
37 checks passed
@SaxonF
SaxonF deleted the chore/infra-compute-1-config branch July 29, 2026 00:56
@github-actions

github-actions Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1785286768)

Score Average Improvements Regressions
Knowledge Usage 92.3% (-8pp) - 2 🔴
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+0pp) - -
Tool Usage 72.5% (+0pp) 1 🟢 1 🔴
URL Validity 100% - -
Time_to_first_token 2.84tok (-0.35tok) 18 🟢 11 🔴
Llm_calls 6.83 (-0.46) 5 🟢 17 🔴
Tool_calls 2.78 (-0.03) 9 🟢 11 🔴
Errors 8.48 (+8.46) - 29 🔴
Llm_errors 4.21 (+4.2) - 29 🔴
Tool_errors 0 (+0) - -
Prompt_tokens 24422.72tok (+2238.99tok) 14 🟢 11 🔴
Prompt_cached_tokens 7379.86tok (+58.85tok) 12 🟢 14 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 601.8tok (+23.4tok) 11 🟢 18 🔴
Completion_reasoning_tokens 98.3tok (-2.8tok) 13 🟢 14 🔴
Total_tokens 25024.53tok (+2262.39tok) 16 🟢 13 🔴
Estimated_cost 0$ (+0$) 16 🟢 13 🔴
Duration 16.62s (-0.47s) 18 🟢 11 🔴
Llm_duration 10.95s (-1.71s) 23 🟢 6 🔴

alaister added a commit that referenced this pull request Jul 29, 2026
## Summary

This is the second step towards merging compute and disk with
infrastructure. There are some usage charts on the current
infrastructure page that are useful to have in the context of compute
and disk settings. This branch adds two charts which give a general
sense of usage and whether an upgrade needs to happen. Other data points
in infrastructure can be found within observability and organisation
usage.

- Adds rolling seven-day Compute and Disk charts to the existing Compute
and Disk page.
- Shows CPU, memory, optional burstable disk IO, and disk usage split
into database, WAL, and system data.
- Covers loading, error, empty, warning, and critical states, retaining
the 75% warning and 90% critical thresholds.
- Uses a dedicated PageSection and keeps the charts in two columns from
680px.
- Uses the concise primary labels Compute and Disk, removes the database
report link, and removes tooltip icons from secondary metrics.
- Adds transformation, summary, and component tests covering dedicated
IO behavior, legacy anchors, responsive layout, rolling refetch, and
tooltip behavior.

## Stack

1. #48368
2. #48369 (this PR)
3. #48370

## How to test

1. Check out `chore/infra-compute-2-charts` and start Studio with `pnpm
dev:studio`.
2. Open `/project/<ref>/settings/compute-and-disk` on a project with
recent metrics.
3. Confirm the charts are in their own page section with standard
spacing below the page header.
4. Confirm the Compute chart shows CPU and memory, plus disk IO when
applicable, and the Disk chart splits usage into database, WAL, and
system data.
5. Confirm the primary labels are Compute and Disk, secondary metrics do
not show tooltip icons, and there is no Database Observability/report
link.
6. Resize across 680px. The charts should remain in two columns at and
above the breakpoint and stack into two rows below it.
7. Exercise loading, error, empty, warning, and critical responses with
the metrics mocks or response overrides. Confirm warning styling begins
at 75%, critical styling begins at 90%, and an error or empty response
does not break the configuration form.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added compute and disk usage charts to the disk management interface,
including metric cards for CPU, memory, disk I/O, database, WAL, and
system.
* Added usage status indicators, peak calculations, tooltips, and a
detailed disk breakdown with placeholders when data is missing.
* Added special handling for dedicated-I/O instances to hide burst-only
disk I/O.
* **Style**
* Simplified the disk space display by removing supplemental explanatory
text.
* **Tests**
* Added comprehensive test coverage for chart rendering,
loading/error/empty states, status/peak calculations, and rolling 7-day
data window behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Alaister Young <[email protected]>
alaister added a commit that referenced this pull request Jul 29, 2026
## Summary

This is the final step in merging compute and disk with infrastructure
to become a single place to manage everything. This moves everything
we've done in compute and disk over to infrastructure along with
redirects.

- Makes Infrastructure canonical for the completed compute and disk
configuration and usage charts.
- Moves Service Versions to General Project Settings.
- Removes the legacy Infrastructure activity implementation and
constants.
- Updates settings navigation, shortcuts, banners, billing links,
warning CTAs, usage pages, support suggestions, and other internal entry
points.
- Adds the permanent `/settings/compute-and-disk` redirect, removes its
Next and TanStack routes, regenerates the route tree, and updates the
migration checklist.
- Preserves query parameters and legacy metric anchors, including
`#cpu`.

## Stack

1. #48368
2. #48369
3. #48370 (this PR)

## How to test

1. Check out `chore/infra-compute-3-cutover`.
2. Test the Next implementation with `pnpm dev:studio`, then stop it and
test TanStack with `STUDIO_FRAMEWORK=tanstack pnpm dev:studio`.
3. In each implementation, open
`/project/<ref>/settings/infrastructure`. Confirm the page contains the
usage charts and the Scaling, Compute, Disk, and Advanced configuration
sections.
4. Open `/project/<ref>/settings/general`. Confirm Service Versions
appears there with its existing name, content, and styling, and no
longer appears on Infrastructure.
5. Open `/project/<ref>/settings/compute-and-disk?upgrade=micro#disk`.
Confirm it permanently redirects to
`/project/<ref>/settings/infrastructure?upgrade=micro#disk`, preserving
the query string and hash.
6. Confirm the settings menu exposes Infrastructure and no longer
exposes Compute and Disk. Repeat with platform and self-hosted settings.
7. Follow representative entry points from billing usage, resource
warning CTAs, upgrade banners, shortcuts, and support suggestions.
Confirm they land on Infrastructure and preserve any query parameters or
metric anchors such as `#cpu`.
8. Smoke-test compute and disk updates from Infrastructure, including
validation, the sticky review footer, and warning/critical chart states.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Consolidated compute and disk management under the **Infrastructure**
project settings page.
* Added a **Service versions** section to **General** project settings.
* **Bug Fixes**
* Updated links and upgrade CTAs across the product to route to the
correct **Infrastructure** or **Service versions** destinations.
* Added permanent redirects from legacy **Compute and Disk** to
**Infrastructure**, preserving query/hash.
  * Improved resource warning upgrade routing for compute scenarios.
* **Tests**
* Expanded automated coverage for **Infrastructure**, **Service
versions**, redirects, and warning-link routing.
* **Chores**
  * Updated ESLint rule baseline configuration for the studio app.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Alaister Young <[email protected]>
@coderabbitai coderabbitai Bot mentioned this pull request Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants