fix(a11y): move readme above sidebar in package view for mobile layout#1072
fix(a11y): move readme above sidebar in package view for mobile layout#1072knowler wants to merge 1 commit intonpmx-dev:mainfrom
Conversation
This is to solve a level A WCAG failure (SC 2.4.3).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
📝 WalkthroughWalkthroughThis pull request adjusts the mobile layout grid structure in the package view component. The grid-template-areas order has been modified to reorder how sections are displayed on mobile devices. Specifically, the layout now positions the readme section and sidebar differently to ensure the visual grid order aligns with the document object model (DOM) order, addressing a focus order accessibility issue identified in the linked WCAG 2.2 compliance check. Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
I agree that the order needs to be changed (discord), but I disagree about the reason. If the problem is only with A11Y, we need to change the order of the elements in the DOM (make <Sidebar> higher than <Readme>). As for the visual reordering, I think it's better to decide what experience we want to achieve (maybe for example collapsing sidebar sections on mobile devices is better) |
Resolves #1069 which reports a WCAG 2.2 SC 2.4.3 Focus Order (Level A) failure.
See the linked issue. This PR goes with the easiest solution to the problem which is just making the DOM order match the visual order as that’s how the tablet/desktop view works (for screen readers). I am open to the other solutions I mentioned in the issue (someone else just might need to implement them).
As I mentioned in the issue, I think we could improve on the mobile experience by making the README section collapsible, at least on mobile. I did see the
<CollapsibleSection>component, however, the code for it made me think it might have been designed for the sidebar and might not work well for the README section.We can always hold this PR until we figure out a solution for that. This is such a small change that it shouldn’t be hard to update.