@@ -82,6 +82,7 @@ export default function BuildComparisonPage() {
8282 const [ loading , setLoading ] = useState ( true ) ;
8383 const [ error , setError ] = useState < string | null > ( null ) ;
8484 const [ dataProcessing , setDataProcessing ] = useState ( false ) ;
85+ const [ benchmarkNamesLoading , setBenchmarkNamesLoading ] = useState ( false ) ;
8586
8687 // Store trend data for each binary-benchmark combination
8788 const [ trendData , setTrendData ] = useState <
@@ -177,10 +178,8 @@ export default function BuildComparisonPage() {
177178 async function loadBenchmarkData ( ) {
178179 if (
179180 ! selectedEnvironmentId ||
180- ! selectedPythonVersionKey ||
181- selectedBinaries . length === 0
181+ ! selectedPythonVersionKey
182182 ) {
183- setDataProcessing ( false ) ;
184183 return ;
185184 }
186185
@@ -193,12 +192,17 @@ export default function BuildComparisonPage() {
193192 }
194193
195194 try {
196- setDataProcessing ( true ) ;
195+ setBenchmarkNamesLoading ( true ) ;
197196
198- // Get available benchmark names for the first binary
197+ // Get available benchmark names for the first available binary (benchmark names are the same across binaries)
198+ const firstBinaryId = binaries . length > 0 ? binaries [ 0 ] . id : undefined ;
199+ if ( ! firstBinaryId ) {
200+ return ;
201+ }
202+
199203 const uniqueBenchmarks = await api . getBenchmarkNames ( {
200204 environment_id : selectedEnvironmentId ,
201- binary_id : selectedBinaries [ 0 ] ,
205+ binary_id : firstBinaryId ,
202206 python_major : versionOption . major ,
203207 python_minor : versionOption . minor ,
204208 } satisfies BenchmarkNamesQueryParams ) ;
@@ -217,7 +221,7 @@ export default function BuildComparisonPage() {
217221 variant : 'destructive' ,
218222 } ) ;
219223 } finally {
220- setDataProcessing ( false ) ;
224+ setBenchmarkNamesLoading ( false ) ;
221225 }
222226 }
223227
@@ -227,10 +231,10 @@ export default function BuildComparisonPage() {
227231 } , [
228232 selectedEnvironmentId ,
229233 selectedPythonVersionKey ,
230- selectedBinaries ,
231234 pythonVersionOptions ,
232235 loading ,
233236 mounted ,
237+ binaries ,
234238 ] ) ;
235239
236240 // Load ALL benchmark data upfront for selected binaries and environment
@@ -1067,12 +1071,7 @@ export default function BuildComparisonPage() {
10671071 }
10681072 />
10691073 < ScrollArea className = "h-48 rounded-md border p-4" >
1070- { loading ||
1071- dataProcessing ||
1072- ( allBenchmarkNames . length === 0 &&
1073- selectedEnvironmentId &&
1074- selectedPythonVersionKey &&
1075- selectedBinaries . length > 0 ) ? (
1074+ { benchmarkNamesLoading ? (
10761075 < div className = "space-y-2" >
10771076 { [ ...Array ( 8 ) ] . map ( ( _ , i ) => (
10781077 < div key = { i } className = "flex items-center space-x-2" >
0 commit comments