mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
## Problem The CPU usage chart in the Observability dashboard could show values exceeding 100%, differing from the internal Grafana panel that support uses for debugging. ## Solution Add a stackedPercent prop to the chart system that locks the Y-axis to [0, 100]. When enabled, the chart never visually overflows 100% while tooltip values remain completely untouched. We fill the rest of the unused with an "Idle" prop. # Before <img width="1240" height="684" alt="CleanShot 2026-03-18 at 16 04 26@2x" src="https://github.com/user-attachments/assets/c1b1a5ac-86e0-4d6b-9bc4-c7837f30c28c" /> ## After <img width="1240" height="684" alt="CleanShot 2026-03-18 at 16 03 13@2x" src="https://github.com/user-attachments/assets/419eea55-176d-46c4-8780-b8c372428047" /> <img width="934" height="700" alt="CleanShot 2026-03-18 at 16 03 41@2x" src="https://github.com/user-attachments/assets/9b5ef61d-21f4-40e4-ab0c-1a11caadb1f8" /> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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-cleanedfolder 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.tsxas 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
const ComponentA = ({ sampleProp }: ComponentAProps) => {
return <div>ComponentA: {sampleProp}</div>
}
export default ComponentA