Repository navigation
feat(docs): add keyboard-accessible skip to content link - #47515
Conversation
Improves keyboard navigation by letting users bypass the top nav and sidebar to jump directly to main content. Co-authored-by: Cursor <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
6 Skipped Deployments
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughA new skip-to-content control is added to the docs layout. The main content target is made focusable with scroll offset styling, and the old global skip-link CSS rules are removed. ChangesSkip to content feature
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: Related Issues: None specified in the provided context. Related PRs: None specified in the provided context. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
| 'fixed top-0 left-4 z-[100] w-auto', | ||
| '-translate-y-full focus-visible:translate-y-4', | ||
| 'transition-transform duration-200 ease-out', | ||
| 'shadow-lg' |
There was a problem hiding this comment.
These Tailwind classes create a slide-down effect when focused.
| <main | ||
| // used by layout to scroll to top | ||
| id={DOCS_CONTENT_CONTAINER_ID} | ||
| tabIndex={-1} |
There was a problem hiding this comment.
Makes main a focusable region.
| tabIndex={-1} | ||
| className={cn( | ||
| 'w-full transition-all ease-out relative', | ||
| 'w-full transition-all ease-out relative scroll-mt-(--header-height)', |
There was a problem hiding this comment.
With scroll-mt-(--header-height), the browser stops 50px higher, so the content lands below the nav.
|
|
||
| const SkipToContent = () => { | ||
| return ( | ||
| <Button |
There was a problem hiding this comment.
Use standard default button.
| image-rendering: high-quality; | ||
| } | ||
|
|
||
| .skip-link { |
There was a problem hiding this comment.
This was here, not doing anything. Perhaps it's boilerplate?
This makes me wonder if there are other unused styles in our css that needs cleanup?
ChrisChinchilla
left a comment
There was a problem hiding this comment.
It's a little fiddly to get the box to appear, but I am also not an experienced user of such features, so I will defer to more experienced reviewers.
Braintrust eval report
|
…#48314) ## 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 -->
Screen.Recording.2026-07-01.at.4.29.22.PM.mov
Closes DOCS-92
I have read the CONTRIBUTING.md file.
YES
Problem
Screenreaders have to navigate our main menu on every page.
This comes from a very old request. 2024. 😱
Solution
A 'Skip to Content' button is standard a11y practice.
This PR improves keyboard navigation by letting users bypass the top nav and sidebar to jump directly to main content.
Tophatting
Note: You may need to SHIFT + TAB if your keyboard focus is past the main navigation. Mouse clicks can shift focus.
Summary by CodeRabbit