Skip to content

Commit 41afe37

Browse files
authored
feat(studio): clearer table row actions (supabase#40170)
* files * TableLink component * triggers * shared style instead * remove bold * revert medium on trigger
1 parent 5305a7b commit 41afe37

File tree

6 files changed

+49
-31
lines changed

6 files changed

+49
-31
lines changed

apps/studio/components/interfaces/Database/Functions/FunctionsList/FunctionList.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { Copy, Edit, Edit2, FileText, MoreVertical, Trash } from 'lucide-react'
44
import Link from 'next/link'
55
import { useRouter } from 'next/router'
66

7-
import { ButtonTooltip } from 'components/ui/ButtonTooltip'
87
import { SIDEBAR_KEYS } from 'components/layouts/ProjectLayout/LayoutSidebar/LayoutSidebarProvider'
8+
import { ButtonTooltip } from 'components/ui/ButtonTooltip'
99
import { useDatabaseFunctionsQuery } from 'data/database-functions/database-functions-query'
1010
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
1111
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
@@ -109,15 +109,19 @@ const FunctionList = ({
109109
<TableCell className="truncate">
110110
<Button
111111
type="text"
112-
className="text-foreground text-sm p-0 hover:bg-transparent"
112+
className="text-link-table-cell text-sm p-0 hover:bg-transparent title"
113113
onClick={() => editFunction(x)}
114+
title={x.name}
114115
>
115116
{x.name}
116117
</Button>
117118
</TableCell>
118119
<TableCell className="table-cell">
119-
<p title={x.argument_types} className="truncate text-foreground-light">
120-
{x.argument_types || '-'}
120+
<p
121+
title={x.argument_types}
122+
className={`truncate ${x.argument_types ? 'text-foreground-light' : 'text-foreground-muted'}`}
123+
>
124+
{x.argument_types || '–'}
121125
</p>
122126
</TableCell>
123127
<TableCell className="table-cell">

apps/studio/components/interfaces/Database/Triggers/TriggersList/TriggerList.tsx

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import { PostgresTrigger } from '@supabase/postgres-meta'
22
import { PermissionAction } from '@supabase/shared-types/out/constants'
33
import { includes, sortBy } from 'lodash'
44
import { Check, Copy, Edit, Edit2, MoreVertical, Trash, X } from 'lucide-react'
5+
import Link from 'next/link'
56

67
import { useParams } from 'common'
78
import { SIDEBAR_KEYS } from 'components/layouts/ProjectLayout/LayoutSidebar/LayoutSidebarProvider'
89
import { ButtonTooltip } from 'components/ui/ButtonTooltip'
9-
import { InlineLink } from 'components/ui/InlineLink'
1010
import { useDatabaseTriggersQuery } from 'data/database-triggers/database-triggers-query'
1111
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
1212
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
@@ -22,9 +22,6 @@ import {
2222
DropdownMenuTrigger,
2323
TableCell,
2424
TableRow,
25-
Tooltip,
26-
TooltipContent,
27-
TooltipTrigger,
2825
} from 'ui'
2926
import { generateTriggerCreateSQL } from './TriggerList.utils'
3027

@@ -100,28 +97,24 @@ export const TriggerList = ({
10097
{_triggers.map((x) => (
10198
<TableRow key={x.id}>
10299
<TableCell className="space-x-2">
103-
<Tooltip>
104-
<TooltipTrigger
105-
onClick={() => editTrigger(x)}
106-
className="cursor-pointer text-foreground truncate max-w-48 inline-block"
107-
>
108-
{x.name}
109-
</TooltipTrigger>
110-
<TooltipContent side="bottom" align="center">
111-
{x.name}
112-
</TooltipContent>
113-
</Tooltip>
100+
<Button
101+
type="text"
102+
onClick={() => editTrigger(x)}
103+
title={x.name}
104+
className="text-link-table-cell text-left text-sm min-w-0 p-0 hover:bg-transparent font-medium max-w-48 title"
105+
>
106+
{x.name}
107+
</Button>
114108
</TableCell>
115109

116110
<TableCell className="break-all">
117111
{x.table_id ? (
118-
<InlineLink
119-
title={x.table}
112+
<Link
120113
href={`/project/${projectRef}/editor/${x.table_id}`}
121-
className="truncate block max-w-40"
114+
className="text-link-table-cell block max-w-40 text-foreground-light"
122115
>
123116
{x.table}
124-
</InlineLink>
117+
</Link>
125118
) : (
126119
<p title={x.table} className="truncate">
127120
{x.table}
@@ -131,13 +124,12 @@ export const TriggerList = ({
131124

132125
<TableCell className="space-x-2">
133126
{x.function_name ? (
134-
<InlineLink
135-
title={x.function_name}
127+
<Link
136128
href={`/project/${projectRef}/database/functions?search=${x.function_name}&schema=${x.function_schema}`}
137-
className="truncate block max-w-40"
129+
className="text-link-table-cell block max-w-40 text-foreground-light"
138130
>
139131
{x.function_name}
140-
</InlineLink>
132+
</Link>
141133
) : (
142134
<p className="truncate text-foreground-light">-</p>
143135
)}

apps/studio/components/interfaces/Storage/AnalyticsBuckets/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,13 @@ export const AnalyticsBuckets = () => {
113113
{analyticsBuckets.map((bucket) => (
114114
<TableRow key={bucket.id}>
115115
<TableCell>
116-
<p className="text-foreground">{bucket.id}</p>
116+
<Link
117+
href={`/project/${ref}/storage/analytics/buckets/${encodeURIComponent(bucket.id)}`}
118+
title={bucket.id}
119+
className="text-link-table-cell"
120+
>
121+
{bucket.id}
122+
</Link>
117123
</TableCell>
118124

119125
<TableCell>

apps/studio/components/interfaces/Storage/FilesBuckets/BucketTable.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,13 @@ export const BucketTableRow = ({
9999
<BucketTableRow key={bucket.id}>
100100
<BucketTableCell>
101101
<div className="flex items-center gap-2">
102-
<p title={bucket.id} className="text-foreground truncate max-w-[240px]">
102+
<Link
103+
href={`/project/${projectRef}/storage/files/buckets/${encodeURIComponent(bucket.id)}`}
104+
title={bucket.id}
105+
className="text-link-table-cell"
106+
>
103107
{bucket.id}
104-
</p>
108+
</Link>
105109
{bucket.public && <Badge variant="warning">Public</Badge>}
106110
</div>
107111
</BucketTableCell>

apps/studio/components/interfaces/Storage/VectorBuckets/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,15 @@ export const VectorsBuckets = () => {
127127

128128
return (
129129
<TableRow key={id}>
130-
<TableCell>{name}</TableCell>
130+
<TableCell>
131+
<Link
132+
href={`/project/${projectRef}/storage/vectors/buckets/${encodeURIComponent(name)}`}
133+
title={name}
134+
className="text-link-table-cell"
135+
>
136+
{name}
137+
</Link>
138+
</TableCell>
131139
<TableCell>
132140
<p className="text-foreground-light">
133141
<TimestampInfo

apps/studio/styles/typography.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,8 @@
7474
.text-link {
7575
@apply text-foreground-light underline underline-offset-4 decoration-inherit hover:decoration-foreground transition-colors hover:text-foreground;
7676
}
77+
78+
.text-link-table-cell {
79+
@apply truncate cursor-pointer underline underline-offset-4 decoration-foreground-muted/50 hover:decoration-foreground-lighter/80 transition-colors duration-100;
80+
}
7781
}

0 commit comments

Comments
 (0)