TenantAtlas/resources/views/filament/widgets/workspace/workspace-recent-operations.blade.php
ahmido 98be510362 feat: harden workspace governance attention foundation (#206)
## Summary
- harden the workspace overview into a governance-aware attention surface that separates governance risk from activity and keeps calm states honest
- add tenant-bound attention, workspace-wide operations continuity, and low-permission fallback behavior for workspace-originated operations drill-through
- add the full Spec 175 artifact set and focused workspace overview regression coverage, plus align remaining operation-viewer wording and guard expectations so the suite stays green

## Testing
- `vendor/bin/sail artisan test --compact tests/Feature/Filament/WorkspaceOverviewAccessTest.php tests/Feature/Filament/WorkspaceOverviewAuthorizationTest.php tests/Feature/Filament/WorkspaceOverviewLandingTest.php tests/Feature/Filament/WorkspaceOverviewNavigationTest.php tests/Feature/Filament/WorkspaceOverviewContentTest.php tests/Feature/Filament/WorkspaceOverviewEmptyStatesTest.php tests/Feature/Filament/WorkspaceOverviewPermissionVisibilityTest.php tests/Feature/Filament/WorkspaceOverviewOperationsTest.php tests/Feature/Filament/WorkspaceOverviewDbOnlyTest.php tests/Feature/Filament/WorkspaceOverviewGovernanceAttentionTest.php tests/Feature/Filament/WorkspaceOverviewSummaryMetricsTest.php tests/Feature/Filament/WorkspaceOverviewDrilldownContinuityTest.php`
- `vendor/bin/sail artisan test --compact tests/Unit/Support/RelatedActionLabelCatalogTest.php tests/Feature/078/VerificationReportTenantlessTest.php tests/Feature/144/CanonicalOperationViewerContextMismatchTest.php tests/Feature/Baselines/BaselineCompareSummaryAssessmentTest.php tests/Feature/Baselines/TenantGovernanceAggregateResolverTest.php tests/Feature/Filament/ReferencedTenantLifecyclePresentationTest.php tests/Feature/Guards/NoAdHocFilamentAuthPatternsTest.php tests/Feature/Monitoring/AuditLogInspectFlowTest.php tests/Feature/Monitoring/HeaderContextBarTest.php tests/Feature/Monitoring/OperationLifecycleFreshnessPresentationTest.php tests/Feature/Monitoring/OperationRunResolvedReferencePresentationTest.php tests/Feature/Notifications/OperationRunNotificationTest.php tests/Feature/OpsUx/QueuedToastCopyTest.php tests/Feature/OpsUx/TerminalNotificationFailureMessageTest.php tests/Feature/System/OpsRunbooks/OpsUxStartSurfaceContractTest.php tests/Feature/Verification/VerificationReportRedactionTest.php`
- `vendor/bin/sail bin pint --dirty --format agent`
- `vendor/bin/sail artisan test --compact`

## Notes
- branch pushed as `175-workspace-governance-attention`
- full suite result: `3235 passed, 8 skipped`

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #206
2026-04-04 21:14:43 +00:00

84 lines
4.2 KiB
PHP

<x-filament::section heading="Recent operations">
<p class="mb-4 text-xs leading-5 text-gray-500 dark:text-gray-400">
Diagnostic recency across your visible workspace slice. This does not define governance health on its own.
</p>
@if ($operations === [])
<div class="flex h-full flex-col justify-between gap-4">
<div class="space-y-2">
<p class="text-sm font-medium text-gray-950 dark:text-white">
{{ $emptyState['title'] ?? 'No recent operations yet' }}
</p>
<p class="text-sm leading-6 text-gray-600 dark:text-gray-300">
{{ $emptyState['body'] ?? 'Workspace-wide activity will show up here once syncs, evaluations, or restores start running.' }}
</p>
</div>
@if (filled($emptyState['action_url'] ?? null))
<div>
<x-filament::link :href="$emptyState['action_url']" size="sm">
{{ $emptyState['action_label'] ?? 'Open operations' }}
</x-filament::link>
</div>
@endif
</div>
@else
<div class="space-y-3">
@foreach ($operations as $operation)
@php
$destination = $operation['destination'] ?? null;
$actionUrl = is_array($destination) ? ($destination['url'] ?? null) : ($operation['url'] ?? null);
@endphp
<div class="rounded-xl border border-gray-200 bg-gray-50 p-4 dark:border-white/10 dark:bg-white/5">
<div class="space-y-3">
<div class="flex items-start justify-between gap-3">
<div class="min-w-0 space-y-2">
<div class="flex flex-wrap items-center gap-2">
<div class="text-sm font-semibold text-gray-950 dark:text-white">
{{ $operation['title'] }}
</div>
@if (filled($operation['tenant_label'] ?? null))
<span class="inline-flex items-center rounded-full border border-gray-200 bg-white px-2 py-0.5 text-xs font-medium text-gray-600 dark:border-white/10 dark:bg-white/10 dark:text-gray-300">
{{ $operation['tenant_label'] }}
</span>
@endif
</div>
<div class="flex flex-wrap items-center gap-2">
<x-filament::badge :color="$operation['status_color']" size="sm">
{{ $operation['status_label'] }}
</x-filament::badge>
<x-filament::badge :color="$operation['outcome_color']" size="sm">
{{ $operation['outcome_label'] }}
</x-filament::badge>
</div>
@if (filled($operation['guidance'] ?? null))
<p class="text-xs leading-5 text-gray-600 dark:text-gray-300">
{{ $operation['guidance'] }}
</p>
@endif
</div>
<div class="shrink-0 text-xs text-gray-500 dark:text-gray-400">
{{ $operation['started_at'] }}
</div>
</div>
@if (is_string($actionUrl) && $actionUrl !== '')
<div>
<x-filament::link :href="$actionUrl" size="sm">
{{ $destination['label'] ?? 'Open operation' }}
</x-filament::link>
</div>
@endif
</div>
</div>
@endforeach
</div>
@endif
</x-filament::section>