From 3540ec15f34908780b416dd5558d88a09685a186 Mon Sep 17 00:00:00 2001 From: Florent Tapponnier Date: Sat, 23 May 2026 16:12:53 +0200 Subject: [PATCH] feat: migrate hot-path tooltips from native title= to MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5 most-visible tooltip surfaces now use the Hint primitive instead of the browser's default 800 ms title= popup: - home-bench-table — provider initials chips on every home card - benchmark-card — provider initials chips on the /benchmarks grid - distribution-chart — p50 / p90 / p99 percentile markers - ranked-bar-chart — provider name / tag row chip - ledger-table — 'Currently unavailable' badge (had a 2-sentence paragraph stuffed inside a title= attribute, illegible) Hint already shipped in the previous PR; this batch attaches it where the design audit identified the worst UX gaps (provider chips were the agent's #1 example: user sees a 'C' and has to wait 800 ms for the browser to maybe show 'Coinbase'). 120 ms hover delay, instant on focus, ink-on-paper styled - matches Stripe / Linear / Vercel conventions for read-only dashboards. Row-level tooltips (full
  • with methodologyTooltip) keep their native title= for now - wrapping
  • in 's would break
      semantics. Migrating those needs a small Hint asChild pattern (radix-style cloneElement); deferred to a focused follow-up PR if visible enough to warrant it. --- src/components/benchmark-card.tsx | 13 ++++---- src/components/distribution-chart.tsx | 48 +++++++++++++++------------ src/components/home-bench-table.tsx | 13 ++++---- src/components/ledger-table.tsx | 14 ++++---- src/components/ranked-bar-chart.tsx | 20 ++++++----- 5 files changed, 57 insertions(+), 51 deletions(-) diff --git a/src/components/benchmark-card.tsx b/src/components/benchmark-card.tsx index 3fa532e2..739c8681 100644 --- a/src/components/benchmark-card.tsx +++ b/src/components/benchmark-card.tsx @@ -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"; @@ -50,13 +51,11 @@ export function BenchmarkCard({ benchmark }: { benchmark: Benchmark }) {
      {chips.map((r) => ( - - {r.name.charAt(0).toUpperCase()} - + + + {r.name.charAt(0).toUpperCase()} + + ))}
      diff --git a/src/components/distribution-chart.tsx b/src/components/distribution-chart.tsx index 46fb431a..14461ba6 100644 --- a/src/components/distribution-chart.tsx +++ b/src/components/distribution-chart.tsx @@ -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"; @@ -127,30 +128,33 @@ export function DistributionChart({ aria-hidden /> {/* p99 — vertical bar, right edge of the spread */} - + + + {/* p90 — outlined ring */} - + + + {/* p50 — filled dot, the headline */} - + + + )} diff --git a/src/components/home-bench-table.tsx b/src/components/home-bench-table.tsx index 8d1eb1f8..5a0f1b87 100644 --- a/src/components/home-bench-table.tsx +++ b/src/components/home-bench-table.tsx @@ -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"; @@ -85,12 +86,12 @@ function BenchTitleCell({ b }: { b: Benchmark }) {
        {chips.map((c) => ( -
      • - {c.name.charAt(0)} +
      • + + + {c.name.charAt(0)} + +
      • ))}
      diff --git a/src/components/ledger-table.tsx b/src/components/ledger-table.tsx index 1a03b925..d6679d53 100644 --- a/src/components/ledger-table.tsx +++ b/src/components/ledger-table.tsx @@ -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"; @@ -201,13 +202,12 @@ function Row({
      )} {isOffline && ( - - - Currently unavailable - + + + + Currently unavailable + + )} {r.type && !isOffline && ( diff --git a/src/components/ranked-bar-chart.tsx b/src/components/ranked-bar-chart.tsx index f0f2be20..06ee0982 100644 --- a/src/components/ranked-bar-chart.tsx +++ b/src/components/ranked-bar-chart.tsx @@ -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"; @@ -142,15 +143,16 @@ export function RankedBarChart({ {rank !== null ? `#${rank}` : "-"} - - - {r.name} - + + + + {r.name} + +