Files
supabase/apps/studio/components
Claude eeeae037da feat(storage): make version list mocks adapt to bucket policy
- Remove the 'Restoring is non-destructive' admonition from the
  bottom of the Versions tab
- Refactor getMockObjectVersions to accept the bucket's current
  cap and expiryDays and adapt its output so version-list labels
  are always consistent with the policy:
    * Never returns a version older than the retention window
      (no 'Past Nd limit' surprises when the user set fewer days)
    * Never returns more noncurrent versions than the cap
      (no '#3 of 2' when the user tightened the cap)
- Anchor all version timestamps to the real clock via
  daysAgoFromNow so the mock stays fresh regardless of when the
  prototype is opened, instead of drifting away from the fixed
  BASE_DATE
- Wire useObjectVersionsQuery to look up the bucket's protection
  and pass it into the mock on every fetch, so policy edits from
  the bucket modal reflect in the panel next time it opens

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TiUEvmC84bRsteqsWXHY2p
2026-08-11 14:40:45 +00: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>
}