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

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

Merged

Conversation

peteharverson
Copy link
Contributor

@peteharverson peteharverson commented Feb 4, 2020

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
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
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
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.

Copy link
Contributor

@darnautov darnautov left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -61,6 +61,8 @@
}

.panel-title {
font-size: $euiFontSizeM;
Copy link
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
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
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
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
Copy link
Contributor

@walterra walterra left a comment

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.

@@ -1206,157 +1206,167 @@ export class TimeSeriesExplorer extends React.Component {
jobs.length > 0 &&
(fullRefresh === false || loading === false) &&
hasResults === true && (
<div>
<div className="results-container">
Copy link
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
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
Contributor

💚 Build Succeeded

History

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

Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 left a comment

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
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