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: display final screenshot prominently #13123

Merged
merged 32 commits into from
Oct 21, 2021
Merged

Conversation

paulirish
Copy link
Member

@paulirish paulirish commented Sep 24, 2021

update: this PR is now blocked by #13229


Adopt the final screenshot display tweaks from latest psi mocks.

Fixes #10016. And is an alternative solution for our classic #9379 (desktop indicator) one as well.

If the final-screenshot audit is available to the renderer.. it'll do this kinda layout to the topmost category (which.. is Performance 99.9% of the time). That includes moving the scorescale.

Otherwise, the layout will be the same as it is today. This means a solo-accessibility run wont look any different.

Mock:
image

A few screenshots, as our sample reports don't capture all the various cases

image

image

image

image
(this last case is only possible if the category order were messed up, like by golang). perf category is needed since this is dependent on final-screenshot. )

@paulirish paulirish requested a review from a team as a code owner September 24, 2021 23:48
@paulirish paulirish requested review from connorjclark and removed request for a team September 24, 2021 23:48
@google-cla google-cla bot added the cla: yes label Sep 24, 2021
Copy link
Collaborator

@connorjclark connorjclark left a comment

Choose a reason for hiding this comment

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

needs mobile love:

image

could either remove in mobile view or change grid styles

report/renderer/category-renderer.js Outdated Show resolved Hide resolved
report/renderer/report-renderer.js Outdated Show resolved Hide resolved
report/renderer/report-renderer.js Outdated Show resolved Hide resolved
@@ -255,6 +256,8 @@ export class ReportRenderer {
));
}

categoryRenderer.injectFinalScreenshot(categories, report.audits, scoreScale);
Copy link
Collaborator

Choose a reason for hiding this comment

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

scoreScale is always set... did you mean to set it only if scoreHeader is true?

Copy link
Member Author

Choose a reason for hiding this comment

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

in the firstElementChild case, that was sometimes undefined (according to TSC), thus the if statements. but now with your better "always use a wrapper div" solution, we don't have that problem.

we still want to move the scorescale, but only if we have a final-screenshot. so.. that's why its appended first in the scoreheader, but then moved later on.

report/renderer/category-renderer.js Outdated Show resolved Hide resolved
report/renderer/category-renderer.js Outdated Show resolved Hide resolved
@@ -1066,6 +1065,10 @@
margin-top: var(--audit-group-padding-vertical);
}

.lh-audit-group--metrics > .lh-audit-group__header {
visibility: hidden; /* Superfluous, because obviously perf metrics */
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't understand this... if this is not needed, why have?

Copy link
Member Author

Choose a reason for hiding this comment

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

The title of "Metrics" is removed in the mock. It's one of the items in the FR Design Notes doc list.

This DOM element is added when when perf renderer calls the generic renderAuditGroup. so.. trying to omit the element would be a bit more awkward.

also its vis hidden (and not display:none) because spacing-wise it's still needed thanks to the PILL. stupid pill.

Copy link
Collaborator

Choose a reason for hiding this comment

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

gotcha. Could you add some version of that as a comment, the current comment is too opaque :)

report/assets/styles.css Outdated Show resolved Hide resolved
report/renderer/category-renderer.js Outdated Show resolved Hide resolved
@connorjclark
Copy link
Collaborator

Did you mean to get rid of the border around the score scale?

image

->

image

also text looks different. perhaps a classname was lost in the transition?

@paulirish
Copy link
Member Author

Did you mean to get rid of the border around the score scale?

yup. i just followed the mock for that.

@paulirish
Copy link
Member Author

paulirish commented Sep 25, 2021

nice review thx for the close look. yeah i didnt look at mobile/narrow viewport much and am sure it can use some love.

@connorjclark
Copy link
Collaborator

  • would be cool to show the fullpage screenshot on click
  • considered just removing the score scale ... or replacing numbers with "Failing/NI/Good" ? no consensus

* @param {Element} scoreScaleEl
*/
injectFinalScreenshot(categoriesEl, audits, scoreScaleEl) {
// TODO: Use full-page-screenshot instead as that's always gathered, regardless of category filter
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you file an issue and remove this todo?

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.

Incorporate final screenshot in report
3 participants