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

Change Audit Descriptions based on Audit Results #2478

Merged
merged 7 commits into from
Jul 7, 2017
Merged

Change Audit Descriptions based on Audit Results #2478

merged 7 commits into from
Jul 7, 2017

Conversation

evenstensberg
Copy link
Contributor

@evenstensberg evenstensberg commented Jun 9, 2017

fixes #2311, #1611, #2326, #1613


this PR was started in #2418 and then moved here.

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

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

thanks again! using fallbackDescription and audit logic looks a-ok to me

@@ -17,6 +17,8 @@ class Viewport extends Audit {
category: 'Mobile Friendly',
name: 'viewport',
description: 'Has a `<meta name="viewport">` tag with `width` or `initial-scale`',
fallbackDescription: 'Does not have a `<meta name="viewport">` tag with `width` ' +
'or `initial-scale`',
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: indentation

@@ -21,6 +21,8 @@ class VideoDescription extends AxeAudit {
category: 'Accessibility',
name: 'video-description',
description: '`<video>` elements contain a `<track>` element with `[kind="description"]`.',
fallbackDescription: '`<video>` elements do not contain a `<track>` element with ' +
'`[kind="description"]`.',
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: indentation

@@ -21,6 +21,8 @@ class VideoCaption extends AxeAudit {
category: 'Accessibility',
name: 'video-caption',
description: '`<video>` elements contain a `<track>` element with `[kind="captions"]`.',
fallbackDescription: '`<video>` elements do not contain a `<track>` element ' +
'with `[kind="captions"]`.',
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: indentation

@@ -22,6 +22,8 @@ class THHasDataCells extends AxeAudit {
name: 'th-has-data-cells',
description: '`<th>` elements and elements with `[role="columnheader"/"rowheader"]` have ' +
'data cells they describe.',
fallbackDescription: '`<th>` elements and elements with ' +
'`[role="columnheader"/"rowheader"]` do not have data cells they describe.',
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: indentation

@@ -23,6 +23,8 @@ class TDHeadersAttr extends AxeAudit {
name: 'td-headers-attr',
description: 'Cells in a `<table>` element that use the `[headers]` attribute only refer ' +
'to other cells of that same table.',
fallbackDescription: 'Cells in a `<table>` element that use the `[headers]` ' +
'attribute refers to other cells of that same table.',
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: indentation

@@ -21,6 +21,8 @@ class HTMLLangValid extends AxeAudit {
category: 'Accessibility',
name: 'html-lang-valid',
description: '`<html>` element has a valid value for its `[lang]` attribute.',
fallbackDescription: '`<html>` element does not have a valid value for ' +
'its `[lang]` attribute.',
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: indentation

'or <template> elements.',
'or `<template>` elements.',
fallbackDescription: '`<dl>`\'s do not contain only properly-ordered `<dt>` and `<dd>` ' +
'groups, `<script>` ' +
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: indentation, can collapse these two lines too

@@ -22,6 +22,8 @@ class ColorContrast extends AxeAudit {
category: 'Accessibility',
name: 'color-contrast',
description: 'Background and foreground colors have a sufficient contrast ratio.',
fallbackDescription: 'Background and foreground colors do not have a ' +
'sufficient contrast ratio.',
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: indentation

@@ -21,6 +21,8 @@ class AudioCaption extends AxeAudit {
category: 'Accessibility',
name: 'audio-caption',
description: '`<audio>` elements contain a `<track>` element with `[kind="captions"]`.',
fallbackDescription: '`<audio>` elements are missing a `<track>` element with ' +
'`[kind="captions"]`.',
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: indentation

description: '`[role]`s that require child `[role]`s contain them.',
description: 'Elements with `[role]` that require specific children `[role]`s, are present.',
fallbackDescription: 'Elements with `[role]` that require specific children `[role]`s, ' +
'are missing.',
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: indentation

@evenstensberg
Copy link
Contributor Author

yarn lint didn't complain in my tests, anything I need to run in order to get corrections?

@patrickhulce
Copy link
Collaborator

yarn lint didn't complain in my tests, anything I need to run in order to get corrections?

unfortunately eslint's indent support is quite limited, one day we'll just say run prettier and problem solved but for now it's a human endeavor :/

@evenstensberg
Copy link
Contributor Author

All done now, tell me if you need an addition to the new feature on password pasting 👍

@kaycebasques
Copy link
Contributor

kaycebasques commented Jun 12, 2017

Here's the "docs journey" that I want to protect:

  1. User fails an audit.
  2. User clicks a link to learn more about how to fix.
  3. The name of the doc matches the name of the audit that they failed.

So, it seems that users will see the fallbackDescription when they fail an audit. Is that correct? If so, I need to make sure that all the docs match the new fallbackDescription texts

@@ -22,6 +22,8 @@ class List extends AxeAudit {
name: 'list',
description: 'Lists contain only `<li>` elements and script supporting elements ' +
'(`<script>` and `<template>`).',
fallbackDescription: 'Lists do not contain only `<li>` elements and script ' +
'supporting elements (`<script>` and `<template>`).',
Copy link
Contributor

Choose a reason for hiding this comment

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

Side note: In this iteration I see that we're just inversing the description. But I think sometimes that leads to clunky sentences. We can make the fallbacks more readable by rephrasing them:

E.g. this one could be changed to Lists contain invalid elements

I'm not asking you to do this now, just noting 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.

Yeah that's what I did initially. We be a bit more expressive though?

Copy link
Contributor

Choose a reason for hiding this comment

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

Right. I'd hate to lose the full description when someone fails. That's when they need the most help :) Most of the time, users will start off failing the audit. I think it will also be quite confusing if the two descriptions change a lot. People are going to be like "where did that audit go that I was just failing"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need a suggestion if I'm to change this 👍

Copy link
Contributor

@kaycebasques kaycebasques Jun 12, 2017

Choose a reason for hiding this comment

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

No change needed (from me, at least). Just discussing

@ebidel
Copy link
Contributor

ebidel commented Jun 12, 2017

@ev1stensberg can you rebase?

@evenstensberg
Copy link
Contributor Author

Done

Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

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

bikeshed: rename property as failureDescription? "fallback" isn't very specific


let auditDescription = audit.meta.description;
if (audit.meta.fallbackDescription) {
if (!result.rawValue || (typeof result.rawValue === 'number' && result.rawValue < 100)) {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe I missed this in the last PR review, but shouldn't this be based on score?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, and DOM size is invalid cause of that, one of the things that needed discussion. I change the code accordingly to @patrickhulce 's last comment on the other branch
skjermbilde 2017-06-12 kl 21 10 35

Evidently I really wanted to use the labels that are used, but that happens later

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed in new commit

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah we should really be doing that step much earlier than in report-generator.js so things like this don't happen


let auditDescription = audit.meta.description;
if (audit.meta.fallbackDescription) {
if (!result.rawValue || (typeof result.rawValue === 'number' && result.score < 100)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@ev1stensberg I believe brendan intended this entire expression to be based on score the local variable since that already does the correct use of result.rawValue if a score isn't set

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pushed a new commit, is that what you meant? Sorry, was a bit unsure when I review a second time!

@evenstensberg
Copy link
Contributor Author

@brendankenny Done now, I agree!

@paulirish
Copy link
Member

@ev1stensberg can you help us out with rebasing this?

once that's done we can merge.

@evenstensberg
Copy link
Contributor Author

🇲🇰

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

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.

Wording issue --> "won't" should be "will"
7 participants