Skip to content

[ML] (Accessibility) Fix page heading structure - #56741

Merged
peteharverson merged 4 commits into
elastic:masterfrom
peteharverson:ml-accessibility-page-structure
Feb 6, 2020
Merged

peteharverson merged 4 commits into
elastic:masterfrom
peteharverson:ml-accessibility-page-structure

Conversation

@peteharverson

@peteharverson peteharverson commented Feb 4, 2020 •

Copy link
Copy Markdown
Contributor

Summary

Part of #37539 and #52278, fixes landmark and heading structure for pages in the ML plugin.

Changes made ensure pages meet following WCAG criteria:

  • Main landmark must not be contained in another landmark
  • Document must have 1 main landmark
  • Ensure landmarks are unique
  • Every page should have an <h1>
  • Heading tags should be properly nested e.g. <h1> - <h2> - <h3>

Pages were checked using the WAVE extension on Chrome.

Changes made were to the <main> landmarks and heading tags, with the aim of keeping the pages visually unchanged. The only significant difference is that the results and import pages now display the imported file name in a <h1> tag:

image

Note that the <h1> tags for the Anomaly Explorer and Single Metric Viewer pages are inside <EuiScreenReaderOnly> tags. The heading and nav menu structure of these pages are currently being reviewed, which may result in these page headings being made visible.

Checklist

For maintainers

@elasticmachine

Copy link
Copy Markdown
Contributor

Pinging @elastic/ml-ui (:ml)

@peteharverson peteharverson self-assigned this Feb 4, 2020
Comment on lines +4 to +8
.influencer-title {
font-size: $euiFontSizeM - 2px;
font-weight: 600;
line-height: 24px;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it possible at all to use one of the pre-existing title sizing without overrides? We've created the title scale with the intention that we'd have consistency throughout all the apps in Kibana. I'm sure one of these sizes should fit this use case. http://eui.elastic.co/#/display/title

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@cchaos good spot - I have managed to remove this override, plus another one I was using on the data visualizer cards in 6f1de6b.

I have decided to leave some panel-title overrides for headings on the Anomaly Explorer and Single Metric Viewer for now, to retain the current size (18px) and color. Note @mdefazio is currently looking at some options for headings and controls on these two pages, so we may be able to clean these up in a future PR.

@darnautov darnautov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

}

.panel-title {
font-size: $euiFontSizeM;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: might be better to use EuiTitle size attribute instead

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Going to stick with euiFontSizeM here - it is 18px, and works well with the existing content in the page. For EuiTitle the size options are only giving me a choice of 16px or 20px.

Comment on lines +37 to +39
font-size: $euiFontSizeM;
font-weight: 400;
color: $euiColorDarkShade;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Already spotted .panel-title class with similar styles 👀

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As above, going to stick with euiFontSizeM here as it retains the 18px font size used previously.

@darnautov
darnautov requested a review from cchaos February 5, 2020 13:08

@walterra walterra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good overall, just added a question about the structure for Single Metric Viewer.

(fullRefresh === false || loading === false) &&
hasResults === true && (
<div>
<div className="results-container">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This change now contradicts the the comment below (... inside this **plain** wrapping element ...) can you check this doesn't break tooltip positioning? Depending on the outcome we should fix the div or adapt the comment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good spot. I have added the extra plain div back in (one with 0px left/right padding) in 5efc092. I also edited the comment used in explorer.js to clarify the role of the container div for the ChartTooltip.

@cchaos
cchaos requested review from mdefazio and removed request for cchaos February 5, 2020 15:59
@kibanamachine

Copy link
Copy Markdown
Contributor

💚 Build Succeeded

History

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

@alvarezmelissa87 alvarezmelissa87 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM ⚡️

@peteharverson
peteharverson merged commit 595c869 into elastic:master Feb 6, 2020
@peteharverson
peteharverson deleted the ml-accessibility-page-structure branch February 6, 2020 09:27
peteharverson added a commit to peteharverson/kibana that referenced this pull request Feb 6, 2020
* [ML] (Accessibility) Fix page heading structure

* [ML] Fix file datavisualizer SCSS import

* [ML] Switch to EuiTitle for influencers list and data viz cards

* [ML] Fix positioning of chart tooltip in Single Metric Viewer
peteharverson added a commit that referenced this pull request Feb 6, 2020
* [ML] (Accessibility) Fix page heading structure

* [ML] Fix file datavisualizer SCSS import

* [ML] Switch to EuiTitle for influencers list and data viz cards

* [ML] Fix positioning of chart tooltip in Single Metric Viewer
patrykkopycinski pushed a commit to patrykkopycinski/kibana that referenced this pull request May 6, 2026
* [ML] (Accessibility) Fix page heading structure

* [ML] Fix file datavisualizer SCSS import

* [ML] Switch to EuiTitle for influencers list and data viz cards

* [ML] Fix positioning of chart tooltip in Single Metric Viewer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants