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

Auto-focus ES|QL editor on mount #193800

Merged
merged 2 commits into from
Sep 24, 2024
Merged

Conversation

smith
Copy link
Contributor

@smith smith commented Sep 23, 2024

Summary

Currently, when the page loads, in order to start interacting with the ES|QL editor using keyboard navigation, you must:

  • Tab to the "Skip to main content" link
  • Follow that link
  • Tab through the tab and toolbar elements until you get to the editor
  • Press END or CTRL-E or down-down-down-down, depending on what's in the editor text box
  • Type my query

This change auto-focuses the editor and moves the cursor to the end when the editor is mounted.

The ARIA Authoring Practices Guide (APG) for Developing a Keyboard Interface says:

  • Do not set initial focus when the page loads except in cases where:
    ** The page offers a single, primary function that nearly all users employ immediately after page load.
    ** Any given user is likely to use the page often.

When using ES|QL in discover you almost always want to initially focus on the query, look at the results, and further refine the query.

Checklist

Currently, when the page loads, in order to start interacting with the ES|QL editor using keyboard navigation, you must:

* Tab to the "Skip to main content" link
* Follow that link
* Tab through the tab and toolbar elements until you get to the editor
* Press <end> or <ctrl-e> or down-down-down-down, depending on what's in the editor text box
* Type my query

This change auto-focuses the editor and moves the cursor to the end when the editor is mounted.

The [ARIA Authoring Practices Guide (APG) for Developing a Keyboard Interface](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/) says:

> * Do not set initial focus when the page loads except in cases where:
> ** The page offers a single, primary function that nearly all users employ immediately after page load.
> ** Any given user is likely to use the page often.

When using ES|QL in discover you almost always want to initially focus on the query, look at the results, and further refine the query.
@smith smith requested a review from a team as a code owner September 23, 2024 21:17
@obltmachine
Copy link

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@smith smith added backport:skip This commit does not require backporting release_note:enhancement labels Sep 23, 2024
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #60 / Detection Engine - Exception workflows APIs @serverless @serverlessQA @ess rule exceptions execution creating rules with exceptions should be able to execute against an exception list that does include valid case sensitive entries and get back 0 alerts

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
esql 172.8KB 172.9KB +53.0B

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@stratoula
Copy link
Contributor

@smith thanx for the contribution! I am going to change your labels to also backport it in 8.x (with skip it only goes to 9.0)

@stratoula stratoula added backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:ES|QL ES|QL related features in Kibana Team:ESQL ES|QL related features in Kibana and removed backport:skip This commit does not require backporting labels Sep 24, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-esql (Team:ESQL)

Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

LGTM!

@stratoula stratoula merged commit 80f938e into elastic:main Sep 24, 2024
28 checks passed
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 24, 2024
## Summary

Currently, when the page loads, in order to start interacting with the
ES|QL editor using keyboard navigation, you must:

* Tab to the "Skip to main content" link
* Follow that link
* Tab through the tab and toolbar elements until you get to the editor
* Press END or CTRL-E or down-down-down-down, depending on what's in the
editor text box
* Type my query

This change auto-focuses the editor and moves the cursor to the end when
the editor is mounted.

The [ARIA Authoring Practices Guide (APG) for Developing a Keyboard
Interface](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/)
says:

> * Do not set initial focus when the page loads except in cases where:
> ** The page offers a single, primary function that nearly all users
employ immediately after page load.
> ** Any given user is likely to use the page often.

When using ES|QL in discover you almost always want to initially focus
on the query, look at the results, and further refine the query.

### Checklist

- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))

(cherry picked from commit 80f938e)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Sep 24, 2024
# Backport

This will backport the following commits from `main` to `8.x`:
- [Auto-focus ES|QL editor on mount
(#193800)](#193800)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Nathan L
Smith","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-24T06:29:46Z","message":"Auto-focus
ES|QL editor on mount (#193800)\n\n## Summary\r\n\r\nCurrently, when the
page loads, in order to start interacting with the\r\nES|QL editor using
keyboard navigation, you must:\r\n\r\n* Tab to the \"Skip to main
content\" link\r\n* Follow that link\r\n* Tab through the tab and
toolbar elements until you get to the editor\r\n* Press END or CTRL-E or
down-down-down-down, depending on what's in the\r\neditor text box\r\n*
Type my query\r\n\r\nThis change auto-focuses the editor and moves the
cursor to the end when\r\nthe editor is mounted.\r\n\r\nThe [ARIA
Authoring Practices Guide (APG) for Developing a
Keyboard\r\nInterface](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/)\r\nsays:\r\n\r\n>
* Do not set initial focus when the page loads except in cases
where:\r\n> ** The page offers a single, primary function that nearly
all users\r\nemploy immediately after page load.\r\n> ** Any given user
is likely to use the page often.\r\n\r\nWhen using ES|QL in discover you
almost always want to initially focus\r\non the query, look at the
results, and further refine the query.\r\n\r\n### Checklist\r\n\r\n- [x]
Any UI touched in this PR is usable by keyboard only (learn
more\r\nabout [keyboard
accessibility](https://webaim.org/techniques/keyboard/))","sha":"80f938e174b1e6efce784bd3e44d477b2b512c3a","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","v9.0.0","backport:prev-minor","Feature:ES|QL","Team:ESQL","v8.16.0"],"title":"Auto-focus
ES|QL editor on
mount","number":193800,"url":"https://github.com/elastic/kibana/pull/193800","mergeCommit":{"message":"Auto-focus
ES|QL editor on mount (#193800)\n\n## Summary\r\n\r\nCurrently, when the
page loads, in order to start interacting with the\r\nES|QL editor using
keyboard navigation, you must:\r\n\r\n* Tab to the \"Skip to main
content\" link\r\n* Follow that link\r\n* Tab through the tab and
toolbar elements until you get to the editor\r\n* Press END or CTRL-E or
down-down-down-down, depending on what's in the\r\neditor text box\r\n*
Type my query\r\n\r\nThis change auto-focuses the editor and moves the
cursor to the end when\r\nthe editor is mounted.\r\n\r\nThe [ARIA
Authoring Practices Guide (APG) for Developing a
Keyboard\r\nInterface](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/)\r\nsays:\r\n\r\n>
* Do not set initial focus when the page loads except in cases
where:\r\n> ** The page offers a single, primary function that nearly
all users\r\nemploy immediately after page load.\r\n> ** Any given user
is likely to use the page often.\r\n\r\nWhen using ES|QL in discover you
almost always want to initially focus\r\non the query, look at the
results, and further refine the query.\r\n\r\n### Checklist\r\n\r\n- [x]
Any UI touched in this PR is usable by keyboard only (learn
more\r\nabout [keyboard
accessibility](https://webaim.org/techniques/keyboard/))","sha":"80f938e174b1e6efce784bd3e44d477b2b512c3a"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193800","number":193800,"mergeCommit":{"message":"Auto-focus
ES|QL editor on mount (#193800)\n\n## Summary\r\n\r\nCurrently, when the
page loads, in order to start interacting with the\r\nES|QL editor using
keyboard navigation, you must:\r\n\r\n* Tab to the \"Skip to main
content\" link\r\n* Follow that link\r\n* Tab through the tab and
toolbar elements until you get to the editor\r\n* Press END or CTRL-E or
down-down-down-down, depending on what's in the\r\neditor text box\r\n*
Type my query\r\n\r\nThis change auto-focuses the editor and moves the
cursor to the end when\r\nthe editor is mounted.\r\n\r\nThe [ARIA
Authoring Practices Guide (APG) for Developing a
Keyboard\r\nInterface](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/)\r\nsays:\r\n\r\n>
* Do not set initial focus when the page loads except in cases
where:\r\n> ** The page offers a single, primary function that nearly
all users\r\nemploy immediately after page load.\r\n> ** Any given user
is likely to use the page often.\r\n\r\nWhen using ES|QL in discover you
almost always want to initially focus\r\non the query, look at the
results, and further refine the query.\r\n\r\n### Checklist\r\n\r\n- [x]
Any UI touched in this PR is usable by keyboard only (learn
more\r\nabout [keyboard
accessibility](https://webaim.org/techniques/keyboard/))","sha":"80f938e174b1e6efce784bd3e44d477b2b512c3a"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Nathan L Smith <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:ES|QL ES|QL related features in Kibana release_note:enhancement Team:ESQL ES|QL related features in Kibana v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants