Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: minor styling tweaks to prevent chart overflow hiding

TzeYiingcea06f9ad737
diff --git a/studio/components/interfaces/Reports/ReportWidget.tsx b/studio/components/interfaces/Reports/ReportWidget.tsx
index 6a1b1328fbe..72e51182525 100644
--- a/studio/components/interfaces/Reports/ReportWidget.tsx
+++ b/studio/components/interfaces/Reports/ReportWidget.tsx
@@ -31,6 +31,7 @@ const ReportWidget: React.FC<ReportWidgetProps> = (props) => {
return (
<Panel
noMargin
+ noHideOverflow
className={'pb-0 ' + props.className}
bodyClassName="h-full"
wrapWithLoading={false}
diff --git a/studio/components/interfaces/Reports/renderers/ApiRenderers.tsx b/studio/components/interfaces/Reports/renderers/ApiRenderers.tsx
index 7d6b4798fdf..70a689b9eaa 100644
--- a/studio/components/interfaces/Reports/renderers/ApiRenderers.tsx
+++ b/studio/components/interfaces/Reports/renderers/ApiRenderers.tsx
@@ -15,7 +15,7 @@ export const renderTotalRequests = (
size="small"
minimalHeader
highlightedValue={total}
- className="w-full h-42"
+ className="w-full"
data={props.data}
yAxisKey="count"
xAxisKey="timestamp"
@@ -37,8 +37,8 @@ export const renderErrorCounts = (
<BarChart
size="small"
minimalHeader
+ className="w-full"
highlightedValue={total}
- className="w-full h-42"
data={props.data}
yAxisKey="count"
xAxisKey="timestamp"
@@ -66,7 +66,7 @@ export const renderResponseSpeed = (
highlightedValue={lastAvg}
format="ms"
minimalHeader
- className="w-full h-42"
+ className="w-full"
data={transformedData}
yAxisKey="avg"
xAxisKey="timestamp"
diff --git a/studio/components/ui/Charts/BarChart.tsx b/studio/components/ui/Charts/BarChart.tsx
index c7efd6ac5a0..7970e8f5a64 100644
--- a/studio/components/ui/Charts/BarChart.tsx
+++ b/studio/components/ui/Charts/BarChart.tsx
@@ -121,7 +121,7 @@ const BarChart: React.FC<BarChartProps> = ({
</RechartBarChart>
</Container>
{data && (
- <div className="text-scale-900 -mt-5 flex items-center justify-between text-xs">
+ <div className="text-scale-900 -mt-9 flex items-center justify-between text-xs">
<span>{dayjs(data[0][xAxisKey]).format(customDateFormat)}</span>
<span>{dayjs(data[data?.length - 1]?.[xAxisKey]).format(customDateFormat)}</span>
</div>
diff --git a/studio/components/ui/Charts/Charts.types.tsx b/studio/components/ui/Charts/Charts.types.tsx
index 3332fc441ae..6b5a1aa3650 100644
--- a/studio/components/ui/Charts/Charts.types.tsx
+++ b/studio/components/ui/Charts/Charts.types.tsx
@@ -14,7 +14,7 @@ export interface CommonChartProps<D>
title?: string
className?: string
isLoading?: boolean
- size?: 'small' | 'normal' | 'large'
+ size?: 'tiny' | 'small' | 'normal' | 'large'
}
export interface StackedChartProps<D> extends CommonChartProps<D> {
diff --git a/studio/components/ui/Charts/Charts.utils.tsx b/studio/components/ui/Charts/Charts.utils.tsx
index ce988a2d86b..913f9965b8b 100644
--- a/studio/components/ui/Charts/Charts.utils.tsx
+++ b/studio/components/ui/Charts/Charts.utils.tsx
@@ -70,10 +70,16 @@ export const timestampFormatter = (
export const useChartSize = (
size: CommonChartProps<any>['size'] = 'normal',
sizeMap: {
+ tiny: number
small: number
normal: number
large: number
- } = { small: 120, normal: 160, large: 280 }
+ } = {
+ tiny: 76,
+ small: 96,
+ normal: 160,
+ large: 280,
+ }
) => {
const minHeight = sizeMap[size]
const Container: React.FC = useMemo(
diff --git a/studio/components/ui/Panel.tsx b/studio/components/ui/Panel.tsx
index 60584e05f1b..da3ab4d1975 100644
--- a/studio/components/ui/Panel.tsx
+++ b/studio/components/ui/Panel.tsx
@@ -11,6 +11,7 @@ interface Props {
noMargin?: boolean
title?: JSX.Element | false
wrapWithLoading?: boolean
+ noHideOverflow?: boolean
}
function Panel(props: Props) {
let headerClasses: string[] = []
@@ -31,7 +32,7 @@ function Panel(props: Props) {
const content = (
<div
className={`
- overflow-hidden rounded-md border
+ ${props.noHideOverflow ? '' : 'overflow-hidden'} rounded-md border
border-panel-border-light shadow-sm
dark:border-panel-border-dark ${props.noMargin ? '' : 'mb-8'} ${props.className}`}
>
diff --git a/studio/tests/pages/projects/reports/api-report.test.js b/studio/tests/pages/projects/reports/api-report.test.js
index 92cb474d077..f0ccac0a85d 100644
--- a/studio/tests/pages/projects/reports/api-report.test.js
+++ b/studio/tests/pages/projects/reports/api-report.test.js
@@ -22,6 +22,7 @@ test(`static elements`, async () => {
test('refresh button', async () => {
render(<ApiReport />)
await waitFor(() => expect(get).toBeCalled())
+ expect(screen.findByText(/Refreshing/)).resolves.toThrow()
get.mockReset()
userEvent.click(await screen.findByText(/Refresh/))
await waitFor(() => expect(get).toBeCalled())