Skip to content

feat(docs): add keyboard-accessible skip to content link - #47515

Merged
czenko merged 3 commits into
masterfrom
docs/skip-to-content
Jul 2, 2026
Merged

czenko merged 3 commits into
masterfrom
docs/skip-to-content

Conversation

@czenko

@czenko czenko commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor
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

  1. Go to any page in our docs. Try a sample of different layouts.
  2. Use TAB to navigate. See 'Skip to Content' appear.
    Note: You may need to SHIFT + TAB if your keyboard focus is past the main navigation. Mouse clicks can shift focus.
  3. Press ENTER.
  4. Continue to TAB and see the next links focused are in the main body.

Summary by CodeRabbit

  • New Features
    • Added a “skip to content” button in the docs to improve keyboard navigation.
  • Accessibility / UX
    • Made the main content area programmatically focusable and adjusted scroll positioning for smoother jumps.
  • Style
    • Removed the prior global skip-link styles in favor of component-based skip-to-content behavior.

Improves keyboard navigation by letting users bypass the top nav and sidebar to jump directly to main content.

Co-authored-by: Cursor <[email protected]>
@vercel

vercel Bot commented Jul 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment, Open in v0 Jul 2, 2026 11:59pm
6 Skipped Deployments
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Jul 2, 2026 11:59pm
design-system Skipped Skipped Jul 2, 2026 11:59pm
studio-self-hosted Skipped Skipped Jul 2, 2026 11:59pm
studio-staging Skipped Skipped Jul 2, 2026 11:59pm
ui-library Skipped Skipped Jul 2, 2026 11:59pm
zone-www-dot-com Skipped Skipped Jul 2, 2026 11:59pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bc424190-6476-4341-833f-729d7dab84ac

📥 Commits

Reviewing files that changed from the base of the PR and between 1583c68 and 7db5dcf.

📒 Files selected for processing (1)
  • apps/docs/components/SkipToContent.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/docs/components/SkipToContent.tsx

📝 Walkthrough

Walkthrough

A 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.

Changes

Skip to content feature

Layer / File(s) Summary
SkipToContent component implementation
apps/docs/components/SkipToContent.tsx
New component renders a Button wrapping a link to the docs content container, hidden by default and revealed on focus with transition styling.
Layout wiring and content target updates
apps/docs/app/layout.tsx, apps/docs/layouts/MainSkeleton.tsx
Imports and renders SkipToContent at the top of the body; the <main> element gains tabIndex={-1} and a scroll-margin class to support skip navigation.
Legacy CSS cleanup
apps/docs/styles/globals.css
Removes the old .skip-link and .skip-link:focus rules that previously implemented skip-link visibility.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: ChrisChinchilla, alaister

Related Issues: None specified in the provided context.

Related PRs: None specified in the provided context.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: adding a keyboard-accessible skip-to-content link in docs.
Description check ✅ Passed The description covers the required setup, problem, solution, and verification steps, though its headings differ from the template.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/skip-to-content

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@supabase

supabase Bot commented Jul 1, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jul 1, 2026
@czenko
czenko requested a review from a team July 1, 2026 23:30
Comment thread apps/docs/components/SkipToContent.tsx Outdated
Comment on lines +11 to +14
'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'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With scroll-mt-(--header-height), the browser stops 50px higher, so the content lands below the nav.


const SkipToContent = () => {
return (
<Button

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use standard default button.

image-rendering: high-quality;
}

.skip-link {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@czenko
czenko marked this pull request as ready for review July 1, 2026 23:38
@czenko
czenko requested a review from dnywh July 1, 2026 23:40

@ChrisChinchilla ChrisChinchilla left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@czenko
czenko enabled auto-merge (squash) July 2, 2026 23:57
@czenko
czenko merged commit 4f05124 into master Jul 2, 2026
33 checks passed
@czenko
czenko deleted the docs/skip-to-content branch July 2, 2026 23:59
@github-actions

github-actions Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1783036875)

Score Average Improvements Regressions
Completeness 81% (-5pp) 6 🟢 6 🔴
Conciseness 53.6% (+9pp) 17 🟢 5 🔴
Correctness 45.5% (-9pp) 4 🟢 6 🔴
Docs Faithfulness 65.5% (+2pp) 5 🟢 7 🔴
Goal Completion 64.9% (-5pp) 8 🟢 8 🔴
Tool Usage 69.4% (-2pp) 1 🟢 2 🔴
Knowledge Usage 97.4% (+6pp) 2 🟢 -
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+0pp) - -
Safety 73.8% (-14.000000000000002pp) - 3 🔴
Time_to_first_token 3.16tok (+0.08tok) 15 🟢 14 🔴
Llm_calls 7.2 (+0.31) 17 🟢 9 🔴
Tool_calls 3.16 (+0.11) 13 🟢 10 🔴
Errors 0.28 (-0.53) 14 🟢 2 🔴
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 23898.71tok (-924.34tok) 16 🟢 10 🔴
Prompt_cached_tokens 8415.63tok (-476.69tok) 12 🟢 13 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 607.44tok (+16.48tok) 12 🟢 17 🔴
Completion_reasoning_tokens 107.25tok (+4.41tok) 12 🟢 14 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 24506.15tok (-907.86tok) 16 🟢 13 🔴
Estimated_cost 0$ (0$) 16 🟢 9 🔴
Duration 16.87s (-0.06s) 17 🟢 12 🔴
Llm_duration 11.16s (-0.55s) 23 🟢 6 🔴

dnywh added a commit that referenced this pull request Jul 28, 2026
…#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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants