fix: stop panel widgets on managed-tenants landing

This commit is contained in:
Ahmed Darrazi 2026-02-22 18:29:58 +01:00
parent 797728a243
commit 9fd8cdef83
3 changed files with 23 additions and 3 deletions

View File

@ -26,6 +26,18 @@ class ManagedTenantsLanding extends Page
public Workspace $workspace;
/**
* The Filament simple layout renders the topbar by default, which includes
* lazy-loaded database notifications. On this workspace-scoped landing page,
* those background Livewire requests currently 404.
*/
protected function getLayoutData(): array
{
return [
'hasTopbar' => false,
];
}
public function mount(Workspace $workspace): void
{
$this->workspace = $workspace;

View File

@ -163,9 +163,11 @@ public function panel(Panel $panel): Panel
)
->renderHook(
PanelsRenderHook::BODY_END,
fn () => (bool) config('tenantpilot.bulk_operations.progress_widget_enabled', true)
? view('livewire.bulk-operation-progress-wrapper')->render()
: ''
fn (): string => request()->routeIs('admin.workspace.managed-tenants.index')
? ''
: ((bool) config('tenantpilot.bulk_operations.progress_widget_enabled', true)
? view('livewire.bulk-operation-progress-wrapper')->render()
: '')
)
->resources([
TenantResource::class,

View File

@ -34,6 +34,12 @@
$html = $response->getContent();
// This landing page must not include Livewire-driven panel widgets that
// trigger background updates (lazy-loaded database notifications, progress poller).
expect($html)->not->toContain('Filament\\Livewire\\DatabaseNotifications');
expect($html)->not->toContain('__lazyLoad');
expect($html)->not->toContain('opsUxProgressWidgetPoller');
// 2. Extract the first Livewire component snapshot
preg_match('/wire:snapshot="([^"]+)"/', $html, $snapshotMatch);
expect($snapshotMatch)->not->toBeEmpty('No Livewire snapshot found in page HTML');