-
Notifications
You must be signed in to change notification settings - Fork 9.5k
report: add label to provide context for subItems #13858
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
base: main
Are you sure you want to change the base?
Conversation
IMO yes. Would underline work? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall I like it better, but the audits with screenshots maybe need another iteration. The screenshot makes it harder to differentiate the levels and they also get busier with the extra label and hr
}; | ||
|
||
const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); | ||
|
||
class AxeAudit extends Audit { | ||
static get relatedNodesLabel() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static field or function instead of a getter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this does match how we handle meta
.
@@ -81,7 +87,10 @@ class AxeAudit extends Audit { | |||
}, | |||
subItems: axeNode.relatedNodes.length ? { | |||
type: 'subitems', | |||
items: axeNode.relatedNodes.map(node => ({relatedNode: Audit.makeNodeItem(node)})), | |||
label: this.relatedNodesLabel, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha, this kind of thing makes me think axe-audit inheritance should just be killed and turned into a function call :)
@@ -16,11 +16,17 @@ const i18n = require('../../lib/i18n/i18n.js'); | |||
const UIStrings = { | |||
/** Label of a table column that identifies HTML elements that have failed an audit. */ | |||
failingElementsHeader: 'Failing Elements', | |||
/** Label of a table column that identifies HTML elements that are related to a failure in an audit. */ | |||
relatedElementsHeader: 'Related Elements', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
singular/plural for this is somewhat unfortunate. "Reasons" (when there's only one reason) seems worse to me than e.g. "Duplicate Elements" for some reason.
Could maybe make it the count an argument and only do a single option for cases that are always singular? I don't know if TC or whatever will complain/get weird with {relatedNodeCount, plural, other {Background Element}}
, though.
@@ -98,28 +98,33 @@ describe('LegacyJavaScript audit', () => { | |||
]); | |||
expect(result.items).toHaveLength(1); | |||
expect(result.items[0]).toMatchInlineSnapshot(` | |||
Object { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation issue with these files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops. You have to babysit jest when asking it to -u
inline snapshots. It was fixed for a short minute... but regressed at some point. Maybe fixed in latest, idk.
yeah.. i tried out some styles to shrink the screenshot + constrain the text for subrows. it's.. better. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these capitals feel extraneous. (though perhaps we adopted a style for this already?)
i don't have a great idea on the label's typography or graphical delineation...
@Jiwoong can you help us out?
- we're adding this label to communicate what these sub items are all about. it looks aiight but you could probably help us with it
- especially when theres more thumbnails in the sub items, the layout gets pretty wonky and hard to follow.. especially tricky cuz we autosize based on aspect ratio and the aspect ratios are totally unpredictable. in an above comment i tried shrinking subitem thumbnails. any ideas?
@@ -16,11 +16,17 @@ const i18n = require('../../lib/i18n/i18n.js'); | |||
const UIStrings = { | |||
/** Label of a table column that identifies HTML elements that have failed an audit. */ | |||
failingElementsHeader: 'Failing Elements', | |||
/** Label of a table column that identifies HTML elements that are related to a failure in an audit. */ | |||
relatedElementsHeader: 'Related Elements', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
relatedElementsHeader: 'Related Elements', | |
relatedElementsHeader: 'Related elements', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah but Failed Elements
:( change that too? it's the (regular) column text
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bump
@@ -23,6 +23,8 @@ const UIStrings = { | |||
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ | |||
description: 'Low-contrast text is difficult or impossible for many users to read. ' + | |||
'[Learn more](https://web.dev/color-contrast/).', | |||
/** Label of a table column that identifies a single HTML element that is the background of another HTML element. */ | |||
backgroundElementHeader: 'Background Element', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
backgroundElementHeader: 'Background Element', | |
backgroundElementHeader: 'Background element', |
@@ -20,6 +20,8 @@ const UIStrings = { | |||
failureTitle: 'ARIA IDs are not unique', | |||
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ | |||
description: 'The value of an ARIA ID must be unique to prevent other instances from being overlooked by assistive technologies. [Learn more](https://web.dev/duplicate-id-aria/).', | |||
/** Label of a table column that identifies HTML elements that are duplicates of another HTML element. */ | |||
relatedElementsHeader: 'Duplicate Elements', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
relatedElementsHeader: 'Duplicate Elements', | |
relatedElementsHeader: 'Duplicate elements', |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
made the line thinner (pictures have been updated) |
we don't like how we show the sub-row label multiple times let's add the label to be just below the main header label, but like this:
and lets also add that vertical line to the sub row items (like already done for insight audit tables) |
This adds a field
label
toTableSubItems
, to help improve context when rendering subitems underneath a table item row.Did not give
third-party-web
a subitems label because it seems good alreadycnn report here: https://lighthouse-1065v6gec-googlechrome.vercel.app/gh-pages/viewer/?gist=8fdec0793bab3abea4e66bc1129b06d7