Files
supabase/apps/studio/components
Danny White b009175ab0 fix(studio): keep report toolbars clear of wrapped content (#53302)
## Problem

Funky layout. Observability report toolbars reserve a fixed height. When
controls wrap on narrow screens, they can overlap report content.
Refresh, date and Docs controls also have inconsistent alignment.

## Solution

Keep the sticky toolbar in normal document flow so its actual height
determines content spacing. Align refresh and date controls to the left
and Docs to the right across Auth, Database, Edge Functions, Data API,
Realtime and Storage reports.

<!-- linear:table-colwidths:550,137 -->
<table>
<thead>
<tr>
<th>Before</th>
<th>After</th>
</tr>
</thead>
<tbody>
<tr>
<td><img
src="https://github.com/user-attachments/assets/05c2d0cd-1893-4491-92e4-3b445ab47300
" alt="CleanShot 2026-11-12 at 17 44 20@2x" width="1652"
data-linear-height="878" /></td>
<td><img
src="https://github.com/user-attachments/assets/f8873c55-2c5d-45fa-9d40-643002ef7ff8
" alt="CleanShot 2026-11-12 at 17 44 43@2x" width="1658"
data-linear-height="850" /></td>
</tr>
<tr>
<td><img
src="https://github.com/user-attachments/assets/ac6467c0-9e08-4420-b55f-e1965bb25f3f
" alt="CleanShot 2026-11-12 at 17 45 01@2x" width="1650"
data-linear-height="252" /></td>
<td><img
src="https://github.com/user-attachments/assets/90e69f62-f811-4039-8c2b-64b3e1a3e679
" alt="CleanShot 2026-11-12 at 17 45 11@2x" width="1646"
data-linear-height="250" /></td>
</tr>
<tr>
<td><img
src="https://github.com/user-attachments/assets/657ce909-b057-4e0c-aa1a-2e9427ddb72d
" alt="CleanShot 2026-11-12 at 17 54 51@2x" width="1000"
data-linear-height="222" /></td>
<td><img
src="https://github.com/user-attachments/assets/b7763a8c-8cd2-486b-a99a-fa7c75539bf0
" alt="CleanShot 2026-11-12 at 17 53 10@2x" width="992"
data-linear-height="224" /></td>
</tr>
<tr>
<td>*Note the awkward shadow on the left and right.*</td>
<td></td>
</tr>
</tbody>
</table>

## Review instructions

1. Open **Observability > Database**, then Auth, Edge Functions, Data
API, Realtime and Storage.
2. Check refresh and date controls on the left and Docs on the right.
3. Narrow the viewport until controls wrap, then scroll. Check that the
toolbar stays sticky and report content remains below it.
2026-11-13 10:54:09 +11: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>
}