Skip to content

[ObsUX] [A11y] Fix focus on metadata table content#216628

Merged
MiriamAparicio merged 2 commits intoelastic:mainfrom
MiriamAparicio:a11y-metadata-tab-content
Apr 2, 2025
Merged

[ObsUX] [A11y] Fix focus on metadata table content#216628
MiriamAparicio merged 2 commits intoelastic:mainfrom
MiriamAparicio:a11y-metadata-tab-content

Conversation

@MiriamAparicio
Copy link
Contributor

@MiriamAparicio MiriamAparicio commented Apr 1, 2025

Closes #195014

Summary

Host Detail page has a Metadata tab with expandable table rows. These rows add content to the page in an unexpected reading order. Content should be expanded underneath the show more / less trigger. Focus should stay on the toggle.

Before

Screen.Recording.2025-04-01.at.12.39.56.mov

After

Screen.Recording.2025-04-01.at.12.10.15.mov

@MiriamAparicio MiriamAparicio added release_note:skip Skip the PR/issue when compiling release notes v9.0.0 Team:obs-ux-infra_services - DEPRECATED DEPRECATED - Use Team:obs-presentation. backport:version Backport to applied version labels v8.18.0 v9.1.0 v8.19.0 labels Apr 1, 2025
@MiriamAparicio MiriamAparicio requested a review from a team April 1, 2025 11:47
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

Copy link
Contributor

@rmyz rmyz left a comment

Choose a reason for hiding this comment

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

LGTM

const handleToggle = () => {
toggle();

setTimeout(() => {
Copy link
Member

Choose a reason for hiding this comment

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

Q: why is the timeout of 0 needed here?

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 used here to delay the focus shift until after the React state update (toggle()) has fully applied.
But I think it's better to use useEffect here, to have the same result, I will change it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now I remember why I used the timeout, I changed to use useEffect() but need to add another state check to avoid the focus to be always set on show more / less on reload.

Copy link
Member

Choose a reason for hiding this comment

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

Thank you for explaining!

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

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
infra 1.2MB 1.2MB +230.0B

Copy link
Member

@jennypavlova jennypavlova left a comment

Choose a reason for hiding this comment

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

Code LGTM

@MiriamAparicio MiriamAparicio merged commit 7b1d7bf into elastic:main Apr 2, 2025
9 checks passed
@MiriamAparicio MiriamAparicio deleted the a11y-metadata-tab-content branch April 2, 2025 09:25
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.18, 8.x, 9.0

https://github.com/elastic/kibana/actions/runs/14216164527

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Apr 2, 2025
Closes elastic#195014

### Summary

Host Detail page has a Metadata tab with expandable table rows. These
rows add content to the page in an unexpected reading order. Content
should be expanded underneath the show more / less trigger. Focus should
stay on the toggle.

Before

https://github.com/user-attachments/assets/13a0f7a2-2f24-4304-a6ad-cc46e3bbfc1c

After

https://github.com/user-attachments/assets/7993abdc-b693-4c0f-a161-8533cf6b2e3b
(cherry picked from commit 7b1d7bf)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Apr 2, 2025
Closes elastic#195014

### Summary

Host Detail page has a Metadata tab with expandable table rows. These
rows add content to the page in an unexpected reading order. Content
should be expanded underneath the show more / less trigger. Focus should
stay on the toggle.

Before

https://github.com/user-attachments/assets/13a0f7a2-2f24-4304-a6ad-cc46e3bbfc1c

After

https://github.com/user-attachments/assets/7993abdc-b693-4c0f-a161-8533cf6b2e3b
(cherry picked from commit 7b1d7bf)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Apr 2, 2025
Closes elastic#195014

### Summary

Host Detail page has a Metadata tab with expandable table rows. These
rows add content to the page in an unexpected reading order. Content
should be expanded underneath the show more / less trigger. Focus should
stay on the toggle.

Before

https://github.com/user-attachments/assets/13a0f7a2-2f24-4304-a6ad-cc46e3bbfc1c

After

https://github.com/user-attachments/assets/7993abdc-b693-4c0f-a161-8533cf6b2e3b
(cherry picked from commit 7b1d7bf)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.18
8.x
9.0

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 Apr 2, 2025
…216779)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[ObsUX] [A11y] Fix focus on metadata table content
(#216628)](#216628)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT
[{"author":{"name":"Miriam","email":"31922082+MiriamAparicio@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-04-02T09:25:05Z","message":"[ObsUX]
[A11y] Fix focus on metadata table content (#216628)\n\nCloses
https://github.com/elastic/kibana/issues/195014\n\n### Summary\n\nHost
Detail page has a Metadata tab with expandable table rows. These\nrows
add content to the page in an unexpected reading order. Content\nshould
be expanded underneath the show more / less trigger. Focus should\nstay
on the
toggle.\n\nBefore\n\n\nhttps://github.com/user-attachments/assets/13a0f7a2-2f24-4304-a6ad-cc46e3bbfc1c\n\nAfter\n\n\nhttps://github.com/user-attachments/assets/7993abdc-b693-4c0f-a161-8533cf6b2e3b","sha":"7b1d7bf08a8e48b0f0f5b57573e250faa7acf265","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:obs-ux-infra_services","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[ObsUX]
[A11y] Fix focus on metadata table
content","number":216628,"url":"https://github.com/elastic/kibana/pull/216628","mergeCommit":{"message":"[ObsUX]
[A11y] Fix focus on metadata table content (#216628)\n\nCloses
https://github.com/elastic/kibana/issues/195014\n\n### Summary\n\nHost
Detail page has a Metadata tab with expandable table rows. These\nrows
add content to the page in an unexpected reading order. Content\nshould
be expanded underneath the show more / less trigger. Focus should\nstay
on the
toggle.\n\nBefore\n\n\nhttps://github.com/user-attachments/assets/13a0f7a2-2f24-4304-a6ad-cc46e3bbfc1c\n\nAfter\n\n\nhttps://github.com/user-attachments/assets/7993abdc-b693-4c0f-a161-8533cf6b2e3b","sha":"7b1d7bf08a8e48b0f0f5b57573e250faa7acf265"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/216628","number":216628,"mergeCommit":{"message":"[ObsUX]
[A11y] Fix focus on metadata table content (#216628)\n\nCloses
https://github.com/elastic/kibana/issues/195014\n\n### Summary\n\nHost
Detail page has a Metadata tab with expandable table rows. These\nrows
add content to the page in an unexpected reading order. Content\nshould
be expanded underneath the show more / less trigger. Focus should\nstay
on the
toggle.\n\nBefore\n\n\nhttps://github.com/user-attachments/assets/13a0f7a2-2f24-4304-a6ad-cc46e3bbfc1c\n\nAfter\n\n\nhttps://github.com/user-attachments/assets/7993abdc-b693-4c0f-a161-8533cf6b2e3b","sha":"7b1d7bf08a8e48b0f0f5b57573e250faa7acf265"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Miriam <31922082+MiriamAparicio@users.noreply.github.com>
kibanamachine added a commit that referenced this pull request Apr 2, 2025
…216778)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ObsUX] [A11y] Fix focus on metadata table content
(#216628)](#216628)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT
[{"author":{"name":"Miriam","email":"31922082+MiriamAparicio@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-04-02T09:25:05Z","message":"[ObsUX]
[A11y] Fix focus on metadata table content (#216628)\n\nCloses
https://github.com/elastic/kibana/issues/195014\n\n### Summary\n\nHost
Detail page has a Metadata tab with expandable table rows. These\nrows
add content to the page in an unexpected reading order. Content\nshould
be expanded underneath the show more / less trigger. Focus should\nstay
on the
toggle.\n\nBefore\n\n\nhttps://github.com/user-attachments/assets/13a0f7a2-2f24-4304-a6ad-cc46e3bbfc1c\n\nAfter\n\n\nhttps://github.com/user-attachments/assets/7993abdc-b693-4c0f-a161-8533cf6b2e3b","sha":"7b1d7bf08a8e48b0f0f5b57573e250faa7acf265","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:obs-ux-infra_services","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[ObsUX]
[A11y] Fix focus on metadata table
content","number":216628,"url":"https://github.com/elastic/kibana/pull/216628","mergeCommit":{"message":"[ObsUX]
[A11y] Fix focus on metadata table content (#216628)\n\nCloses
https://github.com/elastic/kibana/issues/195014\n\n### Summary\n\nHost
Detail page has a Metadata tab with expandable table rows. These\nrows
add content to the page in an unexpected reading order. Content\nshould
be expanded underneath the show more / less trigger. Focus should\nstay
on the
toggle.\n\nBefore\n\n\nhttps://github.com/user-attachments/assets/13a0f7a2-2f24-4304-a6ad-cc46e3bbfc1c\n\nAfter\n\n\nhttps://github.com/user-attachments/assets/7993abdc-b693-4c0f-a161-8533cf6b2e3b","sha":"7b1d7bf08a8e48b0f0f5b57573e250faa7acf265"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/216628","number":216628,"mergeCommit":{"message":"[ObsUX]
[A11y] Fix focus on metadata table content (#216628)\n\nCloses
https://github.com/elastic/kibana/issues/195014\n\n### Summary\n\nHost
Detail page has a Metadata tab with expandable table rows. These\nrows
add content to the page in an unexpected reading order. Content\nshould
be expanded underneath the show more / less trigger. Focus should\nstay
on the
toggle.\n\nBefore\n\n\nhttps://github.com/user-attachments/assets/13a0f7a2-2f24-4304-a6ad-cc46e3bbfc1c\n\nAfter\n\n\nhttps://github.com/user-attachments/assets/7993abdc-b693-4c0f-a161-8533cf6b2e3b","sha":"7b1d7bf08a8e48b0f0f5b57573e250faa7acf265"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Miriam <31922082+MiriamAparicio@users.noreply.github.com>
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Apr 4, 2025
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

1 similar comment
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

kibanamachine added a commit that referenced this pull request Apr 9, 2025
…216777)

# Backport

This will backport the following commits from `main` to `8.18`:
- [[ObsUX] [A11y] Fix focus on metadata table content
(#216628)](#216628)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT
[{"author":{"name":"Miriam","email":"31922082+MiriamAparicio@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-04-02T09:25:05Z","message":"[ObsUX]
[A11y] Fix focus on metadata table content (#216628)\n\nCloses
https://github.com/elastic/kibana/issues/195014\n\n### Summary\n\nHost
Detail page has a Metadata tab with expandable table rows. These\nrows
add content to the page in an unexpected reading order. Content\nshould
be expanded underneath the show more / less trigger. Focus should\nstay
on the
toggle.\n\nBefore\n\n\nhttps://github.com/user-attachments/assets/13a0f7a2-2f24-4304-a6ad-cc46e3bbfc1c\n\nAfter\n\n\nhttps://github.com/user-attachments/assets/7993abdc-b693-4c0f-a161-8533cf6b2e3b","sha":"7b1d7bf08a8e48b0f0f5b57573e250faa7acf265","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:obs-ux-infra_services","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[ObsUX]
[A11y] Fix focus on metadata table
content","number":216628,"url":"https://github.com/elastic/kibana/pull/216628","mergeCommit":{"message":"[ObsUX]
[A11y] Fix focus on metadata table content (#216628)\n\nCloses
https://github.com/elastic/kibana/issues/195014\n\n### Summary\n\nHost
Detail page has a Metadata tab with expandable table rows. These\nrows
add content to the page in an unexpected reading order. Content\nshould
be expanded underneath the show more / less trigger. Focus should\nstay
on the
toggle.\n\nBefore\n\n\nhttps://github.com/user-attachments/assets/13a0f7a2-2f24-4304-a6ad-cc46e3bbfc1c\n\nAfter\n\n\nhttps://github.com/user-attachments/assets/7993abdc-b693-4c0f-a161-8533cf6b2e3b","sha":"7b1d7bf08a8e48b0f0f5b57573e250faa7acf265"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/216628","number":216628,"mergeCommit":{"message":"[ObsUX]
[A11y] Fix focus on metadata table content (#216628)\n\nCloses
https://github.com/elastic/kibana/issues/195014\n\n### Summary\n\nHost
Detail page has a Metadata tab with expandable table rows. These\nrows
add content to the page in an unexpected reading order. Content\nshould
be expanded underneath the show more / less trigger. Focus should\nstay
on the
toggle.\n\nBefore\n\n\nhttps://github.com/user-attachments/assets/13a0f7a2-2f24-4304-a6ad-cc46e3bbfc1c\n\nAfter\n\n\nhttps://github.com/user-attachments/assets/7993abdc-b693-4c0f-a161-8533cf6b2e3b","sha":"7b1d7bf08a8e48b0f0f5b57573e250faa7acf265"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Miriam <31922082+MiriamAparicio@users.noreply.github.com>
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services - DEPRECATED DEPRECATED - Use Team:obs-presentation. v8.18.0 v8.19.0 v9.0.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Obs Infrastructure > Host Detail][KEYBOARD]: Metadata tab has accordions that reveal content out of logical order

6 participants