diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md index 167db9f1c..9a9e184fc 100644 --- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md +++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md @@ -3586,3 +3586,7 @@ frontend-primitives-owned Standalone surface rather than a new primary nav item. The page may show availability checks beside standalone Pulse Agent machines and provide a focused availability tab, but Settings remains the add/edit owner and the app shell must not add a separate top-level Availability destination. +The Standalone overview must not duplicate the focused availability table: +overview may show standalone Pulse Agent machines and a compact handoff when an +estate only has agentless checks, while the full availability-check row list +belongs to the Availability checks tab. diff --git a/frontend-modern/src/features/standalone/StandalonePageSurface.tsx b/frontend-modern/src/features/standalone/StandalonePageSurface.tsx index 19703e6c5..beeaeb3e7 100644 --- a/frontend-modern/src/features/standalone/StandalonePageSurface.tsx +++ b/frontend-modern/src/features/standalone/StandalonePageSurface.tsx @@ -27,6 +27,8 @@ type StandaloneTabId = (typeof STANDALONE_TAB_SPECS)[number]['id']; const machineIcon = () => ; const availabilityIcon = () => ; +const overviewActionClass = + 'inline-flex items-center gap-2 rounded-md border border-border bg-surface px-3 py-1.5 text-xs font-medium text-base-content shadow-sm hover:bg-slate-50'; const resolveStandaloneTab = (pathname: string): StandaloneTabId => pathname.replace(/\/+$/, '') === buildStandalonePath('availability') @@ -134,7 +136,24 @@ export function StandalonePageSurface() { } >
- 0}> + 0} + fallback={ + 0}> + + + View checks + + } + /> + + } + > - 0}> - -
diff --git a/frontend-modern/src/features/standalone/__tests__/StandalonePageSurface.test.tsx b/frontend-modern/src/features/standalone/__tests__/StandalonePageSurface.test.tsx index 1512541be..27897860f 100644 --- a/frontend-modern/src/features/standalone/__tests__/StandalonePageSurface.test.tsx +++ b/frontend-modern/src/features/standalone/__tests__/StandalonePageSurface.test.tsx @@ -55,7 +55,12 @@ vi.mock('@/features/platformPage/sharedPlatformPage', () => ({ data-tabs={props.tabs.map((tab) => tab.id).join(',')} /> ), - PlatformTableEmptyState: () =>
, + PlatformTableEmptyState: (props: { title: string; actions?: JSX.Element }) => ( +
+ {props.title} + {props.actions} +
+ ), PlatformTableLoadingState: () =>
, })); @@ -97,7 +102,7 @@ afterEach(() => { }); describe('StandalonePageSurface', () => { - it('loads standalone machines and agentless availability checks into the Standalone surface', () => { + it('keeps overview focused on standalone machines without duplicating availability rows', () => { render(() => ); expect(mocks.useUnifiedResources).toHaveBeenCalledWith( @@ -113,10 +118,7 @@ describe('StandalonePageSurface', () => { 'data-resource-count', '1', ); - expect(screen.getByTestId('availability-checks-table')).toHaveAttribute( - 'data-resource-count', - '1', - ); + expect(screen.queryByTestId('availability-checks-table')).not.toBeInTheDocument(); }); it('uses the availability tab as a focused check monitor', () => { @@ -134,4 +136,30 @@ describe('StandalonePageSurface', () => { '1', ); }); + + it('uses an overview handoff when only agentless availability checks are present', () => { + mocks.useUnifiedResources.mockReturnValue({ + resources: () => [ + resource({ + id: 'mqtt-meter', + type: 'network-endpoint', + platformType: 'availability', + sources: ['availability'], + }), + ], + loading: () => false, + error: () => null, + refetch: vi.fn(), + }); + + render(() => ); + + expect(screen.queryByTestId('agents-machines-table')).not.toBeInTheDocument(); + expect(screen.queryByTestId('availability-checks-table')).not.toBeInTheDocument(); + expect(screen.getByText('No standalone Pulse Agent machines')).toBeInTheDocument(); + expect(screen.getByRole('link', { name: 'View checks' })).toHaveAttribute( + 'href', + '/standalone/availability', + ); + }); });