@@ -5,8 +5,9 @@ import {ArtifactDescription} from "../../types";
5
5
import {percentClass } from " ../../shared" ;
6
6
import {CompileBenchmarkMap , CompileTestCase } from " ../common" ;
7
7
import {computed } from " vue" ;
8
- import {useExpandedStore } from " ./expansion " ;
8
+ import {testCaseKey } from " ../common " ;
9
9
import BenchmarkDetail from " ./benchmark-detail.vue" ;
10
+ import Accordion from " ../../../../components/accordion.vue" ;
10
11
11
12
const props = defineProps <{
12
13
id: string ;
@@ -40,7 +41,6 @@ const unit = computed(() => {
40
41
return null ;
41
42
}
42
43
});
43
- const {toggleExpanded, isExpanded} = useExpandedStore ();
44
44
</script >
45
45
46
46
<template >
@@ -86,72 +86,68 @@ const {toggleExpanded, isExpanded} = useExpandedStore();
86
86
</thead >
87
87
<tbody >
88
88
<template v-for =" comparison in comparisons " >
89
- <tr
90
- @click =" toggleExpanded(comparison.testCase)"
91
- :class =" {toggle: true, toggled: isExpanded(comparison.testCase)}"
92
- >
93
- <td class =" toggle-arrow" >
94
- {{ isExpanded(comparison.testCase) ? "▼" : "▶" }}
95
- </td >
96
- <td >
97
- {{ comparison.testCase.benchmark }}
98
- </td >
99
- <td >
100
- {{ comparison.testCase.profile }}
101
- </td >
102
- <td >{{ comparison.testCase.scenario }}</td >
103
- <td >{{ comparison.testCase.backend }}</td >
104
- <td >
105
- <div class =" numeric-aligned" >
106
- <span v-bind:class =" percentClass(comparison.percent)" >
107
- {{ comparison.percent.toFixed(2) }}%
108
- </span >
109
- </div >
110
- </td >
111
- <td class =" narrow" >
112
- <div class =" numeric-aligned" >
113
- <div >
114
- {{
115
- comparison.significanceThreshold
116
- ? comparison.significanceThreshold.toFixed(2) + "%"
117
- : "-"
118
- }}
89
+ <Accordion :id =" testCaseKey(comparison.testCase)" >
90
+ <template v-slot :default >
91
+ <td >
92
+ {{ comparison.testCase.benchmark }}
93
+ </td >
94
+ <td >
95
+ {{ comparison.testCase.profile }}
96
+ </td >
97
+ <td >{{ comparison.testCase.scenario }}</td >
98
+ <td >{{ comparison.testCase.backend }}</td >
99
+ <td >
100
+ <div class =" numeric-aligned" >
101
+ <span v-bind:class =" percentClass(comparison.percent)" >
102
+ {{ comparison.percent.toFixed(2) }}%
103
+ </span >
119
104
</div >
120
- </div >
121
- </ td >
122
- < td class =" narrow " >
123
- <div class = " numeric-aligned " >
124
- < div >
125
- {{
126
- comparison.significanceFactor
127
- ? comparison.significanceFactor.toFixed(2) + "x "
128
- : "-"
129
- }}
105
+ </td >
106
+ < td class = " narrow " >
107
+ < div class =" numeric-aligned " >
108
+ <div >
109
+ {{
110
+ comparison.significanceThreshold
111
+ ? comparison.significanceThreshold.toFixed(2) + "%"
112
+ : "- "
113
+ }}
114
+ </ div >
130
115
</div >
131
- </div >
132
- </td >
133
- <td v-if =" showRawData" class =" numeric" >
134
- <abbr :title =" comparison.datumA.toString()" >
135
- {{ prettifyRawNumber(comparison.datumA) }}{{ unit }}
136
- </abbr >
137
- </td >
138
- <td v-if =" showRawData" class =" numeric" >
139
- <abbr :title =" comparison.datumB.toString()" >
140
- {{ prettifyRawNumber(comparison.datumB) }}{{ unit }}
141
- </abbr >
142
- </td >
143
- </tr >
144
- <tr v-if =" isExpanded(comparison.testCase)" >
145
- <td :colspan =" columnCount" >
146
- <BenchmarkDetail
147
- :test-case =" comparison.testCase"
148
- :base-artifact =" commitA"
149
- :artifact =" commitB"
150
- :metric =" stat"
151
- :benchmark-map =" benchmarkMap"
152
- />
153
- </td >
154
- </tr >
116
+ </td >
117
+ <td class =" narrow" >
118
+ <div class =" numeric-aligned" >
119
+ <div >
120
+ {{
121
+ comparison.significanceFactor
122
+ ? comparison.significanceFactor.toFixed(2) + "x"
123
+ : "-"
124
+ }}
125
+ </div >
126
+ </div >
127
+ </td >
128
+ <td v-if =" showRawData" class =" numeric" >
129
+ <abbr :title =" comparison.datumA.toString()" >
130
+ {{ prettifyRawNumber(comparison.datumA) }}{{ unit }}
131
+ </abbr >
132
+ </td >
133
+ <td v-if =" showRawData" class =" numeric" >
134
+ <abbr :title =" comparison.datumB.toString()" >
135
+ {{ prettifyRawNumber(comparison.datumB) }}{{ unit }}
136
+ </abbr >
137
+ </td >
138
+ </template >
139
+ <template v-slot :collapsed >
140
+ <td :colspan =" columnCount" >
141
+ <BenchmarkDetail
142
+ :test-case =" comparison.testCase"
143
+ :base-artifact =" commitA"
144
+ :artifact =" commitB"
145
+ :metric =" stat"
146
+ :benchmark-map =" benchmarkMap"
147
+ />
148
+ </td >
149
+ </template >
150
+ </Accordion >
155
151
</template >
156
152
</tbody >
157
153
</table >
@@ -171,10 +167,8 @@ const {toggleExpanded, isExpanded} = useExpandedStore();
171
167
}
172
168
}
173
169
174
- .benches tbody ::before {
175
- content : " " ;
176
- display : block ;
177
- height : 10px ;
170
+ .benches tbody {
171
+ padding-top : 10px ;
178
172
}
179
173
180
174
.benches tbody :first-child th {
@@ -190,22 +184,10 @@ const {toggleExpanded, isExpanded} = useExpandedStore();
190
184
th {
191
185
text-align : center ;
192
186
193
- & .toggle-arrow {
194
- padding-right : 5px ;
195
- }
196
187
& .narrow {
197
188
max-width : 100px ;
198
189
}
199
190
}
200
-
201
- .toggle {
202
- cursor : pointer ;
203
-
204
- & :hover ,
205
- & .toggled {
206
- background-color : #d6d3d35c ;
207
- }
208
- }
209
191
}
210
192
211
193
.benches td {
0 commit comments