Fix infrabench sort default: use task instead of missing section column

This commit is contained in:
PeterChrz 2026-09-20 23:42:13 -04:00
parent 8ec5c28623
commit 7f53ce6878
Signed by untrusted user who does not match committer: pch
GPG key ID: 8F0826ECF7302C63

View file

@ -87,9 +87,13 @@ private function authorizeOwner(): void
}
}
private function sortColumn(array $allowed): string
private function sortColumn(array $allowed, string $default = null): string
{
return in_array($this->sortBy, $allowed, true) ? $this->sortBy : $allowed[0];
if (in_array($this->sortBy, $allowed, true)) {
return $this->sortBy;
}
return $default ?? $allowed[0];
}
private function sortDir(): string
@ -249,7 +253,7 @@ private function sortDir(): string
</flux:table.rows>
</flux:table>
@else
@php($sortCol = $this->sortColumn(self::SORTABLE_METRIC))
@php($sortCol = $this->sortColumn(self::SORTABLE_METRIC, $this->run->suite === 'infrabench' ? 'task' : 'section'))
<flux:table>
<flux:table.columns>
@if (in_array($this->run->suite, ['softbench', 'prosebench', 'psychbench']))