@@ -5,8 +5,9 @@ import {ArtifactDescription} from "../../types";
55import {percentClass } from " ../../shared" ;
66import {CompileBenchmarkMap , CompileTestCase } from " ../common" ;
77import {computed } from " vue" ;
8- import {useExpandedStore } from " ./expansion " ;
8+ import {testCaseKey } from " ../common " ;
99import BenchmarkDetail from " ./benchmark-detail.vue" ;
10+ import Accordion from " ../../../../components/accordion.vue" ;
1011
1112const props = defineProps <{
1213 id: string ;
@@ -40,7 +41,6 @@ const unit = computed(() => {
4041 return null ;
4142 }
4243});
43- const {toggleExpanded, isExpanded} = useExpandedStore ();
4444 </script >
4545
4646<template >
@@ -86,72 +86,68 @@ const {toggleExpanded, isExpanded} = useExpandedStore();
8686 </thead >
8787 <tbody >
8888 <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 >
119104 </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 >
130115 </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 >
155151 </template >
156152 </tbody >
157153 </table >
@@ -171,10 +167,8 @@ const {toggleExpanded, isExpanded} = useExpandedStore();
171167 }
172168}
173169
174- .benches tbody ::before {
175- content : " " ;
176- display : block ;
177- height : 10px ;
170+ .benches tbody {
171+ padding-top : 10px ;
178172}
179173
180174.benches tbody :first-child th {
@@ -190,22 +184,10 @@ const {toggleExpanded, isExpanded} = useExpandedStore();
190184 th {
191185 text-align : center ;
192186
193- & .toggle-arrow {
194- padding-right : 5px ;
195- }
196187 & .narrow {
197188 max-width : 100px ;
198189 }
199190 }
200-
201- .toggle {
202- cursor : pointer ;
203-
204- & :hover ,
205- & .toggled {
206- background-color : #d6d3d35c ;
207- }
208- }
209191}
210192
211193.benches td {
0 commit comments