Files
supabase/apps/studio/components
Monica Khoury 0f2f3e4eb7 fix: update storage size unit correctly after navigation (#48932)
Fixes FE-4128. 

## What is the current behavior?

When updating the global Storage file size limit using a unit other than
MB, the selected unit displays an incorrect value after navigating away
from the Storage settings page and returning.

The updated file size is persisted correctly by the API, but the unit
selector does not always reflect the value derived from the persisted
configuration.

The Save button also remains enabled after successfully saving the
updated configuration.

## What is the new behavior?

The file size unit selector now correctly reflects the unit derived from
the persisted global file size limit after saving and navigating between
pages.

The form state is also correctly synchronized with the latest Storage
configuration after an update, so the Save button returns to its
disabled state once the changes have been persisted.

## Additional context

The Storage API persists the global file size limit in bytes rather than
persisting the selected display unit separately. The dashboard derives
the appropriate unit (MB/GB) from the stored byte value when loading the
configuration.

The issue was caused by the unit Select retaining stale internal state
when the form values were reset after the Storage configuration was
loaded/refetched. Ensuring the Select is refreshed when the controlled
unit changes keeps the displayed unit synchronized with the form state.


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

* **Bug Fixes**
* Improved storage settings form initialization when configuration and
entitlements load.
* Ensured storage unit selections and placeholders display consistently.
  * Improved form resetting to reflect the latest loaded settings.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-11 07:17:06 -06:00
..

Writing components

Where to create your components

  • For components that declare the general structure and layout of a page:
    • /components/layouts/xxx
  • For components that are tightly coupled to a specific interface:
    • /components/interfaces/xxx
  • For components that are meant to be reusable across multiple pages:
    • /components/ui/xxx
  • Note: We're gradually moving files out of the to-be-cleaned folder into the respective folders as we refactor

Component structure

  • If a component has constants and utility methods that are tightly coupled to itself, keep them close to the component and enclose them in a folder with an index.tsx as an entry point
  • Otherwise it can just be a file on its own
  • For example:
    • components/ui
      - SampleComponentA
        - SampleComponentA.tsx
        - SampleComponentA.constants.ts
        - SampleComponentA.utils.ts
        - SampleComponentA.types.ts
        - index.ts
      - SampleComponentB.tsx
      

Template for building components


// Declare the prop types of your component
interface ComponentAProps {
  sampleProp: string
}

// Name your component accordingly — use a named export, not a default export
export const ComponentA = ({ sampleProp }: ComponentAProps) => {
  return <div>ComponentA: {sampleProp}</div>
}