Commit 10b2473
committed
fix(site/VerdictExplanation): balance the findings columns and tighten chrome
Three things were off in the previous layout:
1. CSS multi-column auto-balancing can't cope with break-inside-avoid
cards of wildly different heights. Left column ran deep with four
tall cards while the right column ended early, leaving an
asymmetric block of whitespace under the right column and the
Verdict trigger orphaned under the left.
2. Severity badges in the card header (5 HIGH 2 MEDIUM) read as
trim, not as data, because they were just colored mono text with
no shape. The eye slid past them.
3. The jump bar count numerals floated next to the category name
with no separator, looking like dangling integers.
Plus the rule severity dots at size-1.5 (6px) were barely
perceptible.
Changes:
- Manual height-balanced bin-pack into two columns. estimateCardHeight
sums a per-card header cost plus a per-rule cost (header row plus
one estimated line per ~60 description characters). The greedy
pack walks the categories in severity-first order and drops each
into whichever column is currently shorter. Mobile keeps the
single-column flow so the order matches the sort. On the test
skill, the two columns previously diverged by hundreds of pixels;
now they finish within a card-height of each other.
- Severity badges in the card header are now rounded chips with a
1px coder-smoke border and a coder-cinder background. The shape
makes them read as labels. Spacing inside the chip uses tabular
numerals so '5 HIGH' and '12 MEDIUM' align.
- Jump bar pill: name and count are separated by a 12px vertical
divider (h-3 w-px bg-coder-smoke) so the count reads as a
distinct field. Count uses tabular-nums for alignment.
- Rule severity dot is now size-2 (8px) with shrink-0 so it doesn't
squash when wrapping. Removed the negative margin and self-center
hack now that the parent uses items-center.
- Card header gap-y bumped to 1.5 so the badges drop cleanly under
the title when the card is narrow.
- Card accent strip widened from w-1 (4px) to w-1.5 (6px) for a
more confident severity band.
The single-column mobile path duplicates the cards DOM-side
intentionally; CategoryCard is a leaf component and the duplication
is cheap. The benefit is that mobile keeps the original
severity-first ordering without inheriting the bin-pack split,
which would interleave categories incorrectly on a narrow viewport.1 parent 41b34ce commit 10b2473
1 file changed
Lines changed: 87 additions & 17 deletions
Lines changed: 87 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
199 | 242 | | |
200 | 243 | | |
201 | 244 | | |
| |||
204 | 247 | | |
205 | 248 | | |
206 | 249 | | |
207 | | - | |
| 250 | + | |
208 | 251 | | |
209 | 252 | | |
210 | 253 | | |
211 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
212 | 258 | | |
213 | 259 | | |
214 | 260 | | |
215 | 261 | | |
216 | 262 | | |
217 | | - | |
| 263 | + | |
| 264 | + | |
218 | 265 | | |
219 | 266 | | |
220 | 267 | | |
| |||
244 | 291 | | |
245 | 292 | | |
246 | 293 | | |
247 | | - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
248 | 299 | | |
249 | 300 | | |
250 | 301 | | |
| |||
261 | 312 | | |
262 | 313 | | |
263 | 314 | | |
264 | | - | |
| 315 | + | |
265 | 316 | | |
266 | 317 | | |
267 | 318 | | |
268 | 319 | | |
269 | | - | |
| 320 | + | |
270 | 321 | | |
271 | | - | |
| 322 | + | |
272 | 323 | | |
273 | 324 | | |
274 | 325 | | |
| |||
280 | 331 | | |
281 | 332 | | |
282 | 333 | | |
283 | | - | |
| 334 | + | |
284 | 335 | | |
285 | 336 | | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
| 337 | + | |
290 | 338 | | |
291 | 339 | | |
292 | 340 | | |
| |||
340 | 388 | | |
341 | 389 | | |
342 | 390 | | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
343 | 398 | | |
344 | 399 | | |
345 | 400 | | |
| |||
396 | 451 | | |
397 | 452 | | |
398 | 453 | | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
| 454 | + | |
| 455 | + | |
404 | 456 | | |
405 | 457 | | |
406 | 458 | | |
407 | 459 | | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
408 | 478 | | |
409 | 479 | | |
410 | 480 | | |
| |||
0 commit comments