Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions src/components/benchmark-card.tsx
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
import Link from "next/link";
import type { Benchmark } from "@/types/benchmark";
import { Hint } from "@/components/hint";
import { MiniChart } from "@/components/mini-chart";
import { CATEGORY_COLOR } from "@/lib/category-colors";
import { fmtValue, unitSuffix } from "@/lib/format";
Expand DownExpand Up@@ -50,13 +51,11 @@ export function BenchmarkCard({ benchmark }: { benchmark: Benchmark }) {
</div>
<div className="flex items-center gap-1 shrink-0">
{chips.map((r) => (
<span
key={r.slug}
title={r.name}
className="inline-flex items-center justify-center w-6 h-6 rounded-full border border-rule text-[10px] font-semibold text-ink-muted bg-surface"
>
{r.name.charAt(0).toUpperCase()}
</span>
<Hint key={r.slug} label={r.name}>
<span className="inline-flex items-center justify-center w-6 h-6 rounded-full border border-rule text-[10px] font-semibold text-ink-muted bg-surface">
{r.name.charAt(0).toUpperCase()}
</span>
</Hint>
))}
</div>
</div>
Expand Down
48 changes: 26 additions & 22 deletions src/components/distribution-chart.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,7 @@
import { useMemo } from "react";
import type { Benchmark } from "@/types/benchmark";
import { liveResults } from "@/lib/provider-filters";
import { Hint } from "@/components/hint";
import { ProviderLogo } from "@/components/provider-logo";
import { fmtUnit } from "@/lib/format";
import { methodologyTooltip } from "@/lib/methodology-tooltip";
Expand DownExpand Up@@ -127,30 +128,33 @@ export function DistributionChart({
aria-hidden
/>
{/* p99 — vertical bar, right edge of the spread */}
<span
className="absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-0.5 h-3.5 rounded-sm"
style={{ left: `${p99Pct}%`, background: color }}
title={`p99 ${fmtUnit(r.ms.p99, unit)}`}
aria-label={`p99 ${fmtUnit(r.ms.p99, unit)}`}
/>
<Hint label={`p99 ${fmtUnit(r.ms.p99, unit)}`}>
<span
className="absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-0.5 h-3.5 rounded-sm"
style={{ left: `${p99Pct}%`, background: color }}
aria-label={`p99 ${fmtUnit(r.ms.p99, unit)}`}
/>
</Hint>
{/* p90 — outlined ring */}
<span
className="absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-2.5 h-2.5 rounded-full"
style={{
left: `${p90Pct}%`,
border: `1.5px solid ${color}`,
background: "var(--color-paper)",
}}
title={`p90 ${fmtUnit(r.ms.p90, unit)}`}
aria-label={`p90 ${fmtUnit(r.ms.p90, unit)}`}
/>
<Hint label={`p90 ${fmtUnit(r.ms.p90, unit)}`}>
<span
className="absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-2.5 h-2.5 rounded-full"
style={{
left: `${p90Pct}%`,
border: `1.5px solid ${color}`,
background: "var(--color-paper)",
}}
aria-label={`p90 ${fmtUnit(r.ms.p90, unit)}`}
/>
</Hint>
{/* p50 — filled dot, the headline */}
<span
className="absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-3 h-3 rounded-full"
style={{ background: color }}
title={`p50 ${fmtUnit(r.ms.p50, unit)}`}
aria-label={`p50 ${fmtUnit(r.ms.p50, unit)}`}
/>
<Hint label={`p50 ${fmtUnit(r.ms.p50, unit)}`}>
<span
className="absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-3 h-3 rounded-full"
style={{ background: color }}
aria-label={`p50 ${fmtUnit(r.ms.p50, unit)}`}
/>
</Hint>
</>
)}
</div>
Expand Down
13 changes: 7 additions & 6 deletions src/components/home-bench-table.tsx
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
import Link from "next/link";
import { ArrowUpRight } from "lucide-react";
import type { Benchmark } from "@/types/benchmark";
import { Hint } from "@/components/hint";
import { MiniChart } from "@/components/mini-chart";
import { CATEGORY_COLOR } from "@/lib/category-colors";
import { leader, fieldValue } from "@/lib/citation";
Expand DownExpand Up@@ -85,12 +86,12 @@ function BenchTitleCell({ b }: { b: Benchmark }) {
</span>
<ul className="flex items-center gap-1">
{chips.map((c) => (
<li
key={c.slug}
className="inline-flex items-center justify-center w-5 h-5 rounded-full border border-rule bg-surface text-[9px] font-semibold text-ink-muted"
title={c.name}
>
{c.name.charAt(0)}
<li key={c.slug} className="inline-flex">
<Hint label={c.name}>
<span className="inline-flex items-center justify-center w-5 h-5 rounded-full border border-rule bg-surface text-[9px] font-semibold text-ink-muted">
{c.name.charAt(0)}
</span>
</Hint>
</li>
))}
</ul>
Expand Down
14 changes: 7 additions & 7 deletions src/components/ledger-table.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,7 @@ import { useMemo } from "react";

import Link from "next/link";
import type { Benchmark, ProviderResult } from "@/types/benchmark";
import { Hint } from "@/components/hint";
import { Sparkline } from "@/components/sparkline";
import { ProviderLogo } from "@/components/provider-logo";
import { ProviderTypeBadge } from "@/components/provider-type-badge";
Expand DownExpand Up@@ -201,13 +202,12 @@ function Row({
</span>
)}
{isOffline && (
<span
className="inline-flex items-center gap-1 shrink-0 font-sans text-[10px] uppercase tracking-[0.14em] text-ink-muted"
title="No samples returned this cycle — provider or its upstream is currently unavailable. Values will reappear once data resumes."
>
<span className="inline-block w-1.5 h-1.5 rounded-full bg-[var(--color-warn,#c08a3c)]" aria-hidden />
Currently unavailable
</span>
<Hint label="No samples returned this cycle. Provider or its upstream is unavailable. Values reappear once data resumes.">
<span className="inline-flex items-center gap-1 shrink-0 font-sans text-[10px] uppercase tracking-[0.14em] text-ink-muted">
<span className="inline-block w-1.5 h-1.5 rounded-full bg-[var(--color-warn,#c08a3c)]" aria-hidden />
Currently unavailable
</span>
</Hint>
)}
{r.type && !isOffline && (
<span className="hidden md:inline-flex">
Expand Down
20 changes: 11 additions & 9 deletions src/components/ranked-bar-chart.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,6 +6,7 @@ import { fmtUnit } from "@/lib/format";
import { methodologyTooltip } from "@/lib/methodology-tooltip";
import { buildProviderColors } from "@/lib/series-colors";
import { useChartExclusion } from "@/hooks/use-chart-exclusion";
import { Hint } from "@/components/hint";
import { LiveDot } from "@/components/live-dot";
import { ProviderLogo } from "@/components/provider-logo";

Expand DownExpand Up@@ -142,15 +143,16 @@ export function RankedBarChart({
<span className="font-sans tabular text-[11px] text-ink-faint text-right">
{rank !== null ? `#${rank}` : "-"}
</span>
<span
className={`inline-flex items-center gap-2 text-[13px] truncate ${
isOff ? "text-ink-faint line-through decoration-1" : "text-ink"
}`}
title={r.tag}
>
<ProviderLogo slug={r.slug} name={r.name} size={18} />
<span className="truncate">{r.name}</span>
</span>
<Hint label={r.tag ?? r.name}>
<span
className={`inline-flex items-center gap-2 text-[13px] truncate ${
isOff ? "text-ink-faint line-through decoration-1" : "text-ink"
}`}
>
<ProviderLogo slug={r.slug} name={r.name} size={18} />
<span className="truncate">{r.name}</span>
</span>
</Hint>
<div className="relative h-7 bg-paper-soft/60 rounded-sm overflow-hidden">
<div
className="h-full rounded-sm transition-[width,opacity] duration-300"
Expand Down
Loading