Anton Malykhin commited on
Commit
7ce8f2e
·
1 Parent(s): 90efd1c

fix: correct details matrix sticky layering and hover states

Browse files
Files changed (1) hide show
  1. src/routes/details/+page.svelte +12 -12
src/routes/details/+page.svelte CHANGED
@@ -315,7 +315,7 @@
315
  }
316
 
317
  function matrixSortColumnClass(datasetName: string | null) {
318
- return matrixSortIsActive(datasetName) && 'bg-muted/80 text-foreground';
319
  }
320
 
321
  function metricCellClass(value: number | null, metric: DetailMetric, datasetName: string) {
@@ -336,7 +336,7 @@
336
  return cn(
337
  metricCellClass(value, metric, datasetName),
338
  startsGroup && 'border-l-border',
339
- matrixSortIsActive(datasetName) && 'bg-muted/20 text-foreground'
340
  );
341
  }
342
 
@@ -567,7 +567,7 @@
567
  })}
568
  </p>
569
  <div
570
- class="max-h-[88vh] overflow-auto rounded-2xl border bg-card shadow-sm"
571
  role="region"
572
  aria-label={m.benchmarks_description()}
573
  >
@@ -666,12 +666,12 @@
666
  <tbody>
667
  {#each matrixRows as model (modelKey(model))}
668
  <tr
669
- class="hover:[&>td.matrix-cell-bad]:!bg-red-500/15 hover:[&>td.matrix-cell-empty]:!bg-muted/40 hover:[&>td.matrix-cell-good]:!bg-emerald-500/15 hover:[&>th]:bg-muted"
670
  >
671
  <th
672
  class={cn(
673
- 'z-20 min-w-80 max-w-80 border-r border-b bg-card px-4 py-3 text-left md:sticky md:left-0',
674
- matrixSortIsActive(null) && 'bg-muted/30'
675
  )}
676
  scope="row"
677
  >
@@ -732,12 +732,6 @@
732
  </p>
733
  {/if}
734
  </div>
735
-
736
- <div
737
- class="mt-3 flex flex-wrap items-center gap-x-5 gap-y-2 text-xs text-muted-foreground"
738
- >
739
- <span>{m.details_matrix_no_data()}</span>
740
- </div>
741
  </section>
742
  {:else}
743
  <section
@@ -1554,3 +1548,9 @@
1554
  {/snippet}
1555
  </div>
1556
  {/if}
 
 
 
 
 
 
 
315
  }
316
 
317
  function matrixSortColumnClass(datasetName: string | null) {
318
+ return matrixSortIsActive(datasetName) && 'bg-muted text-foreground';
319
  }
320
 
321
  function metricCellClass(value: number | null, metric: DetailMetric, datasetName: string) {
 
336
  return cn(
337
  metricCellClass(value, metric, datasetName),
338
  startsGroup && 'border-l-border',
339
+ matrixSortIsActive(datasetName) && 'bg-muted text-foreground'
340
  );
341
  }
342
 
 
567
  })}
568
  </p>
569
  <div
570
+ class="relative isolate max-h-[88vh] overflow-auto rounded-2xl border bg-card shadow-sm"
571
  role="region"
572
  aria-label={m.benchmarks_description()}
573
  >
 
666
  <tbody>
667
  {#each matrixRows as model (modelKey(model))}
668
  <tr
669
+ class="details-matrix-row hover:[&>td.matrix-cell-bad]:!bg-red-500/15 hover:[&>td.matrix-cell-empty]:!bg-muted/40 hover:[&>td.matrix-cell-good]:!bg-emerald-500/15"
670
  >
671
  <th
672
  class={cn(
673
+ 'z-10 min-w-80 max-w-80 border-r border-b bg-card px-4 py-3 text-left transition-colors md:sticky md:left-0',
674
+ matrixSortIsActive(null) && 'bg-muted'
675
  )}
676
  scope="row"
677
  >
 
732
  </p>
733
  {/if}
734
  </div>
 
 
 
 
 
 
735
  </section>
736
  {:else}
737
  <section
 
1548
  {/snippet}
1549
  </div>
1550
  {/if}
1551
+
1552
+ <style>
1553
+ .details-matrix-row:hover > th {
1554
+ background-color: color-mix(in oklch, var(--muted) 84%, var(--foreground) 16%) !important;
1555
+ }
1556
+ </style>