mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 18:05:11 +03:00
## What kind of change does this PR introduce? Feature / a11y polish ## What is the current behavior? Studio and Docs each had their own skip-to-content link (different styling and behaviour). www and design-system had none. ## What is the new behavior? Shared `SkipToContent` in `ui-patterns`, adopted by Studio, Docs, www, and design-system. Documented as a fragment with a short note under Accessibility → Jumping ahead. Tab once to reveal the button (top-left), Enter to jump to a content-only `<main>`. | After | | --- | | <img width="836" height="324" alt="CleanShot 2026-07-24 at 14 08 47@2x" src="https://github.com/user-attachments/assets/6df29452-e53a-4eca-8f64-946f2b9f605d" /> | ## To test Shared steps for every app: enable Tab key navigation if needed, load the preview, press **Tab** once — skip button should slide in top-left. Press **Enter** — focus jumps to main content (no blue ring on `<main>`). Press **Tab** again — first interactive control in the page body, not the sidebar/nav. Hover the skip button — solid fill, clear hover state, no chrome showing through. - **Studio** — [preview](https://studio-staging-git-dnywh-featskip-to-content-supabase.vercel.app) → sign in → any project page - **Docs** — [preview](https://docs-git-dnywh-featskip-to-content-supabase.vercel.app) → any docs page with sidebar - **www** — [preview](https://zone-www-dot-com-git-dnywh-featskip-to-content-supabase.vercel.app) → homepage or any marketing page with the default nav - **Design system** — [preview](https://design-system-git-dnywh-featskip-to-content-supabase.vercel.app) → any docs page (confirm Tab from content does **not** walk the sidebar), plus [Skip to Content fragment](https://design-system-git-dnywh-featskip-to-content-supabase.vercel.app/docs/fragments/skip-to-content) ## Additional context Follow-up to #47694 / #48303 (Studio) and #47515 (Docs). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added a reusable “Skip to content” accessibility link across key layouts and pages. - Updated main landmarks to support keyboard focus and skip-link navigation (`id="main"`). - **Accessibility** - Skip links now follow consistent landmark-target conventions and remain hidden until focused. - Improved documentation for skip links/jump shortcuts in persistent chrome layouts. - **Documentation** - Added a dedicated Skip to Content fragment, navigation entry, and expanded accessibility guidance. - Updated button description wording in component docs. - **Tests** - Added component tests for SkipToContent. - **Chores** - Exposed SkipToContent via additional public package entry points. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
52 lines
1.8 KiB
TypeScript
52 lines
1.8 KiB
TypeScript
import supabaseLogoIcon from 'common/assets/images/supabase-logo-icon.png'
|
|
import { GoPageRenderer as MarketingPageRenderer } from 'marketing'
|
|
import type { CustomSectionRenderers } from 'marketing'
|
|
import Image from 'next/image'
|
|
import Link from 'next/link'
|
|
import { SkipToContent } from 'ui-patterns/SkipToContent'
|
|
|
|
import TweetsSection from './TweetsSection'
|
|
import type { GoPage } from '@/types/go'
|
|
|
|
const customRenderers: CustomSectionRenderers = {
|
|
tweets: TweetsSection,
|
|
}
|
|
|
|
// eslint-disable-next-line
|
|
export default function GoPageRenderer({ page }: { page: GoPage }) {
|
|
return (
|
|
<>
|
|
<SkipToContent href="#main" />
|
|
<nav className="absolute top-0 left-0 right-0 z-10">
|
|
<div className="max-w-7xl mx-auto flex items-center h-14 px-8">
|
|
<Link href="/">
|
|
<Image src={supabaseLogoIcon} width={24} height={24} alt="Supabase" priority />
|
|
<span className="sr-only">Supabase</span>
|
|
</Link>
|
|
</div>
|
|
</nav>
|
|
|
|
<main
|
|
id="main"
|
|
tabIndex={-1}
|
|
className="relative min-h-screen scroll-mt-14 pb-16 outline-hidden sm:pb-24"
|
|
>
|
|
<MarketingPageRenderer page={page} customRenderers={customRenderers} />
|
|
</main>
|
|
<footer className="border-t border-muted">
|
|
<div className="max-w-7xl mx-auto flex flex-col sm:flex-row items-center justify-between gap-2 py-4 sm:h-14 px-8 text-sm text-foreground-lighter">
|
|
<span>© {new Date().getFullYear()} Supabase Inc.</span>
|
|
<div className="flex gap-6">
|
|
<Link href="/privacy" className="hover:text-foreground transition-colors">
|
|
Privacy Policy
|
|
</Link>
|
|
<Link href="/terms" className="hover:text-foreground transition-colors">
|
|
Terms of Service
|
|
</Link>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
</>
|
|
)
|
|
}
|