From 4087cf1a9706101c69d75b15c70ced5395f0e40a Mon Sep 17 00:00:00 2001 From: Jack Date: Fri, 31 Jul 2026 20:17:28 +0800 Subject: [PATCH] fix(go): restore limits graph axis (#39870) --- packages/console/app/src/i18n/en.ts | 1 + packages/console/app/src/routes/go/index.css | 33 ++++++++++++++++ packages/console/app/src/routes/go/index.tsx | 40 ++++++++++++++++++-- 3 files changed, 70 insertions(+), 4 deletions(-) diff --git a/packages/console/app/src/i18n/en.ts b/packages/console/app/src/i18n/en.ts index 3d4778047eb..771dc43a59d 100644 --- a/packages/console/app/src/i18n/en.ts +++ b/packages/console/app/src/i18n/en.ts @@ -270,6 +270,7 @@ export const dict = { "go.graph.freePill": "Big Pickle and free models", "go.graph.go": "Go", "go.graph.label": "Requests per 5 hour", + "go.graph.tick": "{{n}}x", "go.graph.usageLimits": "Usage limits", "go.graph.aria": "Requests per 5h: {{free}} vs {{go}}", diff --git a/packages/console/app/src/routes/go/index.css b/packages/console/app/src/routes/go/index.css index bde8c429867..662abc3dd18 100644 --- a/packages/console/app/src/routes/go/index.css +++ b/packages/console/app/src/routes/go/index.css @@ -504,6 +504,33 @@ body { pointer-events: none; } + [data-slot="xlabels"] { + position: absolute; + inset: 0; + pointer-events: none; + } + + [data-slot="xlabels"] [data-xlabel] { + position: absolute; + left: var(--x); + top: var(--y); + transform: translate(-50%, -50%); + color: var(--color-text-weak); + font-size: 12px; + line-height: 1; + white-space: nowrap; + + @media (prefers-color-scheme: light) { + color: color-mix(in srgb, var(--color-text-weak) 82%, var(--color-text-strong)); + } + + @media (max-width: 60rem) { + &:not([data-tick="1"], [data-tick="25"], [data-tick="100"], [data-tick="250"]) { + display: none; + } + } + } + [data-slot="ylabels"] [data-ylabel] { position: absolute; left: var(--x); @@ -587,6 +614,12 @@ body { display: block; } + [data-grid] { + stroke: var(--color-border); + stroke-width: 1; + opacity: 0.6; + } + [data-tick] { fill: var(--color-text-weak); font-size: 12px; diff --git a/packages/console/app/src/routes/go/index.tsx b/packages/console/app/src/routes/go/index.tsx index 7933a97903b..d1a4af6ad29 100644 --- a/packages/console/app/src/routes/go/index.tsx +++ b/packages/console/app/src/routes/go/index.tsx @@ -68,10 +68,7 @@ function LimitsGraph(props: { href: string }) { { id: "grok-4.5", name: "Grok 4.5", req: 120, d: "50ms" }, { id: "kimi-k3", name: "Kimi K3", req: 110, d: "75ms" }, { id: "glm-5.2", name: "GLM-5.2", req: 880, d: "100ms" }, - { id: "qwen3.7-max", name: "Qwen3.7 Max", req: 950, d: "110ms" }, - { id: "kimi-k2.7-code", name: "Kimi K2.7 Code", req: 1150, d: "150ms" }, { id: "minimax-m3", name: "MiniMax M3", req: 3200, d: "210ms" }, - { id: "mimo-v2.5-pro", name: "MiMo-V2.5-Pro", req: 3250, d: "240ms" }, { id: "deepseek-v4-pro", name: "DeepSeek V4 Pro", req: 3450, d: "270ms" }, { id: "gpt-5.6-luna", name: "GPT 5.6 Luna (2x usage)", req: 4100, baseReq: 2050, d: "290ms" }, { id: "qwen3.7-plus", name: "Qwen3.7 Plus", req: 4300, d: "300ms" }, @@ -84,7 +81,7 @@ function LimitsGraph(props: { href: string }) { const left = 40 const right = 60 const top = 18 - const bottom = 18 + const bottom = 44 const plot = w - left - right const ratio = (n: number) => n / baseline @@ -93,6 +90,24 @@ function LimitsGraph(props: { href: string }) { const base = 24 const p = 2.2 const x = (r: number) => left + base + Math.pow(log(r) / log(rmax), p) * (plot - base) + const ticks = [1, 5, 10, 25, 50, 100, 250].filter((t) => t <= rmax) + const labels = (() => { + const set = new Set() + let last = -Infinity + for (const t of ticks) { + if (t === 1) { + set.add(t) + last = x(t) + continue + } + const pos = x(t) + if (pos - last < 44) continue + set.add(t) + last = pos + } + return set + })() + const shown = ticks.filter((t) => labels.has(t)) const bh = 8 const gap = 20 const step = bh + gap @@ -102,6 +117,7 @@ function LimitsGraph(props: { href: string }) { const px = (n: number) => `${(n / w) * 100}%` const py = (n: number) => `${(n / h) * 100}%` const lx = px(left - 16) + const ty = py(h - 18) return (