mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
## What kind of change does this PR introduce? Copy/label update in Studio's compute surfaces. ## Description Compute CPU descriptions now branch on the compute size tier: - Sizes below Large read **"Shared compute"** (no core count) - Large and up read **"Dedicated · N vCPUs"** — the unit is always vCPU Changes: - New `lib/compute-labels.ts` helper (`isSharedComputeSize`, `getComputeCpuLabel`) with unit tests - Compute badge hover card, compute size picker, and project-creation selector use the new labels - `new-project.constants.ts` cpu strings updated accordingly - ">16XL" card: "Custom CPU" → "Custom compute"; upsell copy now says "64 vCPUs" - The synthetic Nano/Micro addon `meta` no longer has `cpu_cores`/`cpu_dedicated`; removed the now-unused cpu fields from the hardcoded instance specs - Project-creation sub-text: "Larger, dedicated compute available after creation" ## Tests - New unit tests for the label helper - Infrastructure settings page test now asserts the rendered labels Fixes PROD-663 Related #49998 #49996 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **User Interface** * Updated compute-size labels to use “Shared compute” and vCPU terminology. * Clarified dedicated compute options and availability messaging. * Updated custom instance and upgrade labels, including “Custom compute” and “64 vCPUs.” * **Consistency** * Standardized compute labels across project creation, infrastructure settings, and compute details. * **Tests** * Added coverage verifying shared and dedicated compute classifications and displayed labels. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
15 lines
671 B
TypeScript
15 lines
671 B
TypeScript
/** Compute sizes below Large run on shared compute; Large and up are dedicated. */
|
|
const SHARED_COMPUTE_SIZES = ['pico', 'nano', 'micro', 'small', 'medium']
|
|
|
|
export const isSharedComputeSize = (size: string) =>
|
|
SHARED_COMPUTE_SIZES.includes(size.toLowerCase().replace(/^ci_/, ''))
|
|
|
|
/**
|
|
* User-facing CPU description for a compute size. Branches on the size itself,
|
|
* not on `meta.cpu_cores` — the platform is dropping that field.
|
|
*/
|
|
export const getComputeCpuLabel = (size: string, vcpuCount?: number) => {
|
|
if (isSharedComputeSize(size)) return 'Shared compute'
|
|
return typeof vcpuCount === 'number' ? `Dedicated · ${vcpuCount} vCPUs` : 'Dedicated compute'
|
|
}
|