fix(a11y): use h1 for the product title on product detail pages - #151
Open
PaulBratslavsky wants to merge 1 commit into
Open
fix(a11y): use h1 for the product title on product detail pages#151PaulBratslavsky wants to merge 1 commit into
PaulBratslavsky wants to merge 1 commit into
Conversation
The product detail page rendered the product name as <h2> in Next and TanStack, leaving those pages with no <h1> at all. A page should have exactly one h1, and screen-reader users navigate by it. Astro and Nuxt already used <h1>, so this also brings all four frontends to the same heading structure. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Product detail pages rendered the product name as
<h2>, leaving the pagewith no
<h1>at all. A page should have exactly oneh1, andscreen-reader users navigate by it.
Draft for review — please do not merge yet.
The change
Two lines:
next/components/products/single-product.tsx:83<h2>→<h1>tanstack/src/components/products/single-product.tsx:78<h2>→<h1>Astro and Nuxt already used
<h1>and are unchanged, so this also bringsall four frontends to the same heading structure.
Verified
Each frontend was run against the shared Strapi and its live product page
checked for exactly one
h1carrying the product name:Before this change, Next and TanStack each returned
h1 count = 0.Note
next/components/products/single-product.tsxfailsyarn check:format,but it already does so on
main— 23 files do. I left it alone ratherthan bundle an unrelated reformat into a one-line fix.
Stacking
Targets
feat/tanstack-frontend(#150), so the diff above is just thisfix. Merge #150 first — GitHub will retarget this PR to
mainautomatically once it does.