Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActionList: Add more checks for ActionList.Item when using button semantics #4876

Merged
merged 15 commits into from
Oct 18, 2024

Conversation

TylerJDev
Copy link
Contributor

@TylerJDev TylerJDev commented Aug 23, 2024

Part of https://github.com/github/primer/issues/3722

Changelog

Changed

  • Adds more conditional checks for ActionList.Item

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

Copy link

changeset-bot bot commented Aug 23, 2024

🦋 Changeset detected

Latest commit: 84aaff8

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 Patch

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

Copy link
Contributor

github-actions bot commented Aug 23, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 97.17 KB (+0.09% 🔺)
packages/react/dist/browser.umd.js 97.48 KB (-0.01% 🔽)

@github-actions github-actions bot temporarily deployed to storybook-preview-4876 August 23, 2024 19:29 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-4876 August 28, 2024 14:04 Inactive
@primer-integration
Copy link

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

@TylerJDev TylerJDev marked this pull request as ready for review September 30, 2024 15:34
@TylerJDev TylerJDev requested a review from a team as a code owner September 30, 2024 15:34
Copy link
Member

@siddharthkp siddharthkp left a comment

Choose a reason for hiding this comment

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

1 suggestion, couple questions

.changeset/dull-moons-repair.md Outdated Show resolved Hide resolved
@@ -24,6 +24,14 @@ import VisuallyHidden from '../_VisuallyHidden'

const LiBox = styled.li<SxProp>(sx)

const ButtonItemContainer = React.forwardRef(({as: Component = 'button', children, styles, ...props}, forwardedRef) => {
return (
<Box as={Component as React.ElementType} ref={forwardedRef} sx={styles} {...props}>
Copy link
Member

Choose a reason for hiding this comment

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

just checking, do we need to merge styles like ButtonItemWrapper or is that not needed anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I saw we were already handling this on line #329, so now we pass the same logic to ButtonItemContainer, but under the styles prop instead of handling it inside of the component.

const listItemSemantics =
role === 'option' || role === 'menuitem' || role === 'menuitemradio' || role === 'menuitemcheckbox'

const listRoleTypes = ['listbox', 'menu', 'list']
Copy link
Member

Choose a reason for hiding this comment

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

Oooh, list is a new addition here. Can you say a bit more about why list was added here and what the remaining cases when we want buttonSemantics to be used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't have any live cases of role="list" with ActionList, so this was mainly just an escape hatch. There are odd cases out there where the new semantics might not be as ideal, one I can think of is when ActionList is utilized as a way to load in items (e.g. loading items story). The only issue is, they probably shouldn't be interactive if they're role="list".

Not really beholden to having it here, but thought it could be useful as a escape hatch for components that still need the old semantics, at least temporarily.

Co-authored-by: Siddharth Kshetrapal <[email protected]>
@github-actions github-actions bot temporarily deployed to storybook-preview-4876 October 1, 2024 12:36 Inactive
@TylerJDev TylerJDev requested a review from siddharthkp October 14, 2024 12:29
@lesliecdubs
Copy link
Member

👋🏻 Bumping this for priority. The associated issue to this PR https://github.com/github/primer/issues/3722 was listed as a short term repair item, which has an SLA for repair of 60 days and we are now 51 days overdue. Sid is out of office right now so we'll need to identify another reviewer. @camertron as the other engineer tagged for review, could you please add this to your queue to get reviewed this week or very early next week?

Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

Copy link
Contributor

@camertron camertron left a comment

Choose a reason for hiding this comment

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

Makes sense to me 👍

@TylerJDev TylerJDev added this pull request to the merge queue Oct 18, 2024
Merged via the queue into main with commit 9dd95a8 Oct 18, 2024
44 checks passed
@TylerJDev TylerJDev deleted the tylerjdev/action-list-semantic-checks branch October 18, 2024 18:40
@primer primer bot mentioned this pull request Oct 18, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants