Skip to content

Commit 87e1255

Browse files
committed
Add buttons to move between categories quickly to compare page
1 parent 5c0b0a3 commit 87e1255

File tree

2 files changed

+33
-5
lines changed

2 files changed

+33
-5
lines changed

site/static/compare.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,11 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
339339
:commit-b="data.b"
340340
:stat="stat"
341341
:before="before"
342-
:after="after"></test-cases-table>
342+
:after="after"
343+
id="primary-benchmarks"
344+
section-link="secondary"
345+
:section-link-up="false"
346+
></test-cases-table>
343347
<hr />
344348
<test-cases-table
345349
title="Secondary"
@@ -349,7 +353,11 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
349353
:commit-b="data.b"
350354
:stat="stat"
351355
:before="before"
352-
:after="after"></test-cases-table>
356+
:after="after"
357+
id="secondary-benchmarks"
358+
section-link="primary"
359+
:section-link-up="true"
360+
></test-cases-table>
353361
<br />
354362
<hr />
355363
<div>

site/static/compare/script.js

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,19 @@ const app = Vue.createApp({
335335
});
336336

337337
app.component('test-cases-table', {
338-
props: ['cases', 'showRawData', 'commitA', 'commitB', 'before', 'after', 'title', 'stat'],
338+
props: {
339+
cases: Array,
340+
showRawData: Boolean,
341+
commitA: Object,
342+
commitB: Object,
343+
before: Date,
344+
after: Date,
345+
title: String,
346+
stat: String,
347+
id: String,
348+
sectionLink: String,
349+
sectionLinkUp: Boolean
350+
},
339351
methods: {
340352
detailedQueryLink(commit, testCase) {
341353
return `/detailed-query.html?commit=${commit.commit}&benchmark=${testCase.benchmark + "-" + testCase.profile}&scenario=${testCase.scenario}`;
@@ -363,8 +375,16 @@ app.component('test-cases-table', {
363375
},
364376
},
365377
template: `
366-
<div class="bench-table">
367-
<div class="category-title">{{ title }} benchmarks</div>
378+
<div class="bench-table" :id="id">
379+
<div class="category-title">
380+
{{ title }} benchmarks
381+
<span :title="'To ' + sectionLink + ' benchmarks'">
382+
<a :href="'#' + sectionLink + '-benchmarks'">
383+
<template v-if="sectionLinkUp">⮭</template>
384+
<template v-else>⮯</template>
385+
</a>
386+
</span>
387+
</div>
368388
<div v-if="cases.length === 0" style="text-align: center;">
369389
No results
370390
</div>

0 commit comments

Comments
 (0)