Skip to content
Merged
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
25 changes: 9 additions & 16 deletions src/components/benchmark-body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,10 @@

// Cross-dimension filtering: hide venue tabs with no data for the active
// chain, and hide chain tabs with no data for the active venue.
const filteredVenueOptions = useMemo(() => {
if (!venuesForChain || !effectiveChain || effectiveChain === "all") return venueOptions;
const valid = venuesForChain[effectiveChain];
if (!valid || valid.length === 0) return venueOptions;
const validSet = new Set(valid);
return venueOptions.filter((v) => v.value === "all" || validSet.has(v.value));
}, [venueOptions, venuesForChain, effectiveChain]);
// Venue tabs are never filtered by chain: the user picks a launchpad first,
// then drills into a chain. The reverse (chain → hides venues) is confusing
// because launchpad tabs disappear unexpectedly.
const filteredVenueOptions = venueOptions;

const chainsForVenue = useMemo(() => {
if (!venuesForChain) return undefined;
Expand All @@ -309,7 +306,9 @@
const valid = chainsForVenue[effectiveVenue];
if (!valid || valid.length === 0) return chainOptions;
const validSet = new Set(valid);
return chainOptions.filter((c) => c.value === "all" || validSet.has(c.value));
// Strip the "all" aggregate option when a specific venue is selected: mixing
// chains is unfair (a Solana-only provider scores 0% on Base tokens).
return chainOptions.filter((c) => c.value !== "all" && validSet.has(c.value));
}, [chainOptions, chainsForVenue, effectiveVenue]);

// The page ships ONLY the aggregate view (embedding every variant made
Expand Down Expand Up @@ -622,7 +621,7 @@
// not only on the timeseries view. Providers the panel has no value
// for (book could not fill the tier) drop out of the ranking, which
// is the skipped-not-extrapolated rule made visible.
const panelViewBenchmark = useMemo(() => {

Check failure on line 624 in src/components/benchmark-body.tsx

View workflow job for this annotation

GitHub Actions / check

React Hook "useMemo" is called conditionally. React Hooks must be called in the exact same order in every component render. Did you accidentally call a React Hook after an early return?
if (!activePanel) return viewBenchmark;
const vals = activePanel.values ?? {};
return {
Expand Down Expand Up @@ -698,18 +697,12 @@
)}
/>
)}
{filteredChainOptions.length > 0 && (
{filteredChainOptions.length > 1 && (
<DimensionRow
label="Chain"
options={filteredChainOptions}
selected={chain ?? fallbackChain}
onSelect={(v) => {
setChain(v);
if (v !== "all" && effectiveVenue && effectiveVenue !== "all" && venuesForChain) {
const validVenues = venuesForChain[v];
if (validVenues && !validVenues.includes(effectiveVenue)) setVenue(null);
}
}}
onSelect={setChain}
metaByValue={Object.fromEntries(
filteredChainOptions
.map((o) => [
Expand Down
Loading