*/ protected function getViewData(): array { $tenant = Filament::getTenant(); if (! $tenant instanceof Tenant) { return [ 'shouldShow' => false, ]; } $stats = BaselineCompareStats::forTenant($tenant); $uncoveredTypes = $stats->uncoveredTypes ?? []; $uncoveredTypes = is_array($uncoveredTypes) ? $uncoveredTypes : []; $coverageStatus = $stats->coverageStatus; $hasWarnings = in_array($coverageStatus, ['warning', 'unproven'], true) && $uncoveredTypes !== []; $runUrl = null; if ($stats->operationRunId !== null) { $runUrl = OperationRunLinks::view($stats->operationRunId, $tenant); } return [ 'shouldShow' => ($hasWarnings && $runUrl !== null) || $stats->state === 'no_snapshot', 'runUrl' => $runUrl, 'state' => $stats->state, 'message' => $stats->message, 'coverageStatus' => $coverageStatus, 'fidelity' => $stats->fidelity, 'uncoveredTypesCount' => $stats->uncoveredTypesCount ?? count($uncoveredTypes), 'uncoveredTypes' => $uncoveredTypes, ]; } }