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

feat: Add keyboard accessibility to fold controls in code editor #1105

Merged
merged 9 commits into from
Jul 3, 2023

Conversation

avinashbot
Copy link
Member

@avinashbot avinashbot commented May 17, 2023

Description

Ace recently released a flag to allow keyboard access to the gutter and code folding controls, and just improve keyboard accessibility in general (ajaxorg/ace#5146). This PR enables that option, and integrates it with the pane. Additionally, it simplifies the pane's focus management logic.

There are some changes around ace-builds 1.15.0 that breaks/changes how basePath is set, so I had to mess with the ace config in the dev pages, but following up on that shouldn't block this release. We use "ace-builds" in the component itself for the typings alone.

Related links, issue #, if available: AWSUI-19227

How has this been tested?

Tests have been changed where they were failing due to behavioral changes. The rest is visual.

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.

@codecov
Copy link

codecov bot commented May 17, 2023

Codecov Report

Patch coverage: 92.85% and project coverage change: +0.02 🎉

Comparison is base (2375723) 93.20% compared to head (6e6673d) 93.22%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1105      +/-   ##
==========================================
+ Coverage   93.20%   93.22%   +0.02%     
==========================================
  Files         617      620       +3     
  Lines       16386    16464      +78     
  Branches     5366     5391      +25     
==========================================
+ Hits        15272    15349      +77     
- Misses       1041     1042       +1     
  Partials       73       73              
Impacted Files Coverage Δ
src/code-editor/setup-editor.ts 74.66% <83.33%> (+2.60%) ⬆️
src/code-editor/index.tsx 96.50% <100.00%> (+0.58%) ⬆️
src/code-editor/pane.tsx 96.87% <100.00%> (+4.01%) ⬆️
src/code-editor/util.ts 100.00% <100.00%> (ø)

... and 5 files with indirect coverage changes

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

@avinashbot avinashbot marked this pull request as ready for review June 23, 2023 07:52
@avinashbot avinashbot requested a review from a team as a code owner June 23, 2023 07:52
@avinashbot avinashbot requested review from abdhalees and removed request for a team June 23, 2023 07:52
Comment on lines +18 to +20
ace.config.set('themePath', './ace/');
ace.config.set('modePath', './ace/');
ace.config.set('workerPath', './ace/');
Copy link
Member

Choose a reason for hiding this comment

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

is a dry run to live necessary here to make sure that there isn't customers who depends on this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good reminder, will do! This is an ace minor version bump and the version provided to us is dependent on the developer, so it's technically backwards compatible. But with us bumping our (technically type-only) ace-builds dependency, it might get npm to resolve the whole application to the greater ace-builds version.

Copy link
Member

Choose a reason for hiding this comment

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

Approved, feel free to merge after running the dry run

Copy link
Member Author

Choose a reason for hiding this comment

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

Tested it, no issues other than the known one unrelated to this PR.

@avinashbot avinashbot merged commit e04a10d into main Jul 3, 2023
27 checks passed
@avinashbot avinashbot deleted the ace-gutter-a11y branch July 3, 2023 14:34
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.

None yet

2 participants