TenantAtlas/resources/views/filament/widgets/tenant/baseline-compare-coverage-banner.blade.php
ahmido 02e75e1cda feat: harden baseline compare summary trust surfaces (#196)
## Summary
- add a shared baseline compare summary assessment and assessor for compact trust propagation
- harden dashboard, landing, and banner baseline compare surfaces against false all-clear claims
- add focused Pest coverage for dashboard, landing, banner, reason translation, and canonical detail parity

## Validation
- vendor/bin/sail bin pint --dirty --format agent
- vendor/bin/sail artisan test --compact tests/Feature/Baselines/BaselineCompareSummaryAssessmentTest.php tests/Feature/Baselines/BaselineCompareExplanationFallbackTest.php tests/Feature/Filament/BaselineCompareNowWidgetTest.php tests/Feature/Filament/NeedsAttentionWidgetTest.php tests/Feature/Filament/BaselineCompareExplanationSurfaceTest.php tests/Feature/Filament/BaselineCompareLandingWhyNoFindingsTest.php tests/Feature/Filament/BaselineCompareCoverageBannerTest.php tests/Feature/Filament/BaselineCompareSummaryConsistencyTest.php tests/Feature/Filament/OperationRunBaselineTruthSurfaceTest.php tests/Feature/ReasonTranslation/ReasonTranslationExplanationTest.php

## Notes
- Livewire compliance: Filament v5 / Livewire v4 stack unchanged
- Provider registration: unchanged, Laravel 12 providers remain in bootstrap/providers.php
- Global search: no searchable resource behavior changed
- Destructive actions: none introduced by this change
- Assets: no new assets registered; existing deploy process remains unchanged

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #196
2026-03-27 00:19:53 +00:00

58 lines
2.4 KiB
PHP

@php
/** @var array<string, mixed>|null $summaryAssessment */
$summary = is_array($summaryAssessment ?? null) ? $summaryAssessment : null;
$tone = (string) ($summary['tone'] ?? 'warning');
$headline = (string) ($summary['headline'] ?? 'Baseline compare needs review.');
$supportingMessage = $summary['supportingMessage'] ?? null;
$nextAction = is_array($summary['nextAction'] ?? null) ? $summary['nextAction'] : ['label' => 'Review compare detail', 'target' => 'none'];
[$wrapperClasses, $textClasses] = match ($tone) {
'danger' => [
'rounded-lg border border-danger-300 bg-danger-50 p-4 dark:border-danger-700 dark:bg-danger-950/40',
'text-danger-900 dark:text-danger-100',
],
'info' => [
'rounded-lg border border-info-300 bg-info-50 p-4 dark:border-info-700 dark:bg-info-950/40',
'text-info-900 dark:text-info-100',
],
'gray' => [
'rounded-lg border border-gray-200 bg-gray-50 p-4 dark:border-gray-800 dark:bg-white/5',
'text-gray-900 dark:text-white',
],
default => [
'rounded-lg border border-warning-300 bg-warning-50 p-4 dark:border-warning-700 dark:bg-warning-950/40',
'text-warning-900 dark:text-warning-100',
],
};
@endphp
<div>
@if ($shouldShow && $summary)
<div class="{{ $wrapperClasses }}">
<div class="flex flex-col gap-2">
<div class="text-sm font-semibold {{ $textClasses }}">
{{ $headline }}
</div>
@if (filled($supportingMessage))
<div class="text-sm">
{{ $supportingMessage }}
</div>
@endif
@if (filled($nextActionUrl))
<div class="mt-1">
<a class="text-sm font-medium text-primary-600 hover:underline dark:text-primary-400" href="{{ $nextActionUrl }}">
{{ $nextAction['label'] }}
</a>
</div>
@elseif (filled($nextAction['label'] ?? null))
<div class="text-xs font-medium uppercase tracking-wide">
{{ $nextAction['label'] }}
</div>
@endif
</div>
</div>
@endif
</div>