Skip to content

Commit 2d6f6d0

Browse files
committed
Better tables.
1 parent 82a475f commit 2d6f6d0

2 files changed

Lines changed: 297 additions & 97 deletions

File tree

src/components/app/BenchmarkCompareViewer.css

Lines changed: 77 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
.benchmarkCompareViewer {
2-
width: 95%;
3-
max-width: 1400px;
2+
flex: 1;
43
box-sizing: border-box;
4+
width: 100%;
5+
min-height: 100%;
56
padding: 2em 3em;
6-
border: 1px solid var(--home-border-color);
7-
border-radius: 3px;
8-
margin: auto;
97
background: var(--base-background-color);
10-
box-shadow: 0 5px 25px var(--home-shadow-color);
8+
}
9+
10+
.benchmarkResults {
11+
font-size: 14px;
1112
}
1213

1314
.benchmarkTitle {
@@ -94,10 +95,18 @@
9495
margin-bottom: 1em;
9596
border-collapse: collapse;
9697
font-size: 0.9em;
98+
99+
/* Fixed layout so the numeric column widths are honored exactly. With
100+
* the same numeric widths in both the outer score table and the inner
101+
* subtest tables, and zero right-padding on the expansion row, the
102+
* numeric columns line up vertically across both tables. The first
103+
* column (label / bucket name) flexes to fill the remaining space. */
104+
table-layout: fixed;
97105
}
98106

99107
.benchmarkTable th,
100108
.benchmarkTable td {
109+
box-sizing: border-box;
101110
padding: 4px 8px;
102111
border-bottom: 1px solid var(--grey-20);
103112
text-align: left;
@@ -112,18 +121,18 @@
112121
font-weight: bold;
113122
}
114123

115-
.benchmarkTable--buckets td {
116-
max-width: 0;
117-
}
118-
119124
.benchmarkCell--number {
120125
font-variant-numeric: tabular-nums;
121126
text-align: right;
122127
}
123128

124-
.benchmarkCell--bucketName {
129+
.benchmarkCell--colFixed {
130+
width: 9rem;
131+
}
132+
133+
.benchmarkCell--bucketName,
134+
.benchmarkCell--scoreLabel {
125135
overflow: hidden;
126-
max-width: 400px;
127136
text-overflow: ellipsis;
128137
}
129138

@@ -136,26 +145,74 @@
136145
padding-left: 1.5em;
137146
}
138147

139-
/* Color coding — high confidence: colored background + bold */
148+
/* Expandable subtest rows in the score table */
149+
150+
.benchmarkRow--suite-expandable {
151+
cursor: pointer;
152+
}
153+
154+
.benchmarkRow--suite-expandable:hover {
155+
background: var(--grey-10);
156+
}
157+
158+
.benchmarkCell--suiteLabel {
159+
position: relative;
160+
}
161+
162+
.benchmarkDisclosure {
163+
display: inline-block;
164+
width: 1em;
165+
margin-right: 0.25em;
166+
color: var(--grey-60);
167+
font-size: 0.75em;
168+
text-align: center;
169+
user-select: none;
170+
}
171+
172+
.benchmarkRow--expansion > td {
173+
padding: 0.5em 0 0.5em 2.5em;
174+
background: var(--grey-10);
175+
}
176+
177+
.benchmarkRow--expansion .benchmarkTable {
178+
margin-bottom: 0;
179+
}
180+
181+
/* Color coding.
182+
*
183+
* Confidence drives shading (background): HIGH = full, MEDIUM = muted,
184+
* LOW = no shading. Effect size drives boldness: Large = bold,
185+
* Moderate = semibold, Small/Negligible = normal.
186+
*/
140187

141188
.benchmarkCell--regressed {
142-
background: var(--red-10, #ffe8e8);
143189
color: var(--red-70, #a4000f);
144-
font-weight: bold;
145190
}
146191

147192
.benchmarkCell--improved {
148-
background: var(--green-10, #d3f3d8);
149193
color: var(--green-80, #006504);
150-
font-weight: bold;
151194
}
152195

153-
/* Medium confidence: muted background only, no bold, no colored text */
196+
.benchmarkCell--regressed.benchmarkCell--conf-high {
197+
background: var(--red-10, #ffe8e8);
198+
}
154199

155-
.benchmarkCell--regressed-medium {
200+
.benchmarkCell--regressed.benchmarkCell--conf-medium {
156201
background: color-mix(in srgb, var(--red-10, #ffe8e8) 40%, transparent);
157202
}
158203

159-
.benchmarkCell--improved-medium {
204+
.benchmarkCell--improved.benchmarkCell--conf-high {
205+
background: var(--green-10, #d3f3d8);
206+
}
207+
208+
.benchmarkCell--improved.benchmarkCell--conf-medium {
160209
background: color-mix(in srgb, var(--green-10, #d3f3d8) 40%, transparent);
161210
}
211+
212+
.benchmarkCell--effect-large {
213+
font-weight: bold;
214+
}
215+
216+
.benchmarkCell--effect-moderate {
217+
font-weight: 600;
218+
}

0 commit comments

Comments
 (0)