diff --git a/resources/views/livewire/runs/show.blade.php b/resources/views/livewire/runs/show.blade.php index 4efc3a9..7e5c647 100644 --- a/resources/views/livewire/runs/show.blade.php +++ b/resources/views/livewire/runs/show.blade.php @@ -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 @else - @php($sortCol = $this->sortColumn(self::SORTABLE_METRIC)) + @php($sortCol = $this->sortColumn(self::SORTABLE_METRIC, $this->run->suite === 'infrabench' ? 'task' : 'section')) @if (in_array($this->run->suite, ['softbench', 'prosebench', 'psychbench']))