Skip to content

Conversation

@paulirish
Copy link
Member

This PR takes over from #2297

Basic before and after:
image

But let's do it with a few reports, because its all about the details:

original:

http://dense-lh-reports.surge.sh/verge.orig.html
http://dense-lh-reports.surge.sh/omroep.orig.html
http://dense-lh-reports.surge.sh/paulirish.orig.html
http://dense-lh-reports.surge.sh/exampleperf.orig.html
http://dense-lh-reports.surge.sh/polymerperf.orig.html

new look:

http://dense-lh-reports.surge.sh/verge.html
http://dense-lh-reports.surge.sh/omroep.html
http://dense-lh-reports.surge.sh/paulirish.html
http://dense-lh-reports.surge.sh/exampleperf.html
http://dense-lh-reports.surge.sh/polymerperf.html

denser still, for devtools:

http://dense-lh-reports.surge.sh/verge.devtools.html
http://dense-lh-reports.surge.sh/omroep.devtools.html
http://dense-lh-reports.surge.sh/paulirish.devtools.html
http://dense-lh-reports.surge.sh/exampleperf.devtools.html
http://dense-lh-reports.surge.sh/polymerperf.devtools.html

chowse and others added 30 commits May 17, 2017 18:52
const audits = categoryDOM.querySelectorAll('.lh-category > .lh-audit, ' +
'.lh-category > .lh-passed-audits > .lh-audit, ' +
'.lh-audit-group--manual .lh-audit');
const audits = categoryDOM.querySelectorAll('.lh-audit');
Copy link
Collaborator

Choose a reason for hiding this comment

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

❤️

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.

all seems fine to me, but a couple nit thoughts

  • the debug string feels really close to the description even in non-devtools, should the description text be a bit smaller too?

image

  • disclosure triangles different colors (at this point I'll stop because I know that was on your list so you probably aren't ready for review 😄 )
    image

display: none;
}
@media screen and (min-width: 1130px) {
@media screen and (min-width: 960px) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this meant to be 964px?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah sorted these out. most are 964. there's a 965 in there too.
thx!

@paulirish
Copy link
Member Author

paulirish commented Jul 18, 2017

the debug string feels really close to the description even in non-devtools

sg. added 3px margin in all cases. feels good.

should the description text be a bit smaller too?

changed it from 12px to 11px in devtools. (this was chris's original size, too)

disclosure triangles different colors

good call. sorted.

return element;
}

_createPermalinkSpan(element, id) {
Copy link
Contributor

Choose a reason for hiding this comment

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

jsdocs for these to pass the closure check

* directly to the returned element.
* @param {!ReportRenderer.GroupJSON} group
* @param {{expandable: boolean}} opts
* @return {!HTMLDetailsElement}
Copy link
Contributor

Choose a reason for hiding this comment

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

should drop HTMLDetailsElement for Element (which breaks el.open but old-type-inference closure doesn't catch that)

const expandable = opts.expandable;
const auditGroupElem = /** @type {!HTMLDetailsElement} */ (
this._dom.createElement(expandable ? 'details' :'div',
'lh-audit-group lh-expandable-details'));
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is shared by expandable and non-expandable, lh-expandable-details -> lh-group (or something better)? Is lh-audit-group only used for these?

Copy link
Member Author

Choose a reason for hiding this comment

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

sg. stripped expandable details from these.

'lh-audit-group lh-expandable-details'));
const auditGroupHeader = this._dom.createElement('div',
const auditGroupSummary = this._dom.createChildOf(auditGroupElem, 'summary',
'lh-audit-group__summary lh-expandable-details__summary');
Copy link
Contributor

Choose a reason for hiding this comment

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

lh-expandable-details__summary

const auditGroupSummary = this._dom.createChildOf(auditGroupElem, 'summary',
'lh-audit-group__summary lh-expandable-details__summary');
const auditGroupHeader = this._dom.createChildOf(auditGroupSummary, 'div',
'lh-audit-group__header lh-expandable-details__header');
Copy link
Contributor

Choose a reason for hiding this comment

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

lh-expandable-details__header

});
auditGroupSummary.appendChild(auditGroupHeader);
auditGroupSummary.appendChild(auditGroupArrow);
if (group.description) {
Copy link
Contributor

Choose a reason for hiding this comment

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

another option is to put these as two templates, one expandable and one unexpandable. _renderAuditGroup could then just query the one it needs and then add a description as below if needed

const titleEl = this._dom.createChildOf(summary, 'div', 'lh-perf-hint__title');
titleEl.textContent = audit.result.description;

this._dom.createChildOf(summary, 'div', 'lh-toggle-arrow', {title: 'See resources'});
Copy link
Contributor

Choose a reason for hiding this comment

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

can this be lh-toggle-arrow-unexpandable? Since it doesn't appear to expand?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the item level arrow in Opportunities, which is expandable:
image

afaik, all non expandable arrows correctly have that class.

@brendankenny
Copy link
Contributor

lookin great

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.

LGTM

paulirish added a commit that referenced this pull request Jul 20, 2017
    category hash nav shouldn't underlap the fixed header
    firefox support
    width@964 breakpoint.
    fix @print styles: show site URL & time
    ensmallen scorecards. size based off body-font-size
    shorter sparklines.
    for perf opportunities, show debugText within summary, so it isn't pushed below large results tables.
    break-word for long urls in debugStrings
    sharper focus ring 5px -> 3px
    open details by default
    some groups can't be collapsed: failed, perf groups, a11y failing
    no special styling for the manual section
    devtools font size isn't smaller than 12px
@paulirish
Copy link
Member Author

manually squashed and merged in 97c7170

@paulirish paulirish closed this Jul 20, 2017
@paulirish paulirish deleted the chowsewhitespaceedits branch March 2, 2018 23:33
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.

4 participants