-
Notifications
You must be signed in to change notification settings - Fork 9.6k
devtools: move topbar out of scrollable container #9077
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
Changes from 52 commits
41aa187
000f841
c0bf21d
1e040cc
a6e722e
7129ae1
ca0afd1
4a6a796
fe61b86
720dbb4
0153c0e
009c7d2
0ee54c8
cc763f8
7ace084
6650b66
8063f18
63c9638
739b20a
4b86fb4
bdbf379
181a5ed
2031b5e
b2016ea
f16f78f
e3a4ba0
453e58f
0dfc3b2
06c9cb4
ee239c6
19215e9
6059968
9dd16c1
82bb8e6
ca7b9a9
aec1ac3
3d3a034
0c1b09e
656e941
8ded84e
6dabf64
df79fcb
7c9fe63
427baf5
d383120
b6879b1
5dab607
26f2864
067784b
0345eb7
9b556cd
c10ea6e
f66136f
c08ce10
bee3592
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -184,22 +184,6 @@ class ReportRenderer { | |
| * @return {DocumentFragment} | ||
| */ | ||
| _renderReport(report) { | ||
| const headerContainer = this._dom.createElement('div'); | ||
| headerContainer.appendChild(this._renderReportHeader()); | ||
|
|
||
| const container = this._dom.createElement('div', 'lh-container'); | ||
| const reportSection = container.appendChild(this._dom.createElement('div', 'lh-report')); | ||
|
|
||
| reportSection.appendChild(this._renderReportWarnings(report)); | ||
|
|
||
| let scoreHeader; | ||
| const isSoloCategory = Object.keys(report.categories).length === 1; | ||
| if (!isSoloCategory) { | ||
| scoreHeader = this._dom.createElement('div', 'lh-scores-header'); | ||
| } else { | ||
| headerContainer.classList.add('lh-header--solo-category'); | ||
| } | ||
|
|
||
| const detailsRenderer = new DetailsRenderer(this._dom); | ||
| const categoryRenderer = new CategoryRenderer(this._dom, detailsRenderer); | ||
| categoryRenderer.setTemplateContext(this._templateContext); | ||
|
|
@@ -213,19 +197,20 @@ class ReportRenderer { | |
| renderer.setTemplateContext(this._templateContext); | ||
| }); | ||
|
|
||
| const categories = reportSection.appendChild(this._dom.createElement('div', 'lh-categories')); | ||
| const headerContainer = this._dom.createElement('div'); | ||
| headerContainer.appendChild(this._renderReportHeader()); | ||
|
|
||
| for (const category of Object.values(report.categories)) { | ||
| const renderer = specificCategoryRenderers[category.id] || categoryRenderer; | ||
| // .lh-category-wrapper is full-width and provides horizontal rules between categories. | ||
| // .lh-category within has the max-width: var(--report-width); | ||
| const wrapper = renderer.dom.createChildOf(categories, 'div', 'lh-category-wrapper'); | ||
| wrapper.appendChild(renderer.render(category, report.categoryGroups)); | ||
| } | ||
| const container = this._dom.createElement('div', 'lh-container'); | ||
| const reportSection = this._dom.createElement('div', 'lh-report'); | ||
| reportSection.appendChild(this._renderReportWarnings(report)); | ||
|
|
||
| const reportFragment = this._dom.createFragment(); | ||
| const topbarDocumentFragment = this._renderReportTopbar(report); | ||
| reportFragment.appendChild(topbarDocumentFragment); | ||
| let scoreHeader; | ||
patrickhulce marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| const isSoloCategory = Object.keys(report.categories).length === 1; | ||
| if (!isSoloCategory) { | ||
| scoreHeader = this._dom.createElement('div', 'lh-scores-header'); | ||
| } else { | ||
| headerContainer.classList.add('lh-header--solo-category'); | ||
| } | ||
|
|
||
| if (scoreHeader) { | ||
| const scoreScale = this._dom.cloneTemplate('#tmpl-lh-scorescale', this._templateContext); | ||
|
|
@@ -238,11 +223,25 @@ class ReportRenderer { | |
| const stickyHeader = this._dom.createElement('div', 'lh-sticky-header'); | ||
| stickyHeader.append( | ||
| ...this._renderScoreGauges(report, categoryRenderer, specificCategoryRenderers)); | ||
| reportFragment.appendChild(stickyHeader); | ||
| container.appendChild(stickyHeader); | ||
|
||
| } | ||
|
|
||
| reportFragment.appendChild(headerContainer); | ||
| const categories = reportSection.appendChild(this._dom.createElement('div', 'lh-categories')); | ||
patrickhulce marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| for (const category of Object.values(report.categories)) { | ||
| const renderer = specificCategoryRenderers[category.id] || categoryRenderer; | ||
| // .lh-category-wrapper is full-width and provides horizontal rules between categories. | ||
| // .lh-category within has the max-width: var(--report-width); | ||
| const wrapper = renderer.dom.createChildOf(categories, 'div', 'lh-category-wrapper'); | ||
| wrapper.appendChild(renderer.render(category, report.categoryGroups)); | ||
| } | ||
|
|
||
| const reportFragment = this._dom.createFragment(); | ||
| const topbarDocumentFragment = this._renderReportTopbar(report); | ||
|
|
||
| reportFragment.appendChild(topbarDocumentFragment); | ||
| reportFragment.appendChild(container); | ||
| container.appendChild(headerContainer); | ||
|
||
| container.appendChild(reportSection); | ||
| reportSection.appendChild(this._renderReportFooter(report)); | ||
|
|
||
| return reportFragment; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -269,7 +269,7 @@ | |
| --header-padding: 16px 0 16px 0; | ||
| --plugin-icon-size: 75%; | ||
| --pwa-icon-margin: 0 7px 0 -3px; | ||
| --score-container-width: 92px; | ||
| --score-container-width: 97px; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what's the effect here/why necessary?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the text for the gauge titles was wrapping for Perf/A11y (in DevTools only) b/c the scroll bar steals some width. |
||
| --score-number-font-size-big: 34px; | ||
| --score-number-font-size: 26px; | ||
| --score-shape-margin-left: 2px; | ||
|
|
@@ -285,6 +285,18 @@ | |
| --lh-section-vpadding: 8px; | ||
| } | ||
|
|
||
| .lh-devtools.lh-root { | ||
| height: 100%; | ||
| } | ||
| .lh-devtools .lh-container { | ||
| overflow-y: scroll; | ||
| height: calc(100% - var(--topbar-height)); | ||
| } | ||
| .lh-devtools .lh-sticky-header { | ||
| /* Is normally the height of the topbar. */ | ||
connorjclark marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| top: 0; | ||
| } | ||
|
|
||
| @keyframes fadeIn { | ||
| 0% { opacity: 0;} | ||
| 100% { opacity: 0.6;} | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.