fix: 7d/30d tabs disabled when metric panel is active — lazy-fetch panel long-range series - #1426
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On every bench with metric panels (columns like "Volume routed" on `hyperliquid-frontends`), clicking a panel disables the 7d and 30d time-range pills — hover shows "Switch off the metric panel to see long-range history" even though the underlying Prom data exists.
Root cause
Fix
A) `/api/series/[slug]?panel=` — new optional param that returns panel-specific series from the same blob/materialized snapshot (already contains them). Cache key bumped to v5.
B) `time-series-chart/index.tsx` — new prop `activePanelId`, dedicated `useEffect` fetches panel 7d/30d when active. Result cached per panel id so switching between panels is instant. `has7d`/`has30d` and `pickPanel()` extended to use lazy panel maps.
C) `benchmark-body.tsx` — passes `activePanelId={activePanel?.id ?? null}` to the chart.
No cache-size impact (long-range series still stripped). CDN cache handles panel fan-out same as bench-level (60s s-maxage + 300s SWR).
Test plan