Skip to content

Conversation

@connorjclark
Copy link
Collaborator

@connorjclark connorjclark commented Aug 24, 2022

Fixes #13803

Shouldn't be any surprises here. I pretty much took what @brendankenny did here. Also add some comapt code in prepareReportResult.

@connorjclark connorjclark requested a review from a team as a code owner August 24, 2022 20:20
@connorjclark connorjclark requested review from brendankenny and removed request for a team August 24, 2022 20:20
Copy link
Contributor

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

One request for a prepareReportResult test, but otherwise LGTM. Yay very slow but eventual progress! :)

* could also be objects with their own type to override this field.
*/
itemType: ItemValueType;
valueType: ItemValueType;
Copy link
Contributor

Choose a reason for hiding this comment

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

complete tangent to this change, but I feel like there was a good reason table rows are called items but I really don't remember it

*/
subItemsHeading?: {key: string, valueType?: ItemValueType, displayUnit?: string, granularity?: number};

// NOTE: not used by opportunity details, but used in the renderer until table/opportunity unification.
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens with these now? Do opportunities get a default granularity that matches their old ones now that they're tables?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Looks like nothing changes here.

I don't understand the comment though. comes from #7177 . Is it just saying that no audit that makes an opportunity tables bothers to set granularity/displayUnit? Probably true when written, but now there's at least one (first byte efficiency audit I looked at uses them, duplicated-javascript).

Regardless, same things happens as before with opportunity tables–if granularity/displayUnit is not defined, details-renderer.js various defaults are used instead.

* @return {LH.Audit.Details.OpportunityColumnHeading['subItemsHeading']}
* @return {LH.Audit.Details.TableColumnHeading['subItemsHeading']}
*/
_getCanonicalizedsubItemsHeading(subItemsHeading, parentHeading) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this can go too (how important is the falsy key check?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ehhh I think only I wanted that line added, and today I don't really see the point. A new audit would surely notice a bad key being referenced during development. so just drop.

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.

replace TableColumnHeading with OpportunityColumnHeading

3 participants