diff --git a/src/components/ledger-table.tsx b/src/components/ledger-table.tsx index a5ea3dec..87799374 100644 --- a/src/components/ledger-table.tsx +++ b/src/components/ledger-table.tsx @@ -20,6 +20,17 @@ import { buildProviderColors } from "@/lib/series-colors"; import { isRegion } from "@/lib/brand"; import { isAll } from "@/lib/dimensions"; +// Hyperliquid frontends bench surfaces builder addresses that aren't +// yet in /opt/hl-bench/builders.json with a raw hex slug. Mirrors the +// HEX_ADDRESS_SLUG regex in src/lib/providers.ts (the /products route +// blacklist) — kept inline because providers.ts is server-only (it +// imports unstable_cache + the bench loaders) and pulling it into +// this client component breaks the build. +const HEX_ADDRESS_SLUG = /^0x[a-f0-9]+$/; +function isHexAddressSlug(slug: string): boolean { + return HEX_ADDRESS_SLUG.test(slug.toLowerCase()); +} + type Props = { benchmark: Benchmark; /** When the bench page has a companion-panel tab selected on the @@ -404,7 +415,13 @@ function Row({
- {isRegion(r.slug) ? ( + {isRegion(r.slug) || isHexAddressSlug(r.slug) ? ( + // Hex builder addresses (HL frontends not yet in + // builders.json) have no /products/ page — the + // route is blacklisted in providers.ts, so a link would + // 404. Render as plain text until the builder is added + // to the registry, at which point it gets a real slug + // and the link reappears automatically. route is blacklisted so + * these would 404 if linked. Used by ledger-table.tsx to render the + * row name as plain text instead of an anchor. */ +export function isHexAddressSlug(slug: string): boolean { + return HEX_ADDRESS_SLUG.test(slug.toLowerCase()); +} + function isBlacklistedSlug(slug: string): boolean { const lc = slug.toLowerCase(); return DEAD_COMPOSITE_SLUGS.has(lc) || HEX_ADDRESS_SLUG.test(lc);