Files
Danny White 5677b0ec2a chore(studio): clarify integration settings copy (#47578)
## Summary
- Clarifies Vercel integration settings copy for org-scoped and
project-scoped contexts.
- Updates GitHub and Vercel integration section titles to sentence case
for in-page headings.
- Contributes to DEPR-565.

| Before | After |
| --- | --- |
| <img width="1242" height="759" alt="Integrations Basket Supabase"
src="https://github.com/user-attachments/assets/df33a9d4-8fb3-40cf-87d2-e87fa33195e4"
/> | <img width="1150" height="715" alt="Integrations Basket Supabase"
src="https://github.com/user-attachments/assets/45478216-c426-4bc1-9292-9a6016ac7af9"
/> |
| <img width="1242" height="759" alt="18154"
src="https://github.com/user-attachments/assets/8dfb7742-fca5-421f-88d0-4d24dad93450"
/> | <img width="1150" height="715" alt="Integrations Settings Agua
Basket Supabase"
src="https://github.com/user-attachments/assets/aa119d0e-cf5e-45e5-b5d3-cd8c0d047e34"
/> |

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

* **UI Text Updates**
* Updated GitHub and Vercel headings and labels to use consistent casing
(e.g., “GitHub connection”, “Vercel”).
* Adjusted success and empty-state messaging for GitHub and Vercel
integration actions.

* **UX Improvements**
* Improved GitHub and Vercel section descriptions by tailoring the text
to project-scoped vs organization-scoped contexts.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-07-08 12:56:03 +10:00

117 lines
4.2 KiB
TypeScript

import { useParams } from 'common'
import { AlertCircle, ArrowUpRight, CheckCircle2 } from 'lucide-react'
import Image from 'next/image'
import Link from 'next/link'
import { HoverCard, HoverCardContent, HoverCardTrigger } from 'ui'
import { useBranchesQuery } from '@/data/branches/branches-query'
import { useGitHubConnectionsQuery } from '@/data/integrations/github-connections-query'
import { useSelectedOrganizationQuery } from '@/hooks/misc/useSelectedOrganization'
import { useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject'
import { BASE_PATH } from '@/lib/constants'
export const GitHubStatus = () => {
const { ref: projectRef } = useParams()
const { data: selectedProject } = useSelectedProjectQuery()
const { data: selectedOrganization } = useSelectedOrganizationQuery()
const parentProjectRef = selectedProject?.parent_project_ref || projectRef
const { data: connections } = useGitHubConnectionsQuery(
{ organizationId: selectedOrganization?.id },
{ enabled: !!selectedOrganization?.id }
)
const { data: branches } = useBranchesQuery(
{ projectRef: parentProjectRef },
{ enabled: !!parentProjectRef }
)
const githubConnection = connections?.find(
(connection) => connection.project.ref === parentProjectRef
)
const mainBranch = branches?.find((branch) => branch.is_default)
const isConnected = Boolean(githubConnection)
const hasGitBranchSync = Boolean(mainBranch?.git_branch?.trim())
const hasAutomaticBranching = Boolean(githubConnection?.new_branch_per_pr)
return (
<HoverCard openDelay={300} closeDelay={100}>
<HoverCardTrigger asChild>
<Link
href={`/project/${parentProjectRef}/settings/integrations`}
className="block w-full transition truncate text-sm text-foreground-light hover:text-foreground"
>
<div className="w-full flex items-center justify-between">
<h3 className="text-sm">GitHub connection</h3>
<ArrowUpRight strokeWidth={1} className="h-4 w-4" />
</div>
<p className="mt-0.5 text-xs text-foreground-lighter flex items-center gap-2">
{isConnected ? (
<>
<Image
className="dark:invert"
src={`${BASE_PATH}/img/icons/github-icon.svg`}
width={16}
height={16}
alt="GitHub"
/>
{githubConnection?.repository.name}
</>
) : (
'Not connected'
)}
</p>
</Link>
</HoverCardTrigger>
<HoverCardContent side="right" align="start" className="w-80 p-4 space-y-2">
<div className="flex items-center gap-2 text-sm">
<Image
className="dark:invert"
src={`${BASE_PATH}/img/icons/github-icon.svg`}
width={20}
height={20}
alt="GitHub"
/>
<span className="truncate">
{isConnected ? githubConnection?.repository.name : 'Not connected'}
</span>
</div>
{isConnected ? (
<div className="flex flex-col gap-2 text-xs text-foreground-light">
<div className="flex items-center gap-2">
{hasGitBranchSync ? (
<CheckCircle2 size={12} className="text-brand-600" />
) : (
<AlertCircle size={12} className="text-warning" />
)}
<span>
{hasGitBranchSync
? `Syncing production (${mainBranch?.git_branch})`
: 'Production sync disabled'}
</span>
</div>
<div className="flex items-center gap-2">
{hasAutomaticBranching ? (
<CheckCircle2 size={12} className="text-brand-600" />
) : (
<AlertCircle size={12} className="text-warning" />
)}
<span>
{hasAutomaticBranching
? 'Automatically creating branches'
: 'Automatic branching disabled'}
</span>
</div>
</div>
) : (
<p className="text-xs text-foreground-light">Not connected to any repository</p>
)}
</HoverCardContent>
</HoverCard>
)
}