Skip to content

Conversation

@TylerJDev
Copy link
Member

@TylerJDev TylerJDev commented Aug 23, 2024

Closes https://github.com/github/primer/issues/3359

Changelog

New

Changed

  • Moves aria-* attributes to ProgressBar.Item
  • Marks ProgressBar.Item as role="progressbar"

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

@changeset-bot
Copy link

changeset-bot bot commented Aug 23, 2024

🦋 Changeset detected

Latest commit: 8b67e67

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

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

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

@github-actions
Copy link
Contributor

github-actions bot commented Aug 23, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 97.26 KB (+0.02% 🔺)
packages/react/dist/browser.umd.js 97.57 KB (+0.07% 🔺)

@github-actions github-actions bot temporarily deployed to storybook-preview-4878 August 23, 2024 20:50 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-4878 August 26, 2024 14:12 Inactive
Comment on lines 64 to 75
const ariaAttributes = {
'aria-valuenow': progressAsNumber && progressAsNumber >= 0 ? Math.round(progressAsNumber) : undefined,
'aria-valuemin': 0,
'aria-valuemax': 100,
}

warning(
children &&
!ariaAttributes['aria-valuenow'] &&
typeof (rest as React.AriaAttributes)['aria-valuenow'] === 'undefined' &&
typeof (rest as React.AriaAttributes)['aria-valuetext'] === 'undefined',
'Expected `aria-valuenow` or `aria-valuetext` to be provided to <ProgressBar>. Provide one of these values so screen reader users can determine the current progress. This warning will become an error in the next major release.',
)
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm curious if there's a reason why we didn't include ariaAttributes['aria-valuenow'] as a value to include in the warning conditional? Since we automatically create the aria-valuenow based on progressAsNumber being true and a number, is that sufficient enough if consumers don't provide an aria-valuenow themselves? Also, I added progressAsNumber >= 0 so we can include aria-valuenow values that start at 0.

Cc: @kendallgassner - would love your insight, but I realize that it's been a minute since we've introduced these changes 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

huh, your right that is odd and if a user passed it in it would override the value, we are setting via ...rest. 🤔 I think it's safe to remove the warning all together.

@github-actions github-actions bot temporarily deployed to storybook-preview-4878 August 26, 2024 15:03 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-4878 August 26, 2024 16:09 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-4878 August 29, 2024 14:24 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-4878 August 30, 2024 20:47 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-4878 October 18, 2024 16:21 Inactive
@primer-integration
Copy link

primer-integration bot commented Oct 18, 2024

🟢 golden-jobs completed with status success.

@github-actions github-actions bot temporarily deployed to storybook-preview-4878 October 22, 2024 14:22 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-4878 October 22, 2024 15:20 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-4878 October 24, 2024 14:11 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-4878 October 24, 2024 15:11 Inactive
@TylerJDev TylerJDev requested a review from joshblack October 30, 2024 13:21
Copy link
Member

@joshblack joshblack left a comment

Choose a reason for hiding this comment

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

Looks great! Just left a small suggestion in case it was helpful 👍

@TylerJDev
Copy link
Member Author

Gonna wait on https://github.com/github/github/pull/344354 before I merge this PR in so we don't get failing tests 😁

@primer-integration
Copy link

👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/349794

@TylerJDev TylerJDev added this pull request to the merge queue Nov 2, 2024
Merged via the queue into main with commit 73312d8 Nov 2, 2024
43 checks passed
@TylerJDev TylerJDev deleted the tylerjdev/progress-bar-a11y branch November 2, 2024 17:02
@primer primer bot mentioned this pull request Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm status: review needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants