Skip to content

Commit afcaaf6

Browse files
committed
add accordion to runtime details
1 parent dc9830d commit afcaaf6

File tree

3 files changed

+57
-45
lines changed

3 files changed

+57
-45
lines changed

site/frontend/src/pages/compare/compile/table/comparisons-table.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,10 @@ const unit = computed(() => {
167167
}
168168
}
169169
170-
.benches tbody {
171-
padding-top: 10px;
170+
.benches tbody::before {
171+
content: "";
172+
display: block;
173+
height: 10px;
172174
}
173175
174176
.benches tbody:first-child th {

site/frontend/src/pages/compare/runtime/common.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,7 @@ export function computeRuntimeComparisonsWithNonRelevant(
5353

5454
return filteredComparisons;
5555
}
56+
57+
export function testCaseKey(testCase: RuntimeTestCase): string {
58+
return `${testCase.benchmark}`;
59+
}

site/frontend/src/pages/compare/runtime/comparisons-table.vue

Lines changed: 49 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import Tooltip from "../tooltip.vue";
44
import {percentClass} from "../shared";
55
import {RuntimeTestCase} from "./common";
66
import {computed} from "vue";
7+
import Accordion from "../../../components/accordion.vue";
8+
import {testCaseKey} from "./common";
79
810
const props = defineProps<{
911
comparisons: TestCaseComparison<RuntimeTestCase>[];
@@ -66,52 +68,55 @@ const unit = computed(() => {
6668
</thead>
6769
<tbody>
6870
<template v-for="comparison in comparisons">
69-
<tr>
70-
<td>
71-
{{ comparison.testCase.benchmark }}
72-
</td>
73-
<td>
74-
<div class="numeric-aligned">
75-
<div>
76-
<span v-bind:class="percentClass(comparison.percent)">
77-
{{ comparison.percent.toFixed(2) }}%
78-
</span>
71+
<Accordion :id="testCaseKey(comparison.testCase)">
72+
<template v-slot:default>
73+
<td>
74+
{{ comparison.testCase.benchmark }}
75+
</td>
76+
<td>
77+
<div class="numeric-aligned">
78+
<div>
79+
<span v-bind:class="percentClass(comparison.percent)">
80+
{{ comparison.percent.toFixed(2) }}%
81+
</span>
82+
</div>
7983
</div>
80-
</div>
81-
</td>
82-
<td>
83-
<div class="numeric-aligned">
84-
<div>
85-
{{
86-
comparison.significanceThreshold
87-
? comparison.significanceThreshold.toFixed(2) + "%"
88-
: "-"
89-
}}
84+
</td>
85+
<td>
86+
<div class="numeric-aligned">
87+
<div>
88+
{{
89+
comparison.significanceThreshold
90+
? comparison.significanceThreshold.toFixed(2) + "%"
91+
: "-"
92+
}}
93+
</div>
9094
</div>
91-
</div>
92-
</td>
93-
<td>
94-
<div class="numeric-aligned">
95-
<div>
96-
{{
97-
comparison.significanceFactor
98-
? comparison.significanceFactor.toFixed(2) + "x"
99-
: "-"
100-
}}
95+
</td>
96+
<td>
97+
<div class="numeric-aligned">
98+
<div>
99+
{{
100+
comparison.significanceFactor
101+
? comparison.significanceFactor.toFixed(2) + "x"
102+
: "-"
103+
}}
104+
</div>
101105
</div>
102-
</div>
103-
</td>
104-
<td v-if="showRawData" class="numeric">
105-
<abbr :title="comparison.datumA.toString()"
106-
>{{ prettifyRawNumber(comparison.datumA) }}{{ unit }}</abbr
107-
>
108-
</td>
109-
<td v-if="showRawData" class="numeric">
110-
<abbr :title="comparison.datumB.toString()"
111-
>{{ prettifyRawNumber(comparison.datumB) }}{{ unit }}</abbr
112-
>
113-
</td>
114-
</tr>
106+
</td>
107+
<td v-if="showRawData" class="numeric">
108+
<abbr :title="comparison.datumA.toString()"
109+
>{{ prettifyRawNumber(comparison.datumA) }}{{ unit }}</abbr
110+
>
111+
</td>
112+
<td v-if="showRawData" class="numeric">
113+
<abbr :title="comparison.datumB.toString()"
114+
>{{ prettifyRawNumber(comparison.datumB) }}{{ unit }}</abbr
115+
>
116+
</td>
117+
</template>
118+
<template v-slot:collapsed> </template>
119+
</Accordion>
115120
</template>
116121
</tbody>
117122
</table>
@@ -122,6 +127,7 @@ const unit = computed(() => {
122127
.benches {
123128
font-size: medium;
124129
table-layout: fixed;
130+
border-collapse: collapse;
125131
126132
td,
127133
th {

0 commit comments

Comments
 (0)