Skip to content

Commit b618128

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

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

site/static/compare.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,9 @@ <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+
></test-cases-table>
343345
<hr />
344346
<test-cases-table
345347
title="Secondary"
@@ -349,7 +351,9 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
349351
:commit-b="data.b"
350352
:stat="stat"
351353
:before="before"
352-
:after="after"></test-cases-table>
354+
:after="after"
355+
id="secondary-benchmarks"
356+
></test-cases-table>
353357
<br />
354358
<hr />
355359
<div>

site/static/compare/script.js

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,17 @@ 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+
},
339349
methods: {
340350
detailedQueryLink(commit, testCase) {
341351
return `/detailed-query.html?commit=${commit.commit}&benchmark=${testCase.benchmark + "-" + testCase.profile}&scenario=${testCase.scenario}`;
@@ -363,8 +373,16 @@ app.component('test-cases-table', {
363373
},
364374
},
365375
template: `
366-
<div class="bench-table">
367-
<div class="category-title">{{ title }} benchmarks</div>
376+
<div class="bench-table" :id="id">
377+
<div class="category-title">
378+
{{ title }} benchmarks
379+
<span v-if="title == 'Primary'" title="To secondary benchmarks">
380+
<a href="#secondary-benchmarks">⮯</a>
381+
</span>
382+
<span v-else title="To primary benchmarks">
383+
<a href="#primary-benchmarks">⮭</a>
384+
</span>
385+
</div>
368386
<div v-if="cases.length === 0" style="text-align: center;">
369387
No results
370388
</div>

0 commit comments

Comments
 (0)