@@ -1029,17 +1029,23 @@ export function SuiteDetailPage() {
10291029 >
10301030 < SquareStack className = "size-3.5" />
10311031 </ button >
1032- < button
1033- disabled = { recentSuccessfulPerClient . length < MIN_COMPARE_RUNS }
1034- onClick = { ( ) => {
1035- const ids = recentSuccessfulPerClient . map ( ( r ) => r . run_id )
1036- navigate ( { to : '/compare' , search : { runs : ids . join ( ',' ) } } )
1037- } }
1038- className = "flex cursor-pointer items-center justify-center rounded-xs p-1 shadow-xs ring-1 ring-inset transition-colors bg-white text-gray-500 ring-gray-300 hover:bg-gray-50 hover:text-gray-700 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-gray-800 dark:text-gray-400 dark:ring-gray-600 dark:hover:bg-gray-700 dark:hover:text-gray-200"
1039- title = "Compare latest successful run per client"
1040- >
1041- < GitCompareArrows className = "size-3.5" />
1042- </ button >
1032+ { recentSuccessfulPerClient . length >= MIN_COMPARE_RUNS ? (
1033+ < a
1034+ href = { `/compare?runs=${ encodeURIComponent ( recentSuccessfulPerClient . map ( ( r ) => r . run_id ) . join ( ',' ) ) } ` }
1035+ className = "flex items-center justify-center rounded-xs p-1 shadow-xs ring-1 ring-inset transition-colors bg-white text-gray-500 ring-gray-300 hover:bg-gray-50 hover:text-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:ring-gray-600 dark:hover:bg-gray-700 dark:hover:text-gray-200"
1036+ title = "Compare latest successful run per client"
1037+ >
1038+ < GitCompareArrows className = "size-3.5" />
1039+ </ a >
1040+ ) : (
1041+ < button
1042+ disabled
1043+ className = "flex cursor-not-allowed items-center justify-center rounded-xs p-1 opacity-50 shadow-xs ring-1 ring-inset bg-white text-gray-500 ring-gray-300 dark:bg-gray-800 dark:text-gray-400 dark:ring-gray-600"
1044+ title = "Compare latest successful run per client"
1045+ >
1046+ < GitCompareArrows className = "size-3.5" />
1047+ </ button >
1048+ ) }
10431049 { groupCompareUrl && (
10441050 < a
10451051 href = { groupCompareUrl }
@@ -1056,7 +1062,7 @@ export function SuiteDetailPage() {
10561062 < RunsHeatmap
10571063 runs = { suiteRunsAll }
10581064 groupBy = { effectiveGroupBy }
1059- onCompareGroup = { effectiveGroupBy ? ( groupRuns ) => {
1065+ getCompareGroupHref = { effectiveGroupBy ? ( groupRuns ) => {
10601066 const sorted = [ ...groupRuns ] . sort ( ( a , b ) => b . timestamp - a . timestamp )
10611067 const seen = new Set < string > ( )
10621068 const ids : string [ ] = [ ]
@@ -1071,11 +1077,10 @@ export function SuiteDetailPage() {
10711077 }
10721078 if ( ids . length >= MAX_COMPARE_RUNS ) break
10731079 }
1074- if ( ids . length >= MIN_COMPARE_RUNS ) {
1075- navigate ( { to : '/compare' , search : { runs : ids . join ( ',' ) } } )
1076- }
1080+ if ( ids . length < MIN_COMPARE_RUNS ) return undefined
1081+ return `/compare?runs=${ encodeURIComponent ( ids . join ( ',' ) ) } `
10771082 } : undefined }
1078- onCompareClientAcrossGroups = { effectiveGroupBy ? ( client ) => {
1083+ getCompareClientAcrossGroupsHref = { effectiveGroupBy ? ( client ) => {
10791084 // Find the latest successful run for this client in each group
10801085 const sorted = [ ...suiteRunsAll ]
10811086 . filter ( ( r ) => r . instance . client === client )
@@ -1095,17 +1100,16 @@ export function SuiteDetailPage() {
10951100 }
10961101 if ( ids . length >= MAX_COMPARE_RUNS ) break
10971102 }
1098- if ( ids . length >= MIN_COMPARE_RUNS ) {
1099- const labels = effectiveGroupBy === 'instance_id' ? 'instance-id' : `label:${ effectiveGroupBy } `
1100- navigate ( { to : '/compare' , search : { runs : ids . join ( ',' ) , labels } } )
1101- }
1103+ if ( ids . length < MIN_COMPARE_RUNS ) return undefined
1104+ const labels = effectiveGroupBy === 'instance_id' ? 'instance-id' : `label:${ effectiveGroupBy } `
1105+ return `/compare?runs=${ encodeURIComponent ( ids . join ( ',' ) ) } &labels=${ encodeURIComponent ( labels ) } `
11021106 } : undefined }
1103- onGroupCompareGroup = { effectiveGroupBy ? ( groupLabel , groupClients ) => {
1107+ getGroupCompareGroupHref = { effectiveGroupBy ? ( groupLabel , groupClients ) => {
11041108 const labelFilter = effectiveGroupBy !== 'instance_id' ? `${ effectiveGroupBy } =${ groupLabel } ` : ''
11051109 const groups = groupClients . map ( ( c ) => `${ c } :${ labelFilter } ` ) . join ( ';' )
1106- navigate ( { to : ' /compare/groups' , search : { suite : suiteHash , groups } as Record < string , string > } )
1110+ return ` /compare/groups? suite= ${ encodeURIComponent ( suiteHash ) } &groups= ${ encodeURIComponent ( groups ) } `
11071111 } : undefined }
1108- onGroupCompareClientAcrossGroups = { effectiveGroupBy ? ( client ) => {
1112+ getGroupCompareClientAcrossGroupsHref = { effectiveGroupBy ? ( client ) => {
11091113 // Build one group per label-value for this client.
11101114 const labelValues = new Set < string > ( )
11111115 for ( const run of suiteRunsAll ) {
@@ -1119,7 +1123,7 @@ export function SuiteDetailPage() {
11191123 if ( effectiveGroupBy === 'instance_id' ) return `${ client } :`
11201124 return `${ client } :${ effectiveGroupBy } =${ val } `
11211125 } ) . join ( ';' )
1122- navigate ( { to : ' /compare/groups' , search : { suite : suiteHash , groups } as Record < string , string > } )
1126+ return ` /compare/groups? suite= ${ encodeURIComponent ( suiteHash ) } &groups= ${ encodeURIComponent ( groups ) } `
11231127 } : undefined }
11241128 isDark = { isDark }
11251129 colorNormalization = { heatmapColor }
@@ -1292,17 +1296,23 @@ export function SuiteDetailPage() {
12921296 >
12931297 < SquareStack className = "size-4" />
12941298 </ button >
1295- < button
1296- disabled = { recentSuccessfulPerClient . length < MIN_COMPARE_RUNS }
1297- onClick = { ( ) => {
1298- const ids = recentSuccessfulPerClient . map ( ( r ) => r . run_id )
1299- navigate ( { to : '/compare' , search : { runs : ids . join ( ',' ) } } )
1300- } }
1301- className = "flex cursor-pointer items-center justify-center rounded-xs p-1.5 shadow-xs ring-1 ring-inset transition-colors bg-white text-gray-500 ring-gray-300 hover:bg-gray-50 hover:text-gray-700 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-gray-800 dark:text-gray-400 dark:ring-gray-600 dark:hover:bg-gray-700 dark:hover:text-gray-200"
1302- title = "Compare latest successful run per client"
1303- >
1304- < GitCompareArrows className = "size-4" />
1305- </ button >
1299+ { recentSuccessfulPerClient . length >= MIN_COMPARE_RUNS ? (
1300+ < a
1301+ href = { `/compare?runs=${ encodeURIComponent ( recentSuccessfulPerClient . map ( ( r ) => r . run_id ) . join ( ',' ) ) } ` }
1302+ className = "flex items-center justify-center rounded-xs p-1.5 shadow-xs ring-1 ring-inset transition-colors bg-white text-gray-500 ring-gray-300 hover:bg-gray-50 hover:text-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:ring-gray-600 dark:hover:bg-gray-700 dark:hover:text-gray-200"
1303+ title = "Compare latest successful run per client"
1304+ >
1305+ < GitCompareArrows className = "size-4" />
1306+ </ a >
1307+ ) : (
1308+ < button
1309+ disabled
1310+ className = "flex cursor-not-allowed items-center justify-center rounded-xs p-1.5 opacity-50 shadow-xs ring-1 ring-inset bg-white text-gray-500 ring-gray-300 dark:bg-gray-800 dark:text-gray-400 dark:ring-gray-600"
1311+ title = "Compare latest successful run per client"
1312+ >
1313+ < GitCompareArrows className = "size-4" />
1314+ </ button >
1315+ ) }
13061316 { groupCompareUrl && (
13071317 < a
13081318 href = { groupCompareUrl }
0 commit comments