Skip to content

Render the concept list once per page - #26

Open
msmfa wants to merge 1 commit into
masterfrom
fix/single-concept-nav
Open

msmfa wants to merge 1 commit into
masterfrom
fix/single-concept-nav

Conversation

@msmfa

@msmfa msmfa commented Sep 17, 2026

Copy link
Copy Markdown
Owner

Every page shipped the 35-item concept list twice: once in the desktop sidebar and again inside a <details> drawer in the mobile header, with CSS hiding whichever one did not apply at the current width. Both copies were always in the DOM, so crawlers and screen readers saw two navigation landmarks both labelled "Concepts", and each page carried about 60 words of duplicate boilerplate.

What changed

The sidebar is now the single home for the list. Below the 700px breakpoint it becomes an off-canvas drawer opened by a button in the mobile header, backed by a new src/nav.js module. It is a module rather than an inline script because the content security policy sets script-src 'self' with no unsafe-inline.

The drawer closes on Escape, on a backdrop click, and when a link inside it is followed. Escape returns focus to the button, and aria-expanded tracks the open state.

The z-index detail

The drawer and its backdrop sit at 91 and 90. .site-footer is z-index:50, so the first values I tried (30 and 29) left the footer painting over the overlay and swallowing backdrop clicks in the footer region. The new values stay below .skip-link (100) and the analytics consent banner (150), both of which should remain reachable over the drawer.

Verification

  • npm test passes, 73/73.
  • Drawer behaviour checked in headless Chromium at 390x844: open, close via Escape, close via backdrop, close on link navigation, focus return, aria-expanded transitions, no console errors, no horizontal overflow.
  • Nav presence checked at 360, 430, 700, 701, 768, 960, 1024 and 1440px on both the home page and a concept page. Exactly one concept nav in the DOM at every width, all 35 links present, and exactly one of sidebar or toggle reachable at each width.

Note on scope

This was found while investigating a Search Console report of 33 unindexed pages. It is not the cause of that. Those pages are mostly uncrawled because the property is six days old, and removing the duplicate only moves page-to-page text similarity from 87% to 85%. This is worth having as a markup and accessibility fix, not as an indexing fix.

Every page shipped the 35-item concept list twice: once in the desktop
sidebar and again inside a details drawer in the mobile header, with CSS
hiding whichever one did not apply. Both copies were always in the DOM, so
crawlers and screen readers saw two navigation landmarks both labelled
"Concepts", and every page carried about 60 words of duplicate boilerplate.

The sidebar is now the single home for the list. Below the 700px breakpoint
it becomes an off-canvas drawer opened by a button in the mobile header,
handled by a small nav.js module because the content security policy
disallows inline scripts. The drawer closes on Escape, on a backdrop click,
and when a link inside it is followed, and Escape returns focus to the
button.

The drawer and its backdrop sit at z-index 91 and 90. The site footer is
z-index 50, so the earlier values left the footer painting over the overlay
and swallowing backdrop clicks.
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.

1 participant