Skip to content

feat(ui): Added Skip To Content - #8514

Merged
avivkeller merged 5 commits into
nodejs:mainfrom
malav2110:feat-skip-to-content
Jan 5, 2026
Merged

feat(ui): Added Skip To Content#8514
avivkeller merged 5 commits into
nodejs:mainfrom
malav2110:feat-skip-to-content

Conversation

@malav2110

@malav2110 malav2110 commented Jan 3, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds Skip To Content skip link for increased accessibility and easier keyboard navigation. The skip link is visually hidden by default, becomes visible only on keyboard focus, and uses no JavaScript. It does not affect mouse or touch users.

Validation / Keyboard navigation

Before (current behavior) (pressing tab):
Keyboard focus moves through the header and navigation before reaching the main content on the Learn page.

Before.mov

After (with skip link) (same flow) (pressing tab):
A visually hidden skip link appears on keyboard focus and allows moving focus directly to the main content. The link is hidden for mouse and touch users and uses no JavaScript.

After.mov

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run pnpm format to ensure the code follows the style guide.
  • I have run pnpm test to check if all tests are passing.
  • I have run pnpm build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

Copilot AI review requested due to automatic review settings January 3, 2026 01:31
@malav2110
malav2110 requested a review from a team as a code owner January 3, 2026 01:31
@vercel

vercel Bot commented Jan 3, 2026

Copy link
Copy Markdown

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

Project Deployment Review Updated (UTC)
nodejs-org Ready Ready Preview Jan 4, 2026 6:25pm

@github-actions

github-actions Bot commented Jan 3, 2026

Copy link
Copy Markdown
Contributor

👋 Codeowner Review Request

The following codeowners have been identified for the changed files:

Team reviewers: @nodejs/nodejs-website

Please review the changes when you have a chance. Thank you! 🙏

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 implements a "Skip to Content" accessibility feature that allows keyboard users to bypass navigation and jump directly to the main content. The implementation is visually hidden by default, becomes visible on keyboard focus, and requires no JavaScript.

Key changes:

  • Added a skip-to-content link to the navigation bar component
  • Updated all layout components to include id="main" and tabIndex={-1} attributes on main elements
  • Created CSS styling for the skip link with screen-reader-only and focus states

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/i18n/src/locales/en.json Added English translation for "Skip to content" text
apps/site/components/withNavBar.tsx Added skip link above NavBar, refactored style imports to separate NavBar and component styles
apps/site/components/withNavBar.module.css Created new stylesheet with skip-to-content link styling using screen-reader utilities and focus states
apps/site/layouts/Post.tsx Added id="main" and tabIndex={-1} to main element
apps/site/layouts/Learn.tsx Added id="main" and tabIndex={-1} to main element
apps/site/layouts/GlowingBackdrop.tsx Added id="main" and tabIndex={-1} to main element
apps/site/layouts/DownloadArchive.tsx Added id="main" and tabIndex={-1} to main element
apps/site/layouts/Download.tsx Added id="main" and tabIndex={-1} to main element
apps/site/layouts/Default.tsx Added id="main" and tabIndex={-1} to main element
apps/site/layouts/Blog.tsx Added id="main" and tabIndex={-1} to main element
apps/site/layouts/ArticlePage.tsx Added id="main" and tabIndex={-1} to main element
apps/site/layouts/About.tsx Added id="main" and tabIndex={-1} to main element

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/i18n/src/locales/en.json
Comment thread apps/site/components/withNavBar.tsx Outdated
Comment thread apps/site/components/withNavBar.module.css Outdated
@avivkeller

Copy link
Copy Markdown
Member

Can we move the component to a SkipToContentButton in ui-components?

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

Useful feature

@ovflowd ovflowd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I was afraid the solution wouldn't be good, but actually, 🎩 hats off to you. This is definitely the least invasive way you could have implemented this.

SGTM.

@github-actions

github-actions Bot commented Jan 3, 2026

Copy link
Copy Markdown
Contributor

Lighthouse Results

URL Performance Accessibility Best Practices SEO Report
/en 🟢 97 🟢 96 🟢 100 🟢 100 🔗
/en/about 🟢 99 🟢 93 🟢 100 🟠 88 🔗
/en/about/previous-releases 🟢 99 🟢 97 🟢 100 🟢 100 🔗
/en/download 🟢 97 🟢 100 🟢 100 🟢 100 🔗
/en/download/archive/current 🟢 100 🟢 100 🟢 100 🟢 100 🔗
/en/blog 🟢 100 🟢 100 🟢 96 🟢 100 🔗

@codecov

codecov Bot commented Jan 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.25%. Comparing base (fcfc7e2) to head (1e671ba).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8514      +/-   ##
==========================================
+ Coverage   74.21%   74.25%   +0.04%     
==========================================
  Files         106      106              
  Lines        9102     9102              
  Branches      308      307       -1     
==========================================
+ Hits         6755     6759       +4     
+ Misses       2345     2341       -4     
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mikeesto mikeesto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Neat! Thank you

@AugustinMauroy AugustinMauroy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGMT ! Clean and it's work

Comment thread apps/site/components/withNavBar.tsx Outdated
Comment thread packages/ui-components/src/Common/SkipToContentButton/__tests__/index.test.jsx Outdated
@malav2110
malav2110 requested a review from avivkeller January 3, 2026 23:21
Comment thread apps/site/components/withNavBar.tsx
Comment thread packages/ui-components/src/Common/SkipToContentButton/index.tsx

@araujogui araujogui left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@avivkeller
avivkeller added this pull request to the merge queue Jan 5, 2026
Merged via the queue into nodejs:main with commit db3bed3 Jan 5, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants