Skip to content

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

fix: fix several accessibility issues on the organization home page (#47769)

Gildas Garcia1aa23f9f64bb
diff --git a/apps/studio/components/interfaces/Home/ProjectList/ProjectCard.tsx b/apps/studio/components/interfaces/Home/ProjectList/ProjectCard.tsx
index 1aa338ab6d2..7923befbe2b 100644
--- a/apps/studio/components/interfaces/Home/ProjectList/ProjectCard.tsx
+++ b/apps/studio/components/interfaces/Home/ProjectList/ProjectCard.tsx
@@ -78,7 +78,7 @@ export const ProjectCard = ({
<div className="w-full flex flex-col gap-y-4 justify-between px-5">
<div className="flex flex-col gap-y-0.5 relative">
<div className="flex items-center justify-between">
- <h5 className="text-sm shrink truncate pr-5">{name}</h5>
+ <h2 className="text-sm shrink truncate pr-5">{name}</h2>
<div onClick={(e) => e.preventDefault()}>
<DropdownMenu>
<DropdownMenuTrigger asChild>
@@ -91,6 +91,7 @@ export const ProjectCard = ({
e.preventDefault()
}}
onPointerDown={(e) => e.stopPropagation()}
+ aria-label={`Project ${name} actions`}
/>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="w-48">
diff --git a/apps/studio/components/interfaces/Home/ProjectList/ProjectTableRow.tsx b/apps/studio/components/interfaces/Home/ProjectList/ProjectTableRow.tsx
index 3ab9ae62a6b..a8e20c56d36 100644
--- a/apps/studio/components/interfaces/Home/ProjectList/ProjectTableRow.tsx
+++ b/apps/studio/components/interfaces/Home/ProjectList/ProjectTableRow.tsx
@@ -12,6 +12,9 @@ import {
DropdownMenuTrigger,
TableCell,
TableRow,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger,
} from 'ui'
import { TimestampInfo } from 'ui-patterns/TimestampInfo'
@@ -81,29 +84,34 @@ export const ProjectTableRow = ({
<TableCell>
<div className="flex flex-col gap-y-2">
<div>
- <h5 className="text-sm">{name}</h5>
- <button
- tabIndex={0}
- onClick={handleCopyProjectRef}
- onKeyDown={(e) => {
- if (e.key === 'Enter' || e.key === ' ') {
- e.preventDefault()
- handleCopyProjectRef(e)
- }
- }}
- className="inline-flex items-center gap-x-1 cursor-pointer border border-transparent border-dashed rounded-sm transition-colors hover:bg-surface-100 hover:border hover:border-strong group font-mono text-xs text-foreground-lighter hover:text-foreground-light px-1 -ml-1"
- >
- {projectRef}
- {isCopied ? (
- <Check size={12} strokeWidth={1.25} className="text-brand" />
- ) : (
- <Copy
- size={12}
- strokeWidth={1.25}
- className="opacity-0 group-hover:opacity-100 transition-opacity"
- />
- )}
- </button>
+ <h2 className="text-sm">{name}</h2>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <button
+ tabIndex={0}
+ onClick={handleCopyProjectRef}
+ onKeyDown={(e) => {
+ if (e.key === 'Enter' || e.key === ' ') {
+ e.preventDefault()
+ handleCopyProjectRef(e)
+ }
+ }}
+ className="inline-flex items-center gap-x-1 cursor-pointer border border-transparent border-dashed rounded-sm transition-colors hover:bg-surface-100 hover:border hover:border-strong group font-mono text-xs text-foreground-lighter hover:text-foreground-light px-1 -ml-1"
+ >
+ {projectRef}
+ {isCopied ? (
+ <Check size={12} strokeWidth={1.25} className="text-brand" />
+ ) : (
+ <Copy
+ size={12}
+ strokeWidth={1.25}
+ className="opacity-0 group-hover:opacity-100 transition-opacity"
+ />
+ )}
+ </button>
+ </TooltipTrigger>
+ <TooltipContent>Copy project reference</TooltipContent>
+ </Tooltip>
</div>
{(isGithubIntegrated || isVercelIntegrated || hasPartnerIcon) && (
<div className="flex items-center gap-x-1.5">
@@ -175,7 +183,7 @@ export const ProjectTableRow = ({
<Button
variant="default"
icon={<MoreVertical />}
- aria-label="More actions"
+ aria-label={`Project ${name} actions`}
className="w-7"
onClick={(e) => e.stopPropagation()}
/>
diff --git a/apps/studio/components/interfaces/Organization/OrganizationCard.tsx b/apps/studio/components/interfaces/Organization/OrganizationCard.tsx
index ae5a4afb41e..93075704bc3 100644
--- a/apps/studio/components/interfaces/Organization/OrganizationCard.tsx
+++ b/apps/studio/components/interfaces/Organization/OrganizationCard.tsx
@@ -34,7 +34,7 @@ export const OrganizationCard = ({
const numProjects = data?.pages[0].pagination.count ?? 0
const isMfaRequired = organization.organization_requires_mfa
- const renderContent = () => (
+ const card = (
<ActionCard
bgColor="bg border"
className={cn(
@@ -80,9 +80,13 @@ export const OrganizationCard = ({
)
if (isLink) {
- return <Link href={href ?? `/org/${organization.slug}`}>{renderContent()}</Link>
+ return (
+ <Link href={href ?? `/org/${organization.slug}`} tabIndex={0}>
+ {card}
+ </Link>
+ )
} else {
- return <Fragment>{renderContent()}</Fragment>
+ return <Fragment>{card}</Fragment>
}
}