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

fix: Allow popovers in charts to be dismissed by pressing Esc #514

Merged
merged 1 commit into from
Nov 25, 2022

Conversation

avinashbot
Copy link
Member

@avinashbot avinashbot commented Nov 22, 2022

Description

The accessibility issue in question is that the details popovers appear on hover or during keyboard navigation, but they obscure content when they appear. Assistive technology users need a way to be able to dismiss these popovers without needing to drag the cursor all the way out of the chart.

Related links, issue #, if available: AWSUI-19204, AWSUI-19231, AWSUI-19238, AWSUI-19254, four issues baby wooo let's goooo

How has this been tested?

Integration tests, but feel free to test it yourself manually too!

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@avinashbot avinashbot marked this pull request as ready for review November 22, 2022 17:45
@avinashbot avinashbot requested a review from a team as a code owner November 22, 2022 17:45
@avinashbot avinashbot requested review from jperals and removed request for a team November 22, 2022 17:45
@codecov
Copy link

codecov bot commented Nov 22, 2022

Codecov Report

Base: 92.52% // Head: 92.50% // Decreases project coverage by -0.02% ⚠️

Coverage data is based on head (51676a8) compared to base (2deaa03).
Patch coverage: 78.26% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #514      +/-   ##
==========================================
- Coverage   92.52%   92.50%   -0.03%     
==========================================
  Files         567      567              
  Lines       16135    16155      +20     
  Branches     4414     4417       +3     
==========================================
+ Hits        14929    14944      +15     
- Misses       1126     1130       +4     
- Partials       80       81       +1     
Impacted Files Coverage Δ
src/area-chart/model/use-chart-model.ts 55.35% <50.00%> (-0.20%) ⬇️
src/pie-chart/pie-chart.tsx 77.70% <66.66%> (-0.44%) ⬇️
src/mixed-line-bar-chart/chart-container.tsx 90.50% <88.88%> (-0.23%) ⬇️
src/area-chart/internal.tsx 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@avinashbot avinashbot requested review from a team, Al-Dani and jperals and removed request for jperals and a team November 22, 2022 17:45

test(
'can be hidden after keyboard navigation by pressing Escape',
setupTest('#/light/bar-chart/test', async page => {
Copy link
Member

Choose a reason for hiding this comment

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

Is it intentional that this test navigates to '#/light/bar-chart/test' even though the test file name is mixed-line-bar-char-test.ts? If we are testing the Bar Chart, would it make more sense to move this test to the existing file bar-chart/__tests__/bar-chart.test.ts?

Copy link
Member

Choose a reason for hiding this comment

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

good point. I understand that the component is common for both chart variants, but still a bit confusing

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 was following the similar pattern to the rest of the page, which tests a mix of mixed-line-bar-chart, line-chart, and bar-chart components, presumably so that there's a good mix of tested components. This behavior is implemented on the mixed component, so technically testing it on the bar chart is the same (in my opinion!)

Copy link
Member

Choose a reason for hiding this comment

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

ok, now it makes more sense :)

useEffect(() => {
const onKeyDown = (event: KeyboardEvent) => {
if (event.key === 'Escape') {
clearHighlightedSegment();
Copy link
Member

Choose a reason for hiding this comment

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

maybe we can also check, whether it's really open or not.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is covered that same way in integration tests for each place where it's implemented.

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.

3 participants