Skip to content

fix(a11y): move readme above sidebar in package view for mobile layout#1072

Open
knowler wants to merge 1 commit intonpmx-dev:mainfrom
knowler:package-dom-order-match-visual-order
Open

fix(a11y): move readme above sidebar in package view for mobile layout#1072
knowler wants to merge 1 commit intonpmx-dev:mainfrom
knowler:package-dom-order-match-visual-order

Conversation

@knowler
Copy link
Contributor

@knowler knowler commented Feb 6, 2026

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.

This is to solve a level A WCAG failure (SC 2.4.3).
@vercel
Copy link

vercel bot commented Feb 6, 2026

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

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Feb 6, 2026 5:15am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 6, 2026 5:15am
npmx-lunaria Ignored Ignored Feb 6, 2026 5:15am

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

This 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

  • danielroe
  • trueberryless
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR implements solution 1 from issue #1069 by adjusting the mobile grid layout to match DOM order with visual order, resolving the WCAG 2.4.3 focus-order failure.
Out of Scope Changes check ✅ Passed The changes are limited to adjusting mobile grid-template-areas in the package view file, directly addressing the focus-order issue without introducing unrelated modifications.
Description check ✅ Passed The pull request description clearly relates to the changeset, explaining that it resolves a WCAG focus order issue by reordering the mobile layout's grid-template-areas to match visual order.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@knowler knowler changed the title fix(a11y): move readme above sidebar in package view fix(a11y): move readme above sidebar in package view for mobile layout Feb 6, 2026
Copy link
Collaborator

@43081j 43081j left a comment

Choose a reason for hiding this comment

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

i think this is good for now and, if you do rework it, lets just open a follow up PR

EDIT: just seen alex's response below so ill hold off for now until discord/discussion resolves

@alexdln
Copy link
Contributor

alexdln commented Feb 6, 2026

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)

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.

Focus order does not follow visual order in mobile layout of the package view

3 participants