Skip to content

PageHeader: Address dom order issues (screen reader experience feedback from sign-off) - #4358

Merged
broccolinisoup merged 25 commits into
mainfrom
pageheader-sign-off-review-address
May 29, 2024
Merged

PageHeader: Address dom order issues (screen reader experience feedback from sign-off) #4358
broccolinisoup merged 25 commits into
mainfrom
pageheader-sign-off-review-address

Conversation

@broccolinisoup

@broccolinisoupbroccolinisoup commented Mar 6, 2024

Copy link
Copy Markdown
Member

Copied from #3816 (due to merge conflicts)

As a part of addressing accessibility sign-off review comments https://github.com/github/primer/issues/1115#issuecomment-1499501472, this PR updates the stories to ensure the order of the elements are the following;

  1. PageHeader.Title
  2. ContextArea (all elements)
  3. PageHeader.LeadingAction
  4. PageHeader.TrailingAction
  5. PageHeader.Actions

instead of

  1. ContextArea (all elements)
  2. PageHeader.LeadingAction
  3. PageHeader.Title
  4. PageHeader.TrailingAction
  5. PageHeader.Actions

The motivation behind is to make sure the actions on the page that are displayed above or before the main heading (Context area actions and leading action) should come after the main title (PageHeader.Title). With this way, we make sure screen reader users who navigate through heading menus don't miss any actions.

While we updated the dom order in the stories and this is how we will recommend to order the elements, we made sure everything, visually stays the same. (Leveraging CSS grid layout)

sign-off review comment reference

Changelog

New

Changed

  • Layout of the Root element from flex to grid
  • The order of PageHeader's sub components in the stories.

Removed

Rollout strategy

This is technically a breaking change but PageHeader is still a draft component, so we are good to realise this as a patch. There is one instance at github/github to be updated and I'll list the commit here to be included in the release PR.

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan

Testing & Reviewing

Merge checklist

  • Added/updated tests
  • Added/updated documentation (After I get 👍🏻 on the solution and the direction, I'll update the docs)
  • Added/updated previews (Storybook)
  • Changes are SSR compatible
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

@changeset-bot

changeset-botBot commented Mar 6, 2024

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7bb732d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
NameType
@primer/reactMinor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@broccolinisoupbroccolinisoup changed the title Update layout styles so that all interactive elements come after the titlePageHeader: Address dom order issues (screen reader experience feedback from sign-off) Mar 6, 2024
@github-actions

github-actionsBot commented Mar 6, 2024

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js89.34 KB (0%)
packages/react/dist/browser.umd.js89.68 KB (0%)

@github-actions
github-actionsBottemporarily deployed to storybook-preview-4358 March 6, 2024 01:27 Inactive
@github-actions
github-actionsBottemporarily deployed to storybook-preview-4358 March 6, 2024 02:31 Inactive
@broccolinisoupbroccolinisoup added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Mar 6, 2024
@github-actionsgithub-actionsBot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Mar 6, 2024
@primer
primerBottemporarily deployed to github-pages March 6, 2024 03:19 Inactive
@github-actions
github-actionsBottemporarily deployed to storybook-preview-4358 March 6, 2024 03:20 Inactive
@broccolinisoup
broccolinisoup marked this pull request as ready for review March 6, 2024 05:32
@broccolinisoup
broccolinisoup requested a review from a teamMarch 6, 2024 05:32
@broccolinisoup
broccolinisoup requested review from a team as code ownersMarch 27, 2024 02:46
@github-actions
github-actionsBottemporarily deployed to storybook-preview-4358 March 27, 2024 02:50 Inactive
@broccolinisoupbroccolinisoup added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Mar 27, 2024
@github-actions
github-actionsBottemporarily deployed to storybook-preview-4358 May 23, 2024 23:22 Inactive
@broccolinisoup
broccolinisoup added this pull request to the merge queueMay 29, 2024
Merged via the queue into main with commit e34e4b2May 29, 2024
@broccolinisoup
broccolinisoup deleted the pageheader-sign-off-review-address branch May 29, 2024 08:55
@primerprimerBot mentioned this pull request May 29, 2024
khiga8 pushed a commit that referenced this pull request May 31, 2024
…ck from sign-off) (#4358)
* Update layout styles so that all interactive elements come after the title
* Add PageHeder.Breadcrumbs sub component
* remove shapshot check on jest
* test(vrt): update snapshots
* test(vrt): update snapshots
* make the interactive element in the heading check a warning not error
* add pageheader story for screen reader tes
* add links
* add onclick events to the buttons
* add a placeholder for file content example
* test(vrt): update snapshots
* elements losing context when viewport is narrrow - keep the same text for buttons in all viewports
* fix linting
* test(vrt): update snapshots
* hide the overflow menu in narrow since we show it on the context area
* accomodate different format sx prop for font size
* when no fontsize is specified css var returns as an empty string so need ternary instead of Nullish coalescing
* temporary fix on navlist
---------
Co-authored-by: broccolinisoup <broccolinisoup@users.noreply.github.com>
Sign up for freeto 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.

3 participants

@broccolinisoup@mperrotti@joshblack