Skip to content

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

Fix width of unified logs table to fit viewport, which fixes centering of load more button (#45914)

Joshen Lim597ad2ba568d
diff --git a/apps/studio/components/interfaces/UnifiedLogs/UnifiedLogs.tsx b/apps/studio/components/interfaces/UnifiedLogs/UnifiedLogs.tsx
index ff810fc1e5f..76eb5d2ce9d 100644
--- a/apps/studio/components/interfaces/UnifiedLogs/UnifiedLogs.tsx
+++ b/apps/studio/components/interfaces/UnifiedLogs/UnifiedLogs.tsx
@@ -439,7 +439,16 @@ export const UnifiedLogs = () => {
isFetchingButNotPaginating && 'opacity-60 transition-opacity duration-150'
)}
>
- <div className="h-full [&>div]:h-full [&_thead_tr]:bg-[linear-gradient(to_bottom,hsl(var(--background-default)),hsl(var(--background-surface-75)))]! [&_thead_th]:[border-top:none]! [&_thead_th]:[border-bottom:none]! [&_thead_th]:[box-shadow:inset_0_-1px_0_hsl(var(--border-default))]! [&_thead_tr]:border-b-0! [&_tbody_tr]:border-b-0! [&_thead_tr:hover]:bg-[linear-gradient(to_bottom,hsl(var(--background-default)),hsl(var(--background-surface-75)))]! [&_thead_th]:text-foreground-lighter!">
+ <div
+ className={cn(
+ 'h-full [&>div]:h-full',
+ '[&_thead_tr]:bg-[linear-gradient(to_bottom,hsl(var(--background-default)),hsl(var(--background-surface-75)))]!',
+ '[&_thead_th]:[border-top:none]! [&_thead_th]:[border-bottom:none]!',
+ '[&_thead_th]:[box-shadow:inset_0_-1px_0_hsl(var(--border-default))]!',
+ '[&_thead_tr]:border-b-0! [&_tbody_tr]:border-b-0! [&_thead_tr:hover]:bg-[linear-gradient(to_bottom,hsl(var(--background-default)),hsl(var(--background-surface-75)))]!',
+ '[&_thead_th]:text-foreground-lighter!'
+ )}
+ >
<DataTableInfinite
columns={UNIFIED_LOGS_COLUMNS}
totalRows={totalDBRowCount}
diff --git a/apps/studio/components/ui/DataTable/DataTableInfinite.tsx b/apps/studio/components/ui/DataTable/DataTableInfinite.tsx
index a1d75b908a0..c9154c7dafd 100644
--- a/apps/studio/components/ui/DataTable/DataTableInfinite.tsx
+++ b/apps/studio/components/ui/DataTable/DataTableInfinite.tsx
@@ -90,7 +90,8 @@ export function DataTableInfinite<TData, TValue, TMeta>({
return (
<TableHead
key={header.id}
- className={headerClassName}
+ id={header.id}
+ className={cn('w-full', headerClassName)}
aria-sort={sort === 'asc' ? 'ascending' : sort === 'desc' ? 'descending' : 'none'}
>
{header.isPlaceholder
diff --git a/apps/studio/components/ui/DataTable/Table.tsx b/apps/studio/components/ui/DataTable/Table.tsx
index 49ba750768b..7b5c3d8798c 100644
--- a/apps/studio/components/ui/DataTable/Table.tsx
+++ b/apps/studio/components/ui/DataTable/Table.tsx
@@ -20,7 +20,7 @@ export const Table = forwardRef<HTMLTableElement, ComponentPropsWithRef<typeof S
className={cn(className)}
containerProps={{
onScroll,
- className: 'h-full w-full overflow-auto table-fixed min-w-max caption-bottom text-sm',
+ className: 'h-full w-full overflow-auto caption-bottom text-sm [&>table]:table-fixed',
}}
/>
)