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

report(redesign): design review feedback #8785

Merged
merged 23 commits into from
May 6, 2019
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lighthouse-core/report/html/renderer/category-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ class CategoryRenderer {

// Add list of warnings or singular warning
const warningsEl = this.dom.createChildOf(titleEl, 'div', 'lh-warnings');
this.dom.createChildOf(warningsEl, 'span').textContent = Util.UIStrings.warningHeader;
if (warnings.length === 1) {
warningsEl.textContent = `${Util.UIStrings.warningHeader} ${warnings.join('')}`;
warningsEl.appendChild(this.dom.document().createTextNode(warnings.join('')));
} else {
warningsEl.textContent = Util.UIStrings.warningHeader;
const warningsUl = this.dom.createChildOf(warningsEl, 'ul');
for (const warning of warnings) {
const item = this.dom.createChildOf(warningsUl, 'li');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ class PerformanceCategoryRenderer extends CategoryRenderer {

// 'Values are estimated and may vary' is used as the category description for PSI
if (environment !== 'PSI') {
const estValuesEl = this.dom.createChildOf(metricsColumn2El, 'div',
'lh-metrics__disclaimer lh-metrics__disclaimer');
const estValuesEl = this.dom.createChildOf(metricsColumn1El, 'div', 'lh-metrics__disclaimer');
estValuesEl.textContent = Util.UIStrings.varianceDisclaimer;
}

Expand Down
16 changes: 0 additions & 16 deletions lighthouse-core/report/html/renderer/report-ui-features.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ class ReportUIFeatures {

this.json = report;
this._setupMediaQueryListeners();
this._setupSmoothScroll();
this._setupExportButton();
this._setupThirdPartyFilter();
this._setupStickyHeaderElements();
Expand Down Expand Up @@ -120,17 +119,6 @@ class ReportUIFeatures {
this.onMediaQueryChange(mediaQuery);
}

_setupSmoothScroll() {
for (const el of this._dom.findAll('a.lh-gauge__wrapper', this._document)) {
const anchorElement = /** @type {HTMLAnchorElement} */ (el);
anchorElement.addEventListener('click', e => {
e.preventDefault();
window.history.pushState({}, '', anchorElement.hash);
this._dom.find(anchorElement.hash, this._document).scrollIntoView({behavior: 'smooth'});
Copy link
Member

Choose a reason for hiding this comment

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

wait why?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

was mentioned in the design meeting. @yuinchien asked if the animation could be shorter. i said what if it were just removed completely. i thought everyone said ok

idea was just - user wants to see a particular part of the report, so just show them as soon as intent is made w/o the fanfare of a scroll animation.

Copy link
Member

Choose a reason for hiding this comment

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

yuin and i are still attached to it. i got a branch for fixing the highlighter anim

Copy link
Member

Choose a reason for hiding this comment

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

@paulirish whats up with this

});
}
}

/**
* Handle media query change events.
* @param {MediaQueryList|MediaQueryListEvent} mql
Expand Down Expand Up @@ -268,10 +256,6 @@ class ReportUIFeatures {
this.metricDescriptionToggleEl = /** @type {HTMLInputElement} */ (metricDescriptionToggleEl);
this.metricAuditGroup = this._dom.find('.lh-audit-group--metrics', this._document);
this.metricDescriptionToggleEl.addEventListener('input', this._toggleMetricDescription);
this.metricAuditGroup.addEventListener('click', e => {
const el = /** @type {HTMLElement} */ (e.target);
if (el.closest('.lh-metric__title')) this.metricDescriptionToggleEl.click();
});
}

_toggleMetricDescription() {
Expand Down
42 changes: 24 additions & 18 deletions lighthouse-core/report/html/report-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
--lh-audit-group-vpadding: 8px;
--lh-section-vpadding: 12px;
--chevron-size: 12px;
--inner-audit-left-padding: calc(var(--text-indent) + var(--lh-audit-index-width) + 2 * var(--audit-item-gap));

/* Palette. */
--color-black-100: #F5F5F5;
Expand Down Expand Up @@ -104,8 +105,8 @@
--env-name-min-width: 220px;
--env-tem-padding: 10px 0px;
--expandable-padding: 0 0 2px calc(var(--score-shape-margin-left) + var(--score-shape-size) + var(--score-shape-margin-right));
--gauge-circle-size-big: 120px;
--gauge-circle-size: 96px;
--gauge-circle-size-big: 112px;
--gauge-circle-size: 80px;
--header-padding: 20px 0 20px 0;
--highlighter-bg: var(--color-black-400);
--icon-square-size: calc(var(--score-shape-size) * 0.88);
Expand All @@ -115,10 +116,10 @@
--plugin-icon-size: 65%;
--pwa-icon-margin: 0 6px 0 -2px;
--pwa-icon-size: var(--topbar-icon-size);
--score-container-padding: 12px;
--score-container-width: 160px;
--score-number-font-size-big: 42px;
--score-number-font-size: 34px;
--score-container-padding: 8px;
--score-container-width: 148px;
--score-number-font-size-big: 38px;
--score-number-font-size: 28px;
--score-shape-margin-left: 4px;
--score-shape-margin-right: 12px;
--score-shape-margin-top: 7px;
Expand All @@ -132,7 +133,7 @@
--scorescale-width: 18px;
--section-padding: 40px;
--topbar-bg: var(--color-black-100);
--topbar-height: 36px;
--topbar-height: 32px;
--topbar-icon-size: 24px;
--topbar-padding: 0 8px;

Expand Down Expand Up @@ -212,7 +213,6 @@
--header-padding: 16px 0 16px 0;
--plugin-icon-size: 75%;
--pwa-icon-margin: 0 7px 0 -3px;
--score-container-padding: 8px;
--score-container-width: 112px;
--score-number-font-size-big: 34px;
--score-number-font-size: 26px;
Expand All @@ -224,7 +224,7 @@
--score-title-line-height-big: 26px;
--score-title-line-height: 20px;
--section-padding: 24px;
--topbar-height: 32px;
--topbar-height: 28px;
--topbar-icon-size: 20px;
}

Expand Down Expand Up @@ -325,7 +325,6 @@
}

.lh-audit__description, .lh-audit__stackpack {
--inner-audit-left-padding: calc(var(--text-indent) + var(--lh-audit-index-width) + 2 * var(--audit-item-gap));
--inner-audit-right-padding: calc(var(--text-indent) + 2px);
padding-left: var(--inner-audit-left-padding);
padding-right: var(--inner-audit-right-padding);
Expand All @@ -337,6 +336,7 @@
font-size: var(--body-font-size);
margin-top: var(--default-padding);
margin-bottom: var(--default-padding);
margin-left: var(--inner-audit-left-padding);
/* whatever the .lh-details side margins are */
width: 100%;
}
Expand Down Expand Up @@ -471,6 +471,7 @@
}
.lh-category-header__description {
font-size: var(--body-font-size);
text-align: center;
margin: 0px auto;
max-width: 400px;
}
Expand Down Expand Up @@ -575,7 +576,7 @@
display: flex;
flex-wrap: wrap;
justify-content: space-between;
padding: 8px var(--text-indent);
padding: 10px var(--text-indent);
}

.lh-metric__details {
Expand All @@ -589,7 +590,6 @@

.lh-metrics__disclaimer {
color: var(--medium-75-gray);
text-align: right;
margin: var(--lh-section-vpadding) 0;
padding: 0 var(--text-indent);
}
Expand Down Expand Up @@ -886,6 +886,10 @@
/* When the header takes 100% width, the chevron becomes small. */
max-width: calc(100% - var(--chevron-size));
}
/* max-width makes the metric toggle not flush. metrics doesn't have a chevron so unset. */
.lh-audit-group--metrics .lh-audit-group__header {
max-width: unset;
}

.lh-audit-group__header span.lh-audit-group__title {
font-weight: bold;
Expand Down Expand Up @@ -968,11 +972,13 @@

.lh-warnings {
--item-margin: calc(var(--body-line-height) / 6);
border: 1px solid var(--color-average);
border-radius: 4px;
color: var(--color-average);
margin: var(--lh-audit-vpadding) 0;
padding: calc(var(--lh-audit-vpadding) / 2) var(--lh-audit-vpadding);
}
.lh-warnings span {
font-weight: bold;
}

.lh-warnings--toplevel {
--item-margin: calc(var(--header-line-height) / 4);
Expand Down Expand Up @@ -1158,18 +1164,18 @@
.lh-table {
--image-preview-size: 24px;
border-collapse: collapse;
/* Can't assign padding to table, so shorten the width instead. */
width: calc(100% - var(--inner-audit-left-padding));
}

.lh-table thead {
background-color: var(--lh-table-higlight-bg);
}
.lh-table thead th {
Copy link
Member

Choose a reason for hiding this comment

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

we had something in there about text alignment with headers

image

  1. getting description flush left with the title.
  2. getting URL flush left with those two.

right, @yuinchien?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hm i aligned it to the description instead

Copy link
Collaborator

Choose a reason for hiding this comment

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

@hoten the title, description, the table heading(URL), the table should all align left to the same line.

Screen Shot 2019-05-03 at 1 47 23 PM

Copy link
Collaborator

Choose a reason for hiding this comment

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

@hoten can we horizontally center the shape (triangle) with the first line of title? Thanks!
Screen Shot 2019-05-03 at 1 48 48 PM

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

font-weight: normal;
color: var(--color-black-600);
/* See text-wrapping comment on .lh-container. */
word-break: normal;
}

.lh-table tbody tr:nth-child(even) {
.lh-table tbody tr:nth-child(odd) {
background-color: var(--lh-table-higlight-bg);
}

Expand Down
4 changes: 1 addition & 3 deletions lighthouse-core/report/html/templates.html
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,6 @@
justify-content: center;
background-color: var(--color-sticky-header-bg);
border-bottom: 1px solid var(--color-black-200);
padding-top: var(--score-container-padding);
padding-bottom: 4px;
z-index: 1000;
pointer-events: none;
opacity: 0;
Expand Down Expand Up @@ -267,7 +265,7 @@
}
.lh-export__button.active + .lh-export__dropdown {
opacity: 1;
clip: rect(0, 164px, 210px, 0);
clip: rect(-1px, 164px, 210px, -3px);
}
.lh-export__dropdown {
position: absolute;
Expand Down