## Summary - add explicit BaselineSnapshot lifecycle truth with conservative backfill and a shared truth resolver - block baseline compare from building, incomplete, or superseded snapshots and align workspace/tenant UI truth surfaces with effective snapshot state - surface artifact truth separately from operation outcome across baseline profile, snapshot, compare, and operation run pages ## Testing - integrated browser smoke test on the active feature surfaces - `vendor/bin/sail artisan test --compact tests/Feature/Filament/BaselineSnapshotTruthSurfaceTest.php tests/Feature/Filament/BaselineProfileCompareStartSurfaceTest.php` - targeted baseline lifecycle and compare guard coverage added in Pest - `vendor/bin/sail bin pint --dirty --format agent` ## Notes - Livewire v4 compliance preserved - no panel provider registration changes were needed; Laravel 12 providers remain in `bootstrap/providers.php` - global search remains disabled for the affected baseline resources by design - destructive actions remain confirmation-gated; capture and compare actions keep their existing authorization and confirmation behavior - no new panel assets were added; existing deploy flow for `filament:assets` is unchanged Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #189
56 lines
2.5 KiB
PHP
56 lines
2.5 KiB
PHP
@php
|
|
/** @var bool $shouldShow */
|
|
/** @var ?string $runUrl */
|
|
/** @var ?string $state */
|
|
/** @var ?string $message */
|
|
/** @var ?string $coverageStatus */
|
|
/** @var ?string $fidelity */
|
|
/** @var int $uncoveredTypesCount */
|
|
/** @var list<string> $uncoveredTypes */
|
|
|
|
$coverageHasWarnings = in_array(($coverageStatus ?? null), ['warning', 'unproven'], true);
|
|
@endphp
|
|
|
|
<div>
|
|
@if ($shouldShow && ($coverageHasWarnings || ($state ?? null) === 'no_snapshot'))
|
|
<div class="rounded-lg border border-warning-300 bg-warning-50 p-4 text-warning-900 dark:border-warning-700 dark:bg-warning-950/40 dark:text-warning-100">
|
|
<div class="flex flex-col gap-1">
|
|
<div class="text-sm font-semibold">
|
|
@if (($state ?? null) === 'no_snapshot')
|
|
Current baseline unavailable
|
|
@else
|
|
Baseline compare coverage warnings
|
|
@endif
|
|
</div>
|
|
<div class="text-sm">
|
|
@if (($state ?? null) === 'no_snapshot')
|
|
{{ $message }}
|
|
@elseif (($coverageStatus ?? null) === 'unproven')
|
|
Coverage proof was missing or unreadable for the last baseline comparison, so findings were suppressed for safety.
|
|
@else
|
|
The last baseline comparison had incomplete coverage for {{ (int) $uncoveredTypesCount }} policy {{ Str::plural('type', (int) $uncoveredTypesCount) }}. Findings may be incomplete.
|
|
@endif
|
|
|
|
@if (filled($fidelity))
|
|
<span class="ml-1 text-xs text-warning-800 dark:text-warning-300">Fidelity: {{ Str::title($fidelity) }}</span>
|
|
@endif
|
|
</div>
|
|
|
|
@if (! empty($uncoveredTypes))
|
|
<div class="mt-1 text-xs">
|
|
Uncovered: {{ implode(', ', array_slice($uncoveredTypes, 0, 6)) }}@if (count($uncoveredTypes) > 6)…@endif
|
|
</div>
|
|
@endif
|
|
|
|
@if (($state ?? null) !== 'no_snapshot' && filled($runUrl))
|
|
<div class="mt-2">
|
|
<a class="text-sm font-medium text-primary-600 hover:underline dark:text-primary-400" href="{{ $runUrl }}">
|
|
View run
|
|
</a>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
@endif
|
|
</div>
|