Skip to content

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

Fix overflows on insights tables

Terry Sutton3eab73207ffa
diff --git a/studio/components/interfaces/Auth/Users/Users.tsx b/studio/components/interfaces/Auth/Users/Users.tsx
index 6f726cb8c4c..8f4e0536cad 100644
--- a/studio/components/interfaces/Auth/Users/Users.tsx
+++ b/studio/components/interfaces/Auth/Users/Users.tsx
@@ -108,7 +108,7 @@ const Users = () => {
{inviteEnabled && <InviteUserModal />}
</div>
</div>
- <section className="users-table-container mt-4 overflow-visible px-6">
+ <section className="thin-scrollbars mt-4 overflow-visible px-6">
<div className="section-block--body relative overflow-x-auto rounded">
<div className="inline-block min-w-full align-middle">
<UsersList />
diff --git a/studio/pages/_app.tsx b/studio/pages/_app.tsx
index f542d30ca75..02dd7f1361c 100644
--- a/studio/pages/_app.tsx
+++ b/studio/pages/_app.tsx
@@ -10,7 +10,6 @@ import 'styles/contextMenu.scss'
import 'styles/react-data-grid-logs.scss'
import 'styles/date-picker.scss'
import 'styles/grid.scss'
-import 'styles/users-table.scss'
import dayjs from 'dayjs'
import customParseFormat from 'dayjs/plugin/customParseFormat'
diff --git a/studio/pages/project/[ref]/database/insights.tsx b/studio/pages/project/[ref]/database/insights.tsx
index b00f36e7569..003d11c363c 100644
--- a/studio/pages/project/[ref]/database/insights.tsx
+++ b/studio/pages/project/[ref]/database/insights.tsx
@@ -216,40 +216,44 @@ export const Content = () => {
label="Most time consuming"
className="px-16 text-sm max-w-none"
>
- <Table
- head={
- <>
- <Table.th className="table-cell">rol name</Table.th>
- <Table.th className="table-cell">prop_total_time</Table.th>
- <Table.th className="table-cell">calls</Table.th>
- <Table.th className="table-cell">total_time</Table.th>
- <Table.th className="table-cell w-[200px]">query</Table.th>
- </>
- }
- body={
- isLoadedQueryMostTimeConsumingData ? (
- QueryMostTimeConsumingData[0].data.map((item, i) => {
- return (
- <Table.tr key={i} hoverable className="relative">
- <Table.td className="table-cell whitespace-nowrap">{item.rolname}</Table.td>
- <Table.td className="table-cell whitespace-nowrap">
- {item.prop_total_time}
- </Table.td>
- <Table.td className="table-cell whitespace-nowrap">{item.calls}</Table.td>
- <Table.td className="table-cell whitespace-nowrap">
- {item.total_time}
- </Table.td>
- <Table.td className="w-[200px] table-cell whitespace-nowrap truncate">
- <p className="truncate">{item.query}</p>
- </Table.td>
- </Table.tr>
- )
- })
- ) : (
- <></>
- )
- }
- />
+ <div className="thin-scrollbars max-w-full overflow-scroll">
+ <Table
+ head={
+ <>
+ <Table.th className="table-cell">rol name</Table.th>
+ <Table.th className="table-cell">prop_total_time</Table.th>
+ <Table.th className="table-cell">calls</Table.th>
+ <Table.th className="table-cell">total_time</Table.th>
+ <Table.th className="table-cell w-[200px]">query</Table.th>
+ </>
+ }
+ body={
+ isLoadedQueryMostTimeConsumingData ? (
+ QueryMostTimeConsumingData[0].data.map((item, i) => {
+ return (
+ <Table.tr key={i} hoverable className="relative">
+ <Table.td className="table-cell whitespace-nowrap">
+ {item.rolname}
+ </Table.td>
+ <Table.td className="table-cell whitespace-nowrap">
+ {item.prop_total_time}
+ </Table.td>
+ <Table.td className="table-cell whitespace-nowrap">{item.calls}</Table.td>
+ <Table.td className="table-cell whitespace-nowrap">
+ {item.total_time}
+ </Table.td>
+ <Table.td className="w-[200px] table-cell whitespace-nowrap truncate">
+ <p className="truncate">{item.query}</p>
+ </Table.td>
+ </Table.tr>
+ )
+ })
+ ) : (
+ <></>
+ )
+ }
+ />
+ </div>
</Tabs.Panel>
<Tabs.Panel
key={2}
@@ -257,53 +261,57 @@ export const Content = () => {
label="Most frequently used"
className="px-16 text-sm max-w-none"
>
- <Table
- head={
- <>
- {/* <Table.th className="table-cell">source</Table.th> */}
- <Table.th className="table-cell">rolname</Table.th>
- <Table.th className="table-cell">avg_rows</Table.th>
- <Table.th className="table-cell">calls</Table.th>
- <Table.th className="table-cell">max_time</Table.th>
- <Table.th className="table-cell">mean_time</Table.th>
- <Table.th className="table-cell">min_time</Table.th>
- <Table.th className="table-cell">total_time</Table.th>
- <Table.th className="table-cell">query</Table.th>
- </>
- }
- body={
- isLoadedQueryMostFrequentlyInvokedData ? (
- QueryMostFrequentlyInvokedData[0].data.map((item, i) => {
- return (
- <Table.tr key={i} hoverable className="relative">
- <Table.td className="table-cell whitespace-nowrap">{item.rolname}</Table.td>
- <Table.td className="table-cell whitespace-nowrap">
- {item.avg_rows}
- </Table.td>
- <Table.td className="table-cell whitespace-nowrap">{item.calls}</Table.td>
- <Table.td className="table-cell whitespace-nowrap">
- {item.max_time}
- </Table.td>
- <Table.td className="table-cell whitespace-nowrap truncate">
- {item.mean_time}
- </Table.td>
- <Table.td className="table-cell whitespace-nowrap truncate">
- {item.min_time}
- </Table.td>
- <Table.td className="table-cell whitespace-nowrap truncate">
- {item.total_time}
- </Table.td>
- <Table.td className="table-cell whitespace-nowrap truncate">
- {item.query}
- </Table.td>
- </Table.tr>
- )
- })
- ) : (
- <></>
- )
- }
- />
+ <div className="thin-scrollbars max-w-full overflow-scroll">
+ <Table
+ head={
+ <>
+ {/* <Table.th className="table-cell">source</Table.th> */}
+ <Table.th className="table-cell">rolname</Table.th>
+ <Table.th className="table-cell">avg_rows</Table.th>
+ <Table.th className="table-cell">calls</Table.th>
+ <Table.th className="table-cell">max_time</Table.th>
+ <Table.th className="table-cell">mean_time</Table.th>
+ <Table.th className="table-cell">min_time</Table.th>
+ <Table.th className="table-cell">total_time</Table.th>
+ <Table.th className="table-cell">query</Table.th>
+ </>
+ }
+ body={
+ isLoadedQueryMostFrequentlyInvokedData ? (
+ QueryMostFrequentlyInvokedData[0].data.map((item, i) => {
+ return (
+ <Table.tr key={i} hoverable className="relative">
+ <Table.td className="table-cell whitespace-nowrap">
+ {item.rolname}
+ </Table.td>
+ <Table.td className="table-cell whitespace-nowrap">
+ {item.avg_rows}
+ </Table.td>
+ <Table.td className="table-cell whitespace-nowrap">{item.calls}</Table.td>
+ <Table.td className="table-cell whitespace-nowrap">
+ {item.max_time}
+ </Table.td>
+ <Table.td className="table-cell whitespace-nowrap truncate">
+ {item.mean_time}
+ </Table.td>
+ <Table.td className="table-cell whitespace-nowrap truncate">
+ {item.min_time}
+ </Table.td>
+ <Table.td className="table-cell whitespace-nowrap truncate">
+ {item.total_time}
+ </Table.td>
+ <Table.td className="table-cell whitespace-nowrap truncate">
+ {item.query}
+ </Table.td>
+ </Table.tr>
+ )
+ })
+ ) : (
+ <></>
+ )
+ }
+ />
+ </div>
</Tabs.Panel>
<Tabs.Panel
key={3}
@@ -311,52 +319,56 @@ export const Content = () => {
label="Slowest execution time"
className="px-16 text-sm max-w-none"
>
- <Table
- head={
- <>
- <Table.th className="table-cell">rolname</Table.th>
- <Table.th className="table-cell">avg_rows</Table.th>
- <Table.th className="table-cell">calls</Table.th>
- <Table.th className="table-cell">max_time</Table.th>
- <Table.th className="table-cell">mean_time</Table.th>
- <Table.th className="table-cell">min_time</Table.th>
- <Table.th className="table-cell">total_time</Table.th>
- <Table.th className="table-cell">query</Table.th>
- </>
- }
- body={
- isLoadedQuerySlowestExecutionTimeData ? (
- QuerySlowestExecutionTimeData[0].data.map((item, i) => {
- return (
- <Table.tr key={i} hoverable className="relative">
- <Table.td className="table-cell whitespace-nowrap">{item.rolname}</Table.td>
- <Table.td className="table-cell whitespace-nowrap">
- {item.avg_rows}
- </Table.td>
- <Table.td className="table-cell whitespace-nowrap">{item.calls}</Table.td>
- <Table.td className="table-cell whitespace-nowrap">
- {item.max_time}
- </Table.td>
- <Table.td className="table-cell whitespace-nowrap truncate">
- {item.mean_time}
- </Table.td>
- <Table.td className="table-cell whitespace-nowrap truncate">
- {item.min_time}
- </Table.td>
- <Table.td className="table-cell whitespace-nowrap truncate">
- {item.total_time}
- </Table.td>
- <Table.td className="table-cell whitespace-nowrap truncate">
- {item.query}
- </Table.td>
- </Table.tr>
- )
- })
- ) : (
- <></>
- )
- }
- />
+ <div className="thin-scrollbars max-w-full overflow-scroll">
+ <Table
+ head={
+ <>
+ <Table.th className="table-cell">rolname</Table.th>
+ <Table.th className="table-cell">avg_rows</Table.th>
+ <Table.th className="table-cell">calls</Table.th>
+ <Table.th className="table-cell">max_time</Table.th>
+ <Table.th className="table-cell">mean_time</Table.th>
+ <Table.th className="table-cell">min_time</Table.th>
+ <Table.th className="table-cell">total_time</Table.th>
+ <Table.th className="table-cell">query</Table.th>
+ </>
+ }
+ body={
+ isLoadedQuerySlowestExecutionTimeData ? (
+ QuerySlowestExecutionTimeData[0].data.map((item, i) => {
+ return (
+ <Table.tr key={i} hoverable className="relative">
+ <Table.td className="table-cell whitespace-nowrap">
+ {item.rolname}
+ </Table.td>
+ <Table.td className="table-cell whitespace-nowrap">
+ {item.avg_rows}
+ </Table.td>
+ <Table.td className="table-cell whitespace-nowrap">{item.calls}</Table.td>
+ <Table.td className="table-cell whitespace-nowrap">
+ {item.max_time}
+ </Table.td>
+ <Table.td className="table-cell whitespace-nowrap truncate">
+ {item.mean_time}
+ </Table.td>
+ <Table.td className="table-cell whitespace-nowrap truncate">
+ {item.min_time}
+ </Table.td>
+ <Table.td className="table-cell whitespace-nowrap truncate">
+ {item.total_time}
+ </Table.td>
+ <Table.td className="table-cell whitespace-nowrap truncate">
+ {item.query}
+ </Table.td>
+ </Table.tr>
+ )
+ })
+ ) : (
+ <></>
+ )
+ }
+ />
+ </div>
</Tabs.Panel>
</Tabs>
</div>
diff --git a/studio/styles/ui.scss b/studio/styles/ui.scss
index e60672668f8..891b2a0bb7d 100644
--- a/studio/styles/ui.scss
+++ b/studio/styles/ui.scss
@@ -373,3 +373,43 @@
@apply mt-1;
}
}
+
+.thin-scrollbars {
+ scrollbar-width: thin;
+ scrollbar-color: var(--colors-slate9) var(--colors-slate1);
+
+ .dark & {
+ scrollbar-color: var(--colors-slate10) var(--colors-slate3o);
+ }
+
+ ::-webkit-scrollbar {
+ background: var(--colors-slate2);
+ height: 3px;
+ width: 0px;
+ border-radius: 0;
+
+ .dark & {
+ background: var(--colors-slate6);
+ }
+ }
+
+ ::-webkit-scrollbar-track {
+ -webkit-box-shadow: inset 0 0 6px var(--colors-slate6);
+ -webkit-border-radius: 5px;
+ border-radius: 5px;
+
+ .dark & {
+ -webkit-box-shadow: inset 0 0 6px var(--colors-slate8);
+ }
+ }
+
+ ::-webkit-scrollbar-thumb {
+ -webkit-border-radius: 5px;
+ border-radius: 5px;
+ background: var(--colors-slate9);
+
+ .dark & {
+ -webkit-box-shadow: inset 0 0 6px var(--colors-slate12);
+ }
+ }
+}
diff --git a/studio/styles/users-table.scss b/studio/styles/users-table.scss
index 5bd24e6d6e5..8b137891791 100644
--- a/studio/styles/users-table.scss
+++ b/studio/styles/users-table.scss
@@ -1,39 +1 @@
-.users-table-container {
- scrollbar-width: thin;
- scrollbar-color: var(--colors-slate9) var(--colors-slate1);
- .dark & {
- scrollbar-color: var(--colors-slate10) var(--colors-slate3o);
- }
-
- ::-webkit-scrollbar {
- background: var(--colors-slate2);
- height: 3px;
- width: 0px;
- border-radius: 0;
-
- .dark & {
- background: var(--colors-slate6);
- }
- }
-
- ::-webkit-scrollbar-track {
- -webkit-box-shadow: inset 0 0 6px var(--colors-slate6);
- -webkit-border-radius: 5px;
- border-radius: 5px;
-
- .dark & {
- -webkit-box-shadow: inset 0 0 6px var(--colors-slate8);
- }
- }
-
- ::-webkit-scrollbar-thumb {
- -webkit-border-radius: 5px;
- border-radius: 5px;
- background: var(--colors-slate9);
-
- .dark & {
- -webkit-box-shadow: inset 0 0 6px var(--colors-slate12);
- }
- }
-}