Changeset 247168 in webkit


Ignore:
Timestamp:
Jul 5, 2019 12:19:28 PM (5 years ago)
Author:
Dewei Zhu
Message:

Test freshness page should expose revision information for latest build on tooltip.
https://bugs.webkit.org/show_bug.cgi?id=199483

Reviewed by Ryosuke Niwa.

Added latest build revision information on test freshness page tooltip.

  • public/v3/pages/test-freshness-page.js: Add build revision information on tooltip.

(TestFreshnessPage.prototype.didConstructShadowTree):
(TestFreshnessPage.prototype._fetchTestResults):
(TestFreshnessPage.prototype.render):
(TestFreshnessPage.prototype._renderTooltip):
(TestFreshnessPage.cssTemplate):

Location:
trunk/Websites/perf.webkit.org
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Websites/perf.webkit.org/ChangeLog

    r246847 r247168  
     12019-07-03  Dewei Zhu  <dewei_zhu@apple.com>
     2
     3        Test freshness page should expose revision information for latest build on tooltip.
     4        https://bugs.webkit.org/show_bug.cgi?id=199483
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Added latest build revision information on test freshness page tooltip.
     9
     10        * public/v3/pages/test-freshness-page.js: Add build revision information on tooltip.
     11        (TestFreshnessPage.prototype.didConstructShadowTree):
     12        (TestFreshnessPage.prototype._fetchTestResults):
     13        (TestFreshnessPage.prototype.render):
     14        (TestFreshnessPage.prototype._renderTooltip):
     15        (TestFreshnessPage.cssTemplate):
     16
    1172019-06-26  Dewei Zhu  <dewei_zhu@apple.com>
    218
  • trunk/Websites/perf.webkit.org/public/v3/pages/test-freshness-page.js

    r243123 r247168  
    2020    didConstructShadowTree()
    2121    {
    22         const tooltipContainer = this.content('tooltip-container');
    23         tooltipContainer.addEventListener('mouseenter', () => {
     22        const tooltipTable = this.content('tooltip-table');
     23        tooltipTable.addEventListener('mouseenter', () => {
    2424            this._hoveringTooltip = true;
    2525            this.enqueueToRender();
    2626        });
    27         tooltipContainer.addEventListener('mouseleave', () => {
     27        tooltipTable.addEventListener('mouseleave', () => {
    2828            this._hoveringTooltip = false;
    2929            this.enqueueToRender();
     
    9090
    9191                    let timeForLatestBuild = startTime;
    92                     let lastBuildLink = null;
     92                    let lastBuild = null;
    9393                    let builder = null;
     94                    let commitSetOfLastPoint = null;
    9495                    const lastPoint = currentTimeSeries.lastPoint();
    9596                    if (lastPoint) {
     
    102103                            if (build.buildTime().getTime() >= timeForLatestBuild) {
    103104                                timeForLatestBuild = build.buildTime().getTime();
    104                                 lastBuildLink = build.url();
     105                                lastBuild = build;
    105106                                builder = build.builder();
    106107                            }
    107108                        }
     109                        commitSetOfLastPoint = lastPoint.commitSet();
    108110                    }
    109111
    110112                    lastDataPointByMetric.set(metric, {time: timeForLatestBuild, hasCurrentDataPoint: !!lastPoint,
    111                         lastBuildLink, builder});
     113                        lastBuild, builder, commitSetOfLastPoint});
    112114                    this.enqueueToRender();
    113115                });
     
    123125
    124126        let buildSummaryForCurrentlyHighlightedIndicator = null;
    125         let buildLinkForCurrentlyHighlightedIndicator = null;
     127        let buildForCurrentlyHighlightedIndicator = null;
     128        let commitSetForCurrentHighlightedIndicator = null;
    126129        const builderForCurrentlyHighlightedIndicator = this._currentlyHighlightedIndicator ? this._builderByIndicator.get(this._currentlyHighlightedIndicator) : null;
    127130        for (const [platform, lastDataPointByMetric] of this._lastDataPointByConfiguration.entries()) {
     
    137140                if (this._currentlyHighlightedIndicator && this._currentlyHighlightedIndicator === indicator) {
    138141                    buildSummaryForCurrentlyHighlightedIndicator = summary;
    139                     buildLinkForCurrentlyHighlightedIndicator = lastDataPoint.lastBuildLink;
     142                    buildForCurrentlyHighlightedIndicator = lastDataPoint.lastBuild;
     143                    commitSetForCurrentHighlightedIndicator = lastDataPoint.commitSetOfLastPoint;
    140144                }
    141145                this._builderByIndicator.set(indicator, lastDataPoint.builder);
     
    143147            }
    144148        }
    145         this._renderTooltipLazily.evaluate(this._currentlyHighlightedIndicator, this._hoveringTooltip, buildSummaryForCurrentlyHighlightedIndicator, buildLinkForCurrentlyHighlightedIndicator);
    146     }
    147 
    148     _renderTooltip(indicator, hoveringTooltip, buildSummary, buildLink)
     149        this._renderTooltipLazily.evaluate(this._currentlyHighlightedIndicator, this._hoveringTooltip, buildSummaryForCurrentlyHighlightedIndicator, buildForCurrentlyHighlightedIndicator, commitSetForCurrentHighlightedIndicator);
     150    }
     151
     152    _renderTooltip(indicator, hoveringTooltip, buildSummary, build, commitSet)
    149153    {
    150154        if (!indicator || !buildSummary) {
    151             this.content('tooltip-container').style.display = hoveringTooltip ? null : 'none';
     155            this.content('tooltip-table').style.display = hoveringTooltip ? null : 'none';
    152156            return;
    153157        }
    154158        const element = ComponentBase.createElement;
     159        const link = ComponentBase.createLink;
    155160
    156161        const rect = indicator.element().getBoundingClientRect();
    157         const tooltipContainer = this.content('tooltip-container');
    158         tooltipContainer.style.display = null;
    159 
    160         const tooltipContainerComputedStyle = getComputedStyle(tooltipContainer);
     162        const tooltipTable = this.content('tooltip-table');
     163        tooltipTable.style.display = null;
     164
     165        const tooltipContainerComputedStyle = getComputedStyle(tooltipTable);
    161166        const containerMarginTop = parseFloat(tooltipContainerComputedStyle.paddingTop);
    162167        const containerMarginLeft = parseFloat(tooltipContainerComputedStyle.marginLeft);
    163168
    164         tooltipContainer.style.position = 'absolute';
    165         tooltipContainer.style.top = rect.top - (tooltipContainer.offsetHeight + containerMarginTop)  + 'px';
    166         tooltipContainer.style.left = rect.left + rect.width / 2 - tooltipContainer.offsetWidth / 2 + containerMarginLeft + 'px';
    167 
    168         this.renderReplace(tooltipContainer, [element('p', buildSummary), buildLink ? element('a', {href: buildLink}, 'Latest Build') : []]);
     169        tooltipTable.style.position = 'absolute';
     170        tooltipTable.style.top = rect.top - (tooltipTable.offsetHeight + containerMarginTop)  + 'px';
     171        tooltipTable.style.left = rect.left + rect.width / 2 - tooltipTable.offsetWidth / 2 + containerMarginLeft + 'px';
     172
     173        let tableContent = [element('tr', element('td', {colspan: 2}, buildSummary))];
     174        if (commitSet.repositories().length)
     175            tableContent.push(element('tr', element('th', {colspan: 2}, 'Latest build information')));
     176
     177        tableContent.push(Repository.sortByNamePreferringOnesWithURL(commitSet.repositories()).map((repository) => {
     178            const commit = commitSet.commitForRepository(repository);
     179            return element('tr', [
     180                element('td', repository.name()),
     181                element('td', commit.url() ? link(commit.label(), commit.label(), commit.url(), true) : commit.label())
     182            ]);
     183        }));
     184
     185        if (build) {
     186            const url = build.url();
     187            const buildNumber = build.buildNumber();
     188            tableContent.push(element('tr', [
     189                element('td', 'Build'),
     190                element('td', {colspan: 2}, [
     191                    url ? link(buildNumber, build.label(), url, true) : buildNumber
     192                ]),
     193            ]));
     194        }
     195
     196        this.renderReplace(tooltipTable,  tableContent);
    169197    }
    170198
     
    218246    static htmlTemplate()
    219247    {
    220         return `<section class="page-with-heading"><div id="tooltip-container"></div><table id="test-health"></table></section>`;
     248        return `<section class="page-with-heading"><table id="tooltip-table"></table><table id="test-health"></table></section>`;
    221249    }
    222250
     
    309337                border-top: calc(1.6rem - 1px) solid transparent;
    310338            }
    311             #tooltip-container {
     339            #tooltip-table {
    312340                width: 22rem;
    313                 height: 2rem;
    314341                background-color: #34495E;
    315342                opacity: 0.9;
     
    319346                z-index: 1;
    320347                text-align: center;
    321             }
    322             #tooltip-container::after {
     348                display: inline-table;
     349                color: white;
     350            }
     351            #tooltip-table td {
     352                overflow: hidden;
     353                max-width: 22rem;
     354                text-overflow: ellipsis;
     355            }
     356            #tooltip-table::after {
    323357                content: " ";
    324358                position: absolute;
     
    330364                border-color: #34495E transparent transparent transparent;
    331365            }
    332             #tooltip-container p {
    333                 color: white;
    334                 margin: 0;
    335             }
    336             #tooltip-container a {
     366            #tooltip-table a {
    337367                color: #B03A2E;
    338368                font-weight: bold;
Note: See TracChangeset for help on using the changeset viewer.