Skip to content

feat(ui): Improve aria attributes of menu items - #40573

Merged
evanpurkhiser merged 1 commit into
masterfrom
evanpurkhiser/feat-ui-give-menulistitem-role-menuitem-
Oct 27, 2022
Merged

evanpurkhiser merged 1 commit into
masterfrom
evanpurkhiser/feat-ui-give-menulistitem-role-menuitem-

Conversation

@evanpurkhiser

@evanpurkhiser evanpurkhiser commented Oct 26, 2022 •

Copy link
Copy Markdown
Member

This makes menu items a little bit better

@evanpurkhiser
evanpurkhiser requested a review from a team as a code owner October 26, 2022 05:18
@evanpurkhiser
evanpurkhiser requested review from a team and removed request for a team October 26, 2022 05:18
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 26, 2022
@evanpurkhiser
evanpurkhiser force-pushed the evanpurkhiser/feat-ui-give-menulistitem-role-menuitem- branch from c4c6130 to 53a9689 Compare October 26, 2022 05:45
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
src/sentry/static/sentry/dist/entrypoints/app.js 20.21 KB (-0.02% 🔽)
src/sentry/static/sentry/dist/entrypoints/sentry.css 33.06 KB (0%)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

For selects (including compactSelect) they are checkboxes or radios.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

menuitemcheckbox and menuitemradio require this attribute, which will be helpful in tests to understand if the item has been checked or not

Comment thread static/app/components/menuListItem.tsx Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This will be overriden in SelectOption, but this can be considered the default role

@evanpurkhiser evanpurkhiser changed the title feat(ui): Give menuListItem role="menuitem" feat(ui): Improve aria attributes of menu items Oct 26, 2022

@ryan953 ryan953 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

:shipit:

@ryan953

ryan953 commented Oct 27, 2022 •

Copy link
Copy Markdown
Member

Would be nice if the storybook aria plugin was pointing these out, but i see things are passing in there save for colors: https://storybook.sentry.dev/?path=/story/components-buttons-dropdowns-dropdown-link--anchor-left-default

@evanpurkhiser

Copy link
Copy Markdown
Member Author

going to try and update tests for this actually

// Open the mneu
userEvent.click(screen.getByRole('button', {name: 'This is a Menu'}));

// The mneu is open

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// The mneu is open
// The menu is open

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice!

@evanpurkhiser
evanpurkhiser merged commit cb19050 into master Oct 27, 2022
@evanpurkhiser
evanpurkhiser deleted the evanpurkhiser/feat-ui-give-menulistitem-role-menuitem- branch October 27, 2022 07:37
jan-auer added a commit that referenced this pull request Oct 27, 2022
* master: (82 commits)
  ref(test): Convert account security details to rtl and ts (#40638)
  fix(appconnect): Drop app_id column (#40326)
  test(js): Convert InviteMembersModal to RTL (#40637)
  test(js): Convert fieldRenderers to RTL (#40633)
  chore(events): Use longKeys for Java packages (#40539)
  ref(ui): Remove deprecatedforms from AdminQuotas (#40627)
  ref(js): Convert InviteRowControl to a FC (#40634)
  feat(ui): Improve aria attributes of menu items (#40573)
  feat(js): Report usage of deprecatedforms in window.SentryApp (#40628)
  ref(ui): Remove deprecatedforms/selectField in AdminQueue (#40626)
  ref(js): Convert TitleStar to a FC (#40632)
  feat(ui): Label Settings Serach input (#40630)
  ref(js): Extract permissionStateToList out of class (#40620)
  ref(js): Be consistent about `domId` with `useMemo` (#40622)
  feat(ui): Use `nav` For settings navigations (#40576)
  fix(webpack): Use 127.0.0.1 loopback over locahost (#40625)
  test(discover): Convert eventsRequest.spec.jsx to RTL (#40585)
  fix(ui): Remove invalid `role="text"` (#40579)
  feat(ui): Use `header` for Layout.Header component (#40580)
  (fix): self-hosted e2e env variable update (#40619)
  ...
jan-auer added a commit that referenced this pull request Oct 27, 2022
* master: (82 commits)
  ref(test): Convert account security details to rtl and ts (#40638)
  fix(appconnect): Drop app_id column (#40326)
  test(js): Convert InviteMembersModal to RTL (#40637)
  test(js): Convert fieldRenderers to RTL (#40633)
  chore(events): Use longKeys for Java packages (#40539)
  ref(ui): Remove deprecatedforms from AdminQuotas (#40627)
  ref(js): Convert InviteRowControl to a FC (#40634)
  feat(ui): Improve aria attributes of menu items (#40573)
  feat(js): Report usage of deprecatedforms in window.SentryApp (#40628)
  ref(ui): Remove deprecatedforms/selectField in AdminQueue (#40626)
  ref(js): Convert TitleStar to a FC (#40632)
  feat(ui): Label Settings Serach input (#40630)
  ref(js): Extract permissionStateToList out of class (#40620)
  ref(js): Be consistent about `domId` with `useMemo` (#40622)
  feat(ui): Use `nav` For settings navigations (#40576)
  fix(webpack): Use 127.0.0.1 loopback over locahost (#40625)
  test(discover): Convert eventsRequest.spec.jsx to RTL (#40585)
  fix(ui): Remove invalid `role="text"` (#40579)
  feat(ui): Use `header` for Layout.Header component (#40580)
  (fix): self-hosted e2e env variable update (#40619)
  ...
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 11, 2022

This branch was successfully deployed

2 active deployments
Preview – sentry — 067a9600 Deployed Oct 27, 2022 by vercel[bot]
Preview – storybook — 067a9600 Deployed Oct 27, 2022 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants