Skip to content

fix(theme-classic): remove redundant sidebar label titles#11966

Merged
slorber merged 2 commits into
facebook:mainfrom
cyphercodes:cyphercodes/fix-sidebar-title-a11y-11945
May 28, 2026
Merged

fix(theme-classic): remove redundant sidebar label titles#11966
slorber merged 2 commits into
facebook:mainfrom
cyphercodes:cyphercodes/fix-sidebar-title-a11y-11945

Conversation

@cyphercodes
Copy link
Copy Markdown
Contributor

@cyphercodes cyphercodes commented Apr 27, 2026

Pre-flight checklist

Motivation

Fixes #11945.

WAVE reports redundant title text for docs sidebar labels because the label text is rendered both as visible text and as an identical title attribute. This removes the redundant title attributes from docs sidebar link and category label spans while preserving the existing visible label markup and styling.

AI-assisted: I used AI assistance while preparing this PR and verified the resulting changes locally.

Test Plan

  • YARN_IGNORE_ENGINES=1 yarn test packages/docusaurus-theme-classic/src/theme/DocSidebarItem/__tests__/index.test.tsx --runInBand
  • YARN_IGNORE_ENGINES=1 yarn eslint --cache --report-unused-disable-directives packages/docusaurus-theme-classic/src/theme/DocSidebarItem/Link/index.tsx packages/docusaurus-theme-classic/src/theme/DocSidebarItem/Category/index.tsx packages/docusaurus-theme-classic/src/theme/DocSidebarItem/__tests__/index.test.tsx
  • yarn prettier --check packages/docusaurus-theme-classic/src/theme/DocSidebarItem/Link/index.tsx packages/docusaurus-theme-classic/src/theme/DocSidebarItem/Category/index.tsx packages/docusaurus-theme-classic/src/theme/DocSidebarItem/__tests__/index.test.tsx

I also attempted YARN_IGNORE_ENGINES=1 yarn workspace @docusaurus/theme-classic build after installing dependencies with scripts disabled, but it could not complete because local workspace packages such as @docusaurus/plugin-content-blog/client and @docusaurus/plugin-content-docs/client had not been built in this checkout.

Test links

Deploy preview: https://deploy-preview-11966--docusaurus-2.netlify.app/

Related issues/PRs

@meta-cla meta-cla Bot added the CLA Signed Signed Facebook CLA label Apr 27, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 27, 2026

[V2]

Name Link
🔨 Latest commit e72ac79
🔍 Latest deploy log https://app.netlify.com/projects/docusaurus-2/deploys/6a1808027a5a5b0008469720
😎 Deploy Preview https://deploy-preview-11966--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

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

I'm going to merge the minimal change because this is the correct fix

However, your unit test is way too complex for such a tiny change

I appreciate the disclosure of AI, but please do not contribute just for the sake of it to projects you barely use/understand, solving problems you do not even encounter yourself.

That kind of PR makes me lose time more than anything, and is usually not welcome.

import type {Props as CategoryProps} from '@theme/DocSidebarItem/Category';
import type {Props as LinkProps} from '@theme/DocSidebarItem/Link';

jest.mock('@docusaurus/Link', () => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is pure AI nonsense

@slorber slorber added pr: bug fix This PR fixes a bug in a past release. to backport This PR is planned to be backported to a stable version of Docusaurus labels May 28, 2026
@slorber slorber merged commit 80e70f5 into facebook:main May 28, 2026
34 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release. to backport This PR is planned to be backported to a stable version of Docusaurus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accessibility: Reduntant title text in sidebar

3 participants