Skip to content

feat: unify SkipToContent across studio, docs, www, and design-system - #48314

Merged
dnywh merged 6 commits into
masterfrom
dnywh/feat/skip-to-content
Jul 28, 2026
Merged

dnywh merged 6 commits into
masterfrom
dnywh/feat/skip-to-content

Conversation

@dnywh

@dnywh dnywh commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

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
CleanShot 2026-07-24 at 14 08 47@2x

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 → sign in → any project page
  • Docs — preview → any docs page with sidebar
  • www — preview → homepage or any marketing page with the default nav
  • Design system — preview → any docs page (confirm Tab from content does not walk the sidebar), plus Skip to Content fragment

Additional context

Follow-up to #47694 / #48303 (Studio) and #47515 (Docs).

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.

dnywh added 3 commits July 24, 2026 14:08
…ign-system

Unify the skip-link treatment behind one opaque-backed default button, document it as a fragment, and adopt content-only main landmarks so Tab does not land in the sidebar.
Cover DefaultLayout, the home layout, and Go pages so keyboard users can jump past the sticky nav.
@dnywh
dnywh requested review from a team as code owners July 24, 2026 18:08
@vercel

vercel Bot commented Jul 24, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
design-system Ready Ready Preview, Comment Jul 28, 2026 6:40am
docs Ready Ready Preview, Comment, Open in v0 Jul 28, 2026 6:40am
studio-self-hosted Ready Ready Preview, Comment Jul 28, 2026 6:40am
studio-staging Ready Ready Preview, Comment Jul 28, 2026 6:40am
ui-library Ready Ready Preview, Comment Jul 28, 2026 6:40am
zone-www-dot-com Ready Ready Preview, Comment, Open in v0 Jul 28, 2026 6:40am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Jul 28, 2026 6:40am

Request Review

@supabase

supabase Bot commented Jul 24, 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 24, 2026
@dnywh
dnywh requested a review from Copilot July 24, 2026 18:08
@coderabbitai

coderabbitai Bot commented Jul 24, 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 Plus

Run ID: 2965107f-d46c-4444-ab2c-b8819f08d393

📥 Commits

Reviewing files that changed from the base of the PR and between 1609605 and 2f280d3.

📒 Files selected for processing (1)
  • packages/ui-patterns/package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/ui-patterns/package.json

📝 Walkthrough

Walkthrough

A shared SkipToContent component is added and exported through ui-patterns, tested, integrated into application layouts, and documented through a new design-system fragment, navigation guidance, accessibility guidance, and demo registry entry.

Changes

Skip-to-content accessibility

Layer / File(s) Summary
Shared component contract and validation
packages/ui-patterns/src/SkipToContent/*, packages/ui-patterns/package.json
Adds the SkipToContent component, public props, package exports, barrel export, and tests for links, labels, focus visibility, and styling.
Application layout integration
apps/docs/..., apps/studio/..., apps/design-system/app/..., apps/www/...
Adds skip links to application layouts and configures matching main landmarks with focus and scroll behavior.
Design-system documentation and example
apps/design-system/content/docs/..., apps/design-system/config/docs.ts, apps/design-system/registry/...
Documents the fragment, updates accessibility and navigation guidance, adds sidebar navigation, updates Button metadata, and registers a demo example.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Keyboard
  participant SkipToContent
  participant MainLandmark
  Keyboard->>SkipToContent: Tab to focus link
  SkipToContent->>MainLandmark: Navigate to href target
  MainLandmark->>MainLandmark: Receive focus and apply scroll offset
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: shared SkipToContent adoption across apps.
Description check ✅ Passed The description covers current behavior, new behavior, and context, but it omits the template's CONTRIBUTING.md confirmation.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dnywh/feat/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.

Copilot AI 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.

Pull request overview

This PR standardizes the “Skip to content” experience across the monorepo by introducing a shared SkipToContent component in packages/ui-patterns and adopting it in Studio, Docs, www, and the design-system. It also documents the pattern in the design-system docs and adds an example/demo fragment.

Changes:

  • Added a shared SkipToContent component (with unit tests) to ui-patterns and exposed it via package exports.
  • Updated Studio, Docs, www, and design-system layouts to render the shared skip link and ensure the target <main> landmarks are focusable (tabIndex={-1}) and don’t show a focus outline (outline-hidden).
  • Added design-system documentation + fragment + registry demo for the skip-to-content pattern.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/ui-patterns/src/SkipToContent/SkipToContent.tsx Introduces the shared skip-link component implementation.
packages/ui-patterns/src/SkipToContent/SkipToContent.test.tsx Adds unit tests validating rendering and key styling/behavior contracts.
packages/ui-patterns/src/SkipToContent/index.tsx Exports the component and props type via a local barrel.
packages/ui-patterns/package.json Adds exports entries so consumers can import ui-patterns/SkipToContent.
apps/www/components/Layouts/Default.tsx Adds the skip link to the www default layout and makes <main> a focusable target.
apps/www/components/Go/GoPageRenderer.tsx Adds the skip link to Go pages and updates the <main> landmark contract.
apps/www/app/(home)/layout.tsx Adds the skip link to the home app-router layout and updates the <main> target.
apps/studio/components/layouts/DefaultLayout.tsx Replaces the local Studio skip link with the shared component and updates the <main> target.
apps/docs/layouts/MainSkeleton.tsx Ensures the docs content container follows the “no visible outline on focus” contract.
apps/docs/components/SkipToContent.tsx Removes the now-redundant docs-specific skip-to-content component.
apps/docs/app/layout.tsx Switches docs to the shared SkipToContent and wires it to DOCS_CONTENT_CONTAINER_ID.
apps/design-system/registry/examples.ts Registers a new design-system example for skip-to-content.
apps/design-system/registry/default/example/skip-to-content-demo.tsx Adds the demo showcasing focused appearance and correct target landmark setup.
apps/design-system/content/docs/ui-patterns/navigation.mdx Documents SkipToContent under navigation patterns and links to the fragment.
apps/design-system/content/docs/fragments/skip-to-content.mdx Adds a reusable fragment documenting usage + landmark contract.
apps/design-system/content/docs/components/button.mdx Updates Button docs description to explicitly include link-as-button usage.
apps/design-system/content/docs/accessibility.mdx Adds guidance to use the shared skip-link fragment for persistent chrome layouts.
apps/design-system/config/docs.ts Adds the new fragment to the design-system docs nav.
apps/design-system/app/(app)/layout.tsx Adds the shared skip link and ensures <main> is content-only (sidebar stays outside).
apps/design-system/registry/index.tsx Updates generated registry index to include the new skip-to-content demo.
apps/design-system/registry/default/block/chart-bar-interactive.tsx Minor formatting-only change in a registry block file.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🧹 Nitpick comments (2)
packages/ui-patterns/src/SkipToContent/SkipToContent.test.tsx (1)

23-32: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Exercise the Enter-to-focus behavior.

These assertions only inspect class strings; they do not verify the feature’s core interaction: tab to the link, press Enter, and focus the matching <main>. Add a browser/component integration test with a real target landmark.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/ui-patterns/src/SkipToContent/SkipToContent.test.tsx` around lines
23 - 32, Add an integration test alongside the existing SkipToContent test that
renders the component with a real main landmark matching its href, simulates
keyboard tabbing to the skip link and pressing Enter, and asserts that the
matching main element receives focus. Keep the existing class-name assertions
unchanged.
apps/studio/components/layouts/DefaultLayout.tsx (1)

98-98: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add a Studio integration test for the landmark contract.

The shared component tests do not cover this layout wiring. Assert that the rendered link points to #main and that main#main remains tabIndex={-1} so future layout changes cannot silently break the accessibility path.

As per coding guidelines, include relevant tests by default and use Vitest for Studio changes.

Also applies to: 129-129

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/studio/components/layouts/DefaultLayout.tsx` at line 98, Add a Vitest
integration test for DefaultLayout that renders the layout and verifies
SkipToContent links to `#main` and the main landmark is rendered as main#main with
tabIndex={-1}. Place the assertions at the layout integration level rather than
only testing the shared component.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/design-system/app/`(app)/layout.tsx:
- Line 27: Update the <main> element’s scroll-margin configuration in the layout
so its scroll offset matches the sticky TopNavigation height at each responsive
breakpoint. Reuse the shared header-height token if available, or apply
responsive scroll-mt values sufficient to keep the focused main content below
the header.

---

Nitpick comments:
In `@apps/studio/components/layouts/DefaultLayout.tsx`:
- Line 98: Add a Vitest integration test for DefaultLayout that renders the
layout and verifies SkipToContent links to `#main` and the main landmark is
rendered as main#main with tabIndex={-1}. Place the assertions at the layout
integration level rather than only testing the shared component.

In `@packages/ui-patterns/src/SkipToContent/SkipToContent.test.tsx`:
- Around line 23-32: Add an integration test alongside the existing
SkipToContent test that renders the component with a real main landmark matching
its href, simulates keyboard tabbing to the skip link and pressing Enter, and
asserts that the matching main element receives focus. Keep the existing
class-name assertions unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 39063589-1a91-4073-b0b5-d703a2a28740

📥 Commits

Reviewing files that changed from the base of the PR and between 8e75147 and aa1ca70.

⛔ Files ignored due to path filters (2)
  • apps/design-system/__registry__/default/block/chart-bar-interactive.tsx is excluded by !apps/design-system/__registry__/**
  • apps/design-system/__registry__/index.tsx is excluded by !apps/design-system/__registry__/**
📒 Files selected for processing (19)
  • apps/design-system/app/(app)/layout.tsx
  • apps/design-system/config/docs.ts
  • apps/design-system/content/docs/accessibility.mdx
  • apps/design-system/content/docs/components/button.mdx
  • apps/design-system/content/docs/fragments/skip-to-content.mdx
  • apps/design-system/content/docs/ui-patterns/navigation.mdx
  • apps/design-system/registry/default/example/skip-to-content-demo.tsx
  • apps/design-system/registry/examples.ts
  • apps/docs/app/layout.tsx
  • apps/docs/components/SkipToContent.tsx
  • apps/docs/layouts/MainSkeleton.tsx
  • apps/studio/components/layouts/DefaultLayout.tsx
  • apps/www/app/(home)/layout.tsx
  • apps/www/components/Go/GoPageRenderer.tsx
  • apps/www/components/Layouts/Default.tsx
  • packages/ui-patterns/package.json
  • packages/ui-patterns/src/SkipToContent/SkipToContent.test.tsx
  • packages/ui-patterns/src/SkipToContent/SkipToContent.tsx
  • packages/ui-patterns/src/SkipToContent/index.tsx
💤 Files with no reviewable changes (1)
  • apps/docs/components/SkipToContent.tsx

Comment thread apps/design-system/app/(app)/layout.tsx Resolved
scroll-mt-10 undershot TopNavigation; use scroll-mt-12 to align with the existing 3rem header assumption in this layout.

@czenko czenko 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.

Love this 🤩
In hindsight, I should have promoted the SkipToContent from docs in the first place. Appreciate this change.


[NavMenu component guidelines](../components/nav-menu)

### SkipToContent

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.

I'm looking for this content and can't find it 😅 What is the Preview URL?

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.

Sorry, got skipped! See here.

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.

Looks so good 🤩 Documentation is very clear.

<TopNavigation />
<MobileSidebarSheet />
<main className="flex-1 max-w-site mx-auto w-full border-l border-r border-b">
<div className="flex-1 max-w-site mx-auto w-full border-l border-r border-b">

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.

Sidebar was on main, which means that “Skip to content” just skips to the sidebar. Not really semantic.

Comment on lines +27 to +29
<main id="main" tabIndex={-1} className="outline-hidden scroll-mt-12 min-w-0">
{children}
</main>

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.

...therefore main is now wrapping the actual content only.

---
title: Button
description: Displays a button or a component that looks like a button.
description: Displays a button or a link that looks like a 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.

Minor nit.

Comment thread apps/docs/components/SkipToContent.tsx Outdated

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.

Extracted to shared component.

tabIndex={-1}
className={cn(
'w-full transition-all ease-out relative scroll-mt-(--header-height)',
'w-full transition-all ease-out relative scroll-mt-(--header-height) outline-hidden',

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.

Otherwise some browsers like Chrome will add the blue outline. main doesn’t need the outline, only (the next) interactive content.

<Nav hideNavbar={false} />
<div className="relative w-full">
<main className="relative min-h-screen">{children}</main>
<main id="main" tabIndex={-1} className="relative min-h-screen scroll-mt-16 outline-hidden">

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.

tabIndex to be reachable, outline-hidden as explained above; to stop showing an outline.

className={cn(
// Opaque plate so default Button muted/selection fills composite like any other control.
// w-fit: plate is a block div by default and would otherwise span the full content column.
'fixed top-0 left-[10px] z-[100] w-fit rounded-md bg-background',

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.

10px pixel values to line up visually in navigation bar on Studio and Docs.

@github-actions

github-actions Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results (tanstack)

passed  243 passed
skipped  5 skipped

Details

stats  248 tests across 29 suites
duration  3 minutes, 56 seconds
commit  2f280d3

Skipped tests

Features › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled
Features › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected
Features › sql-editor.spec.ts › SQL Editor › share with team works as expected
Features › sql-editor.spec.ts › SQL Editor › folders works as expected
Features › sql-editor.spec.ts › SQL Editor › other SQL snippets actions work as expected

@djhi djhi 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.

Tested locally 👍

@kemaldotearth kemaldotearth 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.

Works as described across all 4 sites.

@dnywh
dnywh merged commit 37dded6 into master Jul 28, 2026
41 checks passed
@dnywh
dnywh deleted the dnywh/feat/skip-to-content branch July 28, 2026 20:21
dnywh added a commit that referenced this pull request Aug 7, 2026
## What kind of change does this PR introduce?

Bug fix for translucent default Button (and related control) fills that
show through stacked content on hover.

Resolves
[DEPR-636](https://linear.app/supabase/issue/DEPR-636/report-snippet-cell-expand-button-becomes-transparent-on-hover).

## What is the current behavior?

Default `Button` hover uses `bg-selection`, and dark-mode rest uses
`bg-muted`. After the colour system migration those legacy aliases point
at translucent `--accent` / `--muted`, so hover punches through whatever
sits behind the button (SQL Editor / Reports cell expand, sticky
columns, skip-to-content, etc.).

| Before: Light | Before: Dark |
| --- | --- |
| <img width="491" height="75" alt="CleanShot 2026-08-03 at 09 12 26@2x"
src="https://github.com/user-attachments/assets/20e33ba9-74c5-47eb-aced-ac932a0059fa"
/> | <img width="205" height="54" alt="21257"
src="https://github.com/user-attachments/assets/a2c9f092-18a7-4a4d-a49b-6e019e50895f"
/> |

## What is the new behavior?

Default Button, Select, MultiSelect, and the CommandMenu trigger use
opaque elevation tokens (`bg-background dark:bg-card`,
`hover:bg-popover`). SkipToContent drops its opaque-plate workaround. No
global `compat.css` alias remaps.

| After: Light | After: Dark |
| --- | --- |
| <img width="466" height="110" alt="CleanShot 2026-08-07 at 16 09
59@2x"
src="https://github.com/user-attachments/assets/6410cb58-b37c-427f-a0ff-7b223a7f3f51"
/> | <img width="474" height="132" alt="CleanShot 2026-08-07 at 16 08
53@2x"
src="https://github.com/user-attachments/assets/575c56d1-8ee5-4eb5-8f08-e4b5af8520f0"
/> |

## Additional context

- Overlay tokens (`--muted` / `--accent` / `--tertiary`) stay
intentional for washes on solid surfaces. Controls that can sit over
content should use solid elevation tokens (`card` / `popover`) instead.
- Same root cause as the workarounds in #47996 and #48314.
- The “View full cell content” control lives in SQL Editor results /
Report `QueryBlock` (`ResultCell`), not Table Editor. It only renders
when the value is an object/array, contains a newline, or is longer than
60 characters, and it stays `opacity-0` until you hover the cell.

## To test

Short path in Studio (light and dark):

1. **Expand button over cell text (clearest repro)** – SQL Editor, run:
   ```sql
   select repeat('x', 80) as name;
   ```
Hover the result cell. The expand control should appear over the text;
hover the button itself and confirm the fill is solid (no `x`s showing
through). Same control is what Report snippets use.
2. **Any default Button** – Top nav **Connect** (or any bordered default
button). Hover: solid fill.
3. **Select** – Project picker or a Settings form select. Trigger hover
/ open fill stays opaque.
4. **Command menu trigger** – Hover the header search / Cmd-K control;
match default Button.
5. **Skip to content** – Tab once on Studio. Skip link hover stays solid
over the page behind it.
6. **Editor tabs regression** – SQL / Table Editor tab strip should
still look grey in light mode (not washed white).
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.

5 participants