Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Delete final cascade orphans (agentDeploy + InteractiveSparkline)

rcourtman89d289461a4a
diff --git a/frontend-modern/src/api/__tests__/apiErrorStatus.guardrails.test.ts b/frontend-modern/src/api/__tests__/apiErrorStatus.guardrails.test.ts
index 9254a599c7..42efc30e1a 100644
--- a/frontend-modern/src/api/__tests__/apiErrorStatus.guardrails.test.ts
+++ b/frontend-modern/src/api/__tests__/apiErrorStatus.guardrails.test.ts
@@ -5,7 +5,6 @@ import agentProfilesSource from '@/api/agentProfiles.ts?raw';
import alertsSource from '@/api/alerts.ts?raw';
import discoverySource from '@/api/discovery.ts?raw';
import agentMetadataSource from '@/api/agentMetadata.ts?raw';
-import hostedSignupSource from '@/api/hostedSignup.ts?raw';
import monitoringSource from '@/api/monitoring.ts?raw';
import notificationsSource from '@/api/notifications.ts?raw';
import nodesSource from '@/api/nodes.ts?raw';
@@ -179,12 +178,6 @@ describe('API error-status guardrails', () => {
expect(guestMetadataSource).toContain("buildMetadataAPI<GuestMetadata>('/api/guests/metadata')");
expect(guestMetadataSource).not.toContain('apiFetchJSON(');
- expect(hostedSignupSource).toContain('parseJSONSafe<');
- expect(hostedSignupSource).toContain('normalizeStructuredAPIError(body, response.status)');
- expect(hostedSignupSource).not.toContain('response.json()');
- expect(hostedSignupSource).not.toContain('function normalizeHostedError(');
- expect(hostedSignupSource).not.toContain("typeof obj.code === 'string'");
- expect(hostedSignupSource).not.toContain("typeof obj.message === 'string'");
});
it('routes canonical collection normalization through responseUtils', () => {
@@ -261,7 +254,7 @@ describe('API error-status guardrails', () => {
const rawStatusHeuristicPattern = /message\.includes\((['"])40[24]\1\)/;
const rawGovernedResponseStatusPattern = /response\.status\s*(?:===|!==)\s*(?:204|404|503)/;
const governedParsingEntries = runtimeEntries.filter(([path]) =>
- /\/(?:ai|aiChat|agentProfiles|discovery|hostedSignup|monitoring)\.ts$/.test(path),
+ /\/(?:ai|aiChat|agentProfiles|discovery|monitoring)\.ts$/.test(path),
);
const rawResponseJSONPattern = /(?:return\s+)?(?:await\s+)?response\.json\(/;
const rawManualJSONParsePattern = /JSON\.parse\(/;
diff --git a/frontend-modern/src/api/agentDeploy.ts b/frontend-modern/src/api/agentDeploy.ts
deleted file mode 100644
index dab3a753e9..0000000000
--- a/frontend-modern/src/api/agentDeploy.ts
+++ /dev/null
@@ -1,63 +0,0 @@
-import { apiFetchJSON } from '@/utils/apiClient';
-import type {
- CandidatesResponse,
- CreatePreflightRequest,
- CreatePreflightResponse,
- CreateJobRequest,
- CreateJobResponse,
- DeployJob,
- RetryJobResponse,
-} from '@/types/agentDeploy';
-
-export class AgentDeployAPI {
- static async getCandidates(clusterId: string): Promise<CandidatesResponse> {
- return apiFetchJSON(
- `/api/clusters/${encodeURIComponent(clusterId)}/agent-deploy/candidates`,
- ) as Promise<CandidatesResponse>;
- }
-
- static async createPreflight(
- clusterId: string,
- req: CreatePreflightRequest,
- ): Promise<CreatePreflightResponse> {
- return apiFetchJSON(`/api/clusters/${encodeURIComponent(clusterId)}/agent-deploy/preflights`, {
- method: 'POST',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify(req),
- }) as Promise<CreatePreflightResponse>;
- }
-
- static async getPreflight(preflightId: string): Promise<DeployJob> {
- return apiFetchJSON(
- `/api/agent-deploy/preflights/${encodeURIComponent(preflightId)}`,
- ) as Promise<DeployJob>;
- }
-
- static async createJob(clusterId: string, req: CreateJobRequest): Promise<CreateJobResponse> {
- return apiFetchJSON(`/api/clusters/${encodeURIComponent(clusterId)}/agent-deploy/jobs`, {
- method: 'POST',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify(req),
- }) as Promise<CreateJobResponse>;
- }
-
- static async getJob(jobId: string): Promise<DeployJob> {
- return apiFetchJSON(
- `/api/agent-deploy/jobs/${encodeURIComponent(jobId)}`,
- ) as Promise<DeployJob>;
- }
-
- static async cancelJob(jobId: string): Promise<void> {
- await apiFetchJSON(`/api/agent-deploy/jobs/${encodeURIComponent(jobId)}/cancel`, {
- method: 'POST',
- });
- }
-
- static async retryJob(jobId: string, targetIds?: string[]): Promise<RetryJobResponse> {
- return apiFetchJSON(`/api/agent-deploy/jobs/${encodeURIComponent(jobId)}/retry`, {
- method: 'POST',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify(targetIds ? { targetIds } : {}),
- }) as Promise<RetryJobResponse>;
- }
-}
diff --git a/frontend-modern/src/components/shared/InteractiveSparkline.tsx b/frontend-modern/src/components/shared/InteractiveSparkline.tsx
deleted file mode 100644
index ddba7188c9..0000000000
--- a/frontend-modern/src/components/shared/InteractiveSparkline.tsx
+++ /dev/null
@@ -1,284 +0,0 @@
-import { Component, For, Show } from 'solid-js';
-import {
- formatInteractiveSparklineHoverTime,
- type InteractiveSparklineProps,
-} from './interactiveSparklineModel';
-import { TooltipPortal } from './TooltipPortal';
-import { useInteractiveSparklineState } from './useInteractiveSparklineState';
-
-export type {
- InteractiveSparklineProps,
- InteractiveSparklineSeries,
-} from './interactiveSparklineModel';
-
-const verticalTextBaseline = (anchor: 'top' | 'middle' | 'bottom') =>
- anchor === 'top' ? 'hanging' : anchor === 'bottom' ? 'text-bottom' : 'middle';
-
-const horizontalTextAnchor = (anchor: 'start' | 'middle' | 'end') => anchor;
-const axisPositionPercent = (value: number, total: number) => `${(value / total) * 100}%`;
-const sparklineLeftInsetClass = (size?: InteractiveSparklineProps['size']) =>
- size === 'lg' ? 'ml-10' : 'ml-8';
-const sparklineYAxisWidthClass = (size?: InteractiveSparklineProps['size']) =>
- size === 'lg' ? 'w-10' : 'w-8';
-const sparklineXAxisHeightClass = (size?: InteractiveSparklineProps['size']) =>
- size === 'lg' ? 'h-5' : 'h-4';
-const sparklineYAxisFontSize = (size?: InteractiveSparklineProps['size']) =>
- size === 'lg' ? '12' : '10';
-const sparklineXAxisFontSize = (size?: InteractiveSparklineProps['size']) =>
- size === 'lg' ? '12' : '10';
-
-export const InteractiveSparkline: Component<InteractiveSparklineProps> = (props) => {
- let chartSurfaceRef: Element | undefined;
- let canvasRef: HTMLCanvasElement | undefined;
- let canvasHostRef: HTMLDivElement | undefined;
- const interactionState = () => props.interactionState ?? 'default';
- const inactiveSeriesColor = () =>
- typeof document !== 'undefined' && document.documentElement.classList.contains('dark')
- ? 'rgb(148, 163, 184)'
- : 'rgb(100, 116, 139)';
-
- const sparkline = useInteractiveSparklineState(props, {
- getCanvas: () => canvasRef,
- getCanvasHost: () => canvasHostRef,
- getChartSurface: () => chartSurfaceRef,
- });
-
- return (
- <div
- class={`w-full h-full min-h-[88px] flex flex-col transition-opacity duration-150 ease-out ${
- interactionState() === 'inactive' ? 'opacity-35' : 'opacity-100'
- }`.trim()}
- data-highlight-series-id={props.highlightSeriesId ?? ''}
- data-highlight-series-active={sparkline.externalSeriesIndex() !== null ? 'true' : 'false'}
- data-active-hover-timestamp={sparkline.activeHoverTimestamp() ?? ''}
- data-active-hover-cursor-x={sparkline.activeHoverCursorX() ?? ''}
- data-active-series-display={sparkline.activeSeriesDisplay()}
- data-rendered-series-count={sparkline.renderedSeriesCount()}
- data-summary-chart-state={interactionState()}
- >
- <div class="relative flex-1 min-h-0">
- <div class={`h-full mr-3 ${sparklineLeftInsetClass(props.size)}`} ref={canvasHostRef}>
- <Show
- when={sparkline.shouldUseCanvas()}
- fallback={
- <svg
- ref={(element) => {
- chartSurfaceRef = element;
- }}
- class="w-full h-full cursor-crosshair"
- viewBox={`0 0 ${sparkline.vbW} ${sparkline.vbH}`}
- preserveAspectRatio="none"
- onMouseMove={sparkline.handleMouseMove}
- onMouseLeave={sparkline.handleMouseLeave}
- onClick={sparkline.handleClick}
- >
- <Show when={sparkline.chartData().validSeries.length === 1}>
- <defs>
- <linearGradient id="single-series-area" x1="0" y1="0" x2="0" y2="1">
- <stop
- offset="0%"
- stop-color={sparkline.chartData().validSeries[0].color}
- stop-opacity="0.25"
- />
- <stop
- offset="100%"
- stop-color={sparkline.chartData().validSeries[0].color}
- stop-opacity="0"
- />
- </linearGradient>
- </defs>
- </Show>
- <For each={sparkline.gridLineY()}>
- {(y, index) => (
- <line
- x1="0"
- y1={y}
- x2={sparkline.vbW}
- y2={y}
- stroke="currentColor"
- stroke-opacity={index() === 1 ? '0.1' : '0.06'}
- stroke-width="0.5"
- />
- )}
- </For>
-
- <For each={sparkline.gridLineX()}>
- {(x) => (
- <line
- x1={x}
- y1="0"
- x2={x}
- y2={sparkline.vbH}
- stroke="currentColor"
- stroke-opacity="0.04"
- stroke-width="0.5"
- />
- )}
- </For>
-
- <Show when={sparkline.activeHoverCursorX() !== null}>
- <line
- x1={sparkline.activeHoverCursorX() ?? 0}
- y1={0}
- x2={sparkline.activeHoverCursorX() ?? 0}
- y2={sparkline.vbH}
- stroke="currentColor"
- stroke-opacity="0.45"
- stroke-width="1"
- stroke-dasharray="3 3"
- vector-effect="non-scaling-stroke"
- />
- </Show>
-
- <For each={sparkline.chartData().paths}>
- {(pathData) => (
- <Show when={sparkline.shouldRenderSeries(pathData.seriesIndex)}>
- <g>
- <Show when={pathData.areaPath}>
- <path
- d={pathData.areaPath}
- fill="url(#single-series-area)"
- stroke="none"
- />
- </Show>
- <path
- d={pathData.path}
- fill="none"
- stroke={(() => {
- const active = sparkline.activeEmphasisSeriesIndex();
- if (active !== null && active !== pathData.seriesIndex) {
- return inactiveSeriesColor();
- }
- return pathData.color;
- })()}
- stroke-width={sparkline.lineWidthForSeries(pathData.seriesIndex)}
- stroke-linecap="round"
- stroke-linejoin="round"
- opacity={sparkline.opacityForSeries(pathData.seriesIndex)}
- class="transition-all duration-100 ease-linear"
- vector-effect="non-scaling-stroke"
- />
- </g>
- </Show>
- )}
- </For>
- </svg>
- }
- >
- <canvas
- ref={(element) => {
- canvasRef = element;
- chartSurfaceRef = element;
- }}
- class="w-full h-full cursor-crosshair block"
- onMouseMove={sparkline.handleMouseMove}
- onMouseLeave={sparkline.handleMouseLeave}
- onClick={sparkline.handleClick}
- />
- </Show>
- <svg
- class="pointer-events-none absolute inset-0 h-full w-full overflow-visible"
- viewBox={`0 0 ${sparkline.vbW} ${sparkline.vbH}`}
- preserveAspectRatio="none"
- aria-hidden="true"
- >
- </svg>
- </div>
- <div
- class={`absolute inset-y-0 left-0 pointer-events-none ${sparklineYAxisWidthClass(props.size)}`}
- >
- <svg
- data-sparkline-y-axis="true"
- class="h-full w-full overflow-visible text-muted tabular-nums"
- aria-hidden="true"
- >
- <For each={sparkline.axisTicks()}>
- {(tick) => (
- <text
- x="0"
- y={axisPositionPercent(tick.y, sparkline.vbH)}
- fill="currentColor"
- font-size={sparklineYAxisFontSize(props.size)}
- class="transition-all duration-300 ease-out"
- dominant-baseline={verticalTextBaseline(tick.anchor)}
- >
- {tick.label}
- </text>
- )}
- </For>
- </svg>
- </div>
- </div>
- <div
- class={`relative pointer-events-none mr-3 ${sparklineLeftInsetClass(props.size)} ${sparklineXAxisHeightClass(props.size)}`}
- >
- <svg
- data-sparkline-x-axis="true"
- class="h-full w-full overflow-visible text-muted tabular-nums"
- aria-hidden="true"
- >
- <For each={sparkline.xAxisTicks()}>
- {(tick) => (
- <text
- x={axisPositionPercent(tick.x, sparkline.vbW)}
- y="2"
- fill="currentColor"
- font-size={sparklineXAxisFontSize(props.size)}
- font-weight="500"
- class="transition-all duration-300 ease-out"
- text-anchor={horizontalTextAnchor(tick.anchor)}
- dominant-baseline="hanging"
- >
- {tick.label}
- </text>
- )}
- </For>
- </svg>
- </div>
- <Show when={sparkline.hoveredState()}>
- {(hover) => (
- <TooltipPortal when={true} x={hover().tooltipX} y={hover().tooltipY} align="left">
- <div
- data-sparkline-tooltip="true"
- class={`max-w-[220px] text-[10px] ${
- hover().focusedTooltip ? 'min-w-[112px]' : 'min-w-[138px]'
- }`}
- >
- <div class="mb-1 text-center font-medium text-base-content">
- {formatInteractiveSparklineHoverTime(hover().timestamp)}
- </div>
- <For each={hover().values}>
- {(entry) => (
- <div
- class={`flex items-center gap-1.5 leading-tight ${
- props.highlightNearestSeriesOnHover &&
- hover().focusedTooltip &&
- hover().highlightedSeriesIndex === entry.seriesIndex
- ? 'rounded px-1 bg-slate-400/15'
- : ''
- }`}
- >
- <svg class="h-2 w-2 shrink-0" viewBox="0 0 8 8" aria-hidden="true">
- <circle cx="4" cy="4" r="4" fill={entry.color} />
- </svg>
- <span class="text-muted">{entry.name}</span>
- <span class="ml-auto font-medium text-base-content">
- {sparkline.formatValue(entry.value)}
- </span>
- </div>
- )}
- </For>
- <Show when={hover().totalValues > hover().values.length}>
- <div class="mt-0.5 text-[10px] text-muted">
- +{hover().totalValues - hover().values.length} more series
- </div>
- </Show>
- </div>
- </TooltipPortal>
- )}
- </Show>
- </div>
- );
-};
-
-export default InteractiveSparkline;
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index a90489b1e9..54fd82aeaa 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -9,10 +9,8 @@ import columnPickerSource from '@/components/shared/ColumnPicker.tsx?raw';
import columnPickerModelSource from '@/components/shared/columnPickerModel.ts?raw';
import tagInputSource from '@/components/shared/TagInput.tsx?raw';
import tagInputModelSource from '@/components/shared/tagInputModel.ts?raw';
-import collapsibleSearchInputModelSource from '@/components/shared/collapsibleSearchInputModel.ts?raw';
import containerUpdateBadgeSource from '@/components/shared/ContainerUpdateBadge.tsx?raw';
import containerUpdateBadgeModelSource from '@/components/shared/containerUpdateBadgeModel.ts?raw';
-import densityMapModelSource from '@/components/shared/densityMapModel.ts?raw';
import dialogSource from '@/components/shared/Dialog.tsx?raw';
import dialogModelSource from '@/components/shared/dialogModel.ts?raw';
import filterButtonGroupSource from '@/components/shared/FilterButtonGroup.tsx?raw';
@@ -26,7 +24,6 @@ import historyChartOverlaySource from '@/components/shared/HistoryChartOverlay.t
import historyChartSource from '@/components/shared/HistoryChart.tsx?raw';
import historyChartModelSource from '@/components/shared/historyChartModel.ts?raw';
import historyChartTooltipSource from '@/components/shared/HistoryChartTooltip.tsx?raw';
-import infrastructureDetailsDrawerModelSource from '@/components/shared/infrastructureDetailsDrawerModel.ts?raw';
import mobileNavBarSource from '@/components/shared/MobileNavBar.tsx?raw';
import mobileNavBarModelSource from '@/components/shared/mobileNavBarModel.ts?raw';
import pulseDataGridSource from '@/components/shared/PulseDataGrid.tsx?raw';
@@ -38,7 +35,6 @@ import searchInputSource from '@/components/shared/SearchInput.tsx?raw';
import searchInputEnhancementsSource from '@/components/shared/SearchInputEnhancements.tsx?raw';
import searchInputEnhancementsModelSource from '@/components/shared/searchInputEnhancementsModel.ts?raw';
import searchInputModelSource from '@/components/shared/searchInputModel.ts?raw';
-import scrollToTopButtonModelSource from '@/components/shared/scrollToTopButtonModel.ts?raw';
import statusBadgeSource from '@/components/shared/StatusBadge.tsx?raw';
import statusBadgeModelSource from '@/components/shared/statusBadgeModel.ts?raw';
import subtabsSource from '@/components/shared/Subtabs.tsx?raw';
@@ -50,7 +46,6 @@ import tooltipSource from '@/components/shared/Tooltip.tsx?raw';
import tooltipPortalSource from '@/components/shared/TooltipPortal.tsx?raw';
import tooltipModelSource from '@/components/shared/tooltipModel.ts?raw';
import upgradeLinkSource from '@/components/shared/UpgradeLink.tsx?raw';
-import interactiveSparklineSource from '@/components/shared/InteractiveSparkline.tsx?raw';
import interactiveSparklineModelSource from '@/components/shared/interactiveSparklineModel.ts?raw';
import contextualFocusSource from '@/components/shared/contextualFocus.ts?raw';
import summaryCardInteractionSource from '@/components/shared/summaryCardInteraction.ts?raw';
@@ -75,20 +70,16 @@ import tlsVerificationWarningBannerSource from '@/components/shared/TlsVerificat
import commandPaletteStateSource from '@/components/shared/useCommandPaletteState.ts?raw';
import columnPickerStateSource from '@/components/shared/useColumnPickerState.ts?raw';
import tagInputStateSource from '@/components/shared/useTagInputState.ts?raw';
-import collapsibleSearchInputStateSource from '@/components/shared/useCollapsibleSearchInputState.ts?raw';
import containerUpdateButtonStateSource from '@/components/shared/useContainerUpdateButtonState.ts?raw';
-import densityMapStateSource from '@/components/shared/useDensityMapState.ts?raw';
import dialogStateSource from '@/components/shared/useDialogState.ts?raw';
import filterButtonGroupStateSource from '@/components/shared/useFilterButtonGroupState.ts?raw';
import helpIconStateSource from '@/components/shared/useHelpIconState.ts?raw';
import historyChartStateSource from '@/components/shared/useHistoryChartState.ts?raw';
-import infrastructureDetailsDrawerStateSource from '@/components/shared/useInfrastructureDetailsDrawerState.ts?raw';
import mobileNavBarStateSource from '@/components/shared/useMobileNavBarState.ts?raw';
import pulseDataGridStateSource from '@/components/shared/usePulseDataGridState.ts?raw';
import searchFieldStateSource from '@/components/shared/useSearchFieldState.ts?raw';
import searchInputStateSource from '@/components/shared/useSearchInputState.ts?raw';
import searchInputEnhancementsStateSource from '@/components/shared/useSearchInputEnhancements.ts?raw';
-import scrollToTopButtonStateSource from '@/components/shared/useScrollToTopButtonState.ts?raw';
import statusBadgeStateSource from '@/components/shared/useStatusBadgeState.ts?raw';
import toggleStateSource from '@/components/shared/useToggleState.ts?raw';
import searchTipsPopoverStateSource from '@/components/shared/useSearchTipsPopoverState.ts?raw';
@@ -126,8 +117,6 @@ import alertHistoryTableSectionSource from '@/features/alerts/AlertHistoryTableS
import alertHistoryTableGroupRowSource from '@/features/alerts/AlertHistoryTableGroupRow.tsx?raw';
import alertResourceTableDesktopSource from '@/components/Alerts/AlertResourceTableDesktop.tsx?raw';
import aiCostDashboardSource from '@/components/AI/AICostDashboard.tsx?raw';
-import pmgMailGatewaySource from '@/components/PMG/MailGateway.tsx?raw';
-import pmgInstancePanelSource from '@/components/PMG/PMGInstancePanel.tsx?raw';
import resourceDetailSummarySource from '@/components/Infrastructure/ResourceDetailSummary.tsx?raw';
import aiSettingsDialogsSource from '@/components/Settings/AISettingsDialogs.tsx?raw';
import agentProfilesPanelSource from '@/components/Settings/AgentProfilesPanel.tsx?raw';
@@ -298,9 +287,6 @@ describe('shared primitive guardrails', () => {
expect(tooltipPortalSource).toContain('text-base-content');
expect(tooltipPortalSource).toContain('border-border');
expect(tooltipPortalSource).not.toContain("'background-color': 'rgb(15, 23, 42)'");
- expect(interactiveSparklineSource).toContain('TooltipPortal');
- expect(interactiveSparklineSource).toContain('text-base-content');
- expect(interactiveSparklineSource).not.toContain("'background-color': 'rgb(15, 23, 42)'");
});
it('keeps shared table card chrome on one canonical header owner', () => {
@@ -368,7 +354,6 @@ describe('shared primitive guardrails', () => {
expect(summaryCardInteractionSource).toContain('resolveSummaryGroupMemberInteractionState');
expect(summaryCardInteractionSource).toContain('resolveSummaryScopeState');
expect(interactiveSparklineModelSource).toContain('onHoverSyncChange');
- expect(densityMapModelSource).toContain('onHoverSyncChange');
expect(workloadSelectionStateSource).toContain('preserveScrollableAncestorVerticalOffset');
expect(workloadSelectionStateSource).toContain('hoveredWorkloadGroupScope');
@@ -405,7 +390,6 @@ describe('shared primitive guardrails', () => {
expect(interactiveSparklineModelSource).toContain(
'buildInteractiveSparklineSynchronizedReadout',
);
- expect(densityMapModelSource).toContain('buildDensityMapSynchronizedReadout');
});
@@ -499,8 +483,6 @@ describe('shared primitive guardrails', () => {
infrastructureSourceManagerSource,
aiCostDashboardSource,
proxmoxMailGatewayDrawerSource,
- pmgInstancePanelSource,
- pmgMailGatewaySource,
pulseDataGridSource,
swarmServicesDrawerSource,
k8sDeploymentsDrawerSource,
@@ -708,18 +690,7 @@ describe('shared primitive guardrails', () => {
it('keeps scroll-to-top button on shell, runtime, and model owners', () => {
- expect(scrollToTopButtonStateSource).toContain('export function useScrollToTopButtonState');
- expect(scrollToTopButtonStateSource).toContain('createSignal');
- expect(scrollToTopButtonStateSource).toContain('onMount');
- expect(scrollToTopButtonStateSource).toContain('addEventListener');
- expect(scrollToTopButtonStateSource).toContain("scrollTo({ top: 0, behavior: 'smooth' })");
- expect(scrollToTopButtonStateSource).toContain('findNearestScrollableAncestor');
-
- expect(scrollToTopButtonModelSource).toContain('SCROLL_TO_TOP_BUTTON_THRESHOLD');
- expect(scrollToTopButtonModelSource).toContain('SCROLL_TO_TOP_BUTTON_ARIA_LABEL');
- expect(scrollToTopButtonModelSource).toContain('findNearestScrollableAncestor');
- expect(scrollToTopButtonModelSource).toContain('isScrollToTopButtonVisible');
- expect(scrollToTopButtonModelSource).toContain('getScrollToTopButtonClass');
+
});
it('keeps toggle on shell, runtime, and model owners', () => {
@@ -802,29 +773,6 @@ describe('shared primitive guardrails', () => {
});
it('keeps interactive sparkline on shell, runtime, and model owners', () => {
- expect(interactiveSparklineSource).toContain('useInteractiveSparklineState');
- expect(interactiveSparklineSource).toContain('data-active-series-display');
- expect(interactiveSparklineSource).toContain('data-active-hover-cursor-x');
- expect(interactiveSparklineSource).toContain('data-sparkline-tooltip="true"');
- expect(interactiveSparklineSource).toContain('TooltipPortal');
- expect(interactiveSparklineSource).toContain('data-sparkline-y-axis="true"');
- expect(interactiveSparklineSource).toContain('data-sparkline-x-axis="true"');
- expect(interactiveSparklineSource).toContain('axisPositionPercent(tick.y, sparkline.vbH)');
- expect(interactiveSparklineSource).toContain('axisPositionPercent(tick.x, sparkline.vbW)');
- expect(interactiveSparklineSource).toContain('x1={sparkline.activeHoverCursorX() ?? 0}');
- expect(interactiveSparklineSource).toContain('y1={0}');
- expect(interactiveSparklineSource).not.toContain('viewBox={`0 0 28 ${sparkline.vbH}`}');
- expect(interactiveSparklineSource).not.toContain(
- 'viewBox={`0 0 ${sparkline.vbW} ${sparkline.xAxisBandPx}`}',
- );
- expect(interactiveSparklineSource).not.toContain('style={{');
- expect(interactiveSparklineSource).not.toContain('style={');
- expect(interactiveSparklineSource).not.toContain('{(cursorX) => (');
- expect(interactiveSparklineSource).toContain('data-rendered-series-count');
- expect(interactiveSparklineSource).not.toContain('createEffect');
- expect(interactiveSparklineSource).not.toContain('createSignal');
- expect(interactiveSparklineSource).not.toContain('scheduleSparkline');
- expect(interactiveSparklineSource).not.toContain('downsampleLTTB');
expect(interactiveSparklineStateSource).toContain(
'export function useInteractiveSparklineState',
@@ -844,7 +792,6 @@ describe('shared primitive guardrails', () => {
expect(interactiveSparklineModelSource).toContain('computeInteractiveSparklineHoverState');
expect(interactiveSparklineModelSource).toContain('getInteractiveSparklineCursorXForTimestamp');
expect(interactiveSparklineModelSource).toContain('getInteractiveSparklineTooltipSideX');
- expect(interactiveSparklineSource).toContain('align="left"');
expect(interactiveSparklineModelSource).toContain(
'const tooltipY = chartRect.top + mouseY - 6;',
);
@@ -854,21 +801,7 @@ describe('shared primitive guardrails', () => {
it('keeps density map on shell, runtime, and model owners', () => {
- expect(densityMapStateSource).toContain('export function useDensityMapState');
- expect(densityMapStateSource).toContain('createSignal');
- expect(densityMapStateSource).toContain('canvas.getContext');
- expect(densityMapStateSource).toContain('window.addEventListener');
-
- expect(densityMapModelSource).toContain('buildDensityMapChartData');
- expect(densityMapModelSource).toContain('buildDensityMapFocusDetail');
- expect(densityMapModelSource).toContain('buildDensityMapHoveredState');
- expect(densityMapModelSource).toContain('formatDensityMapHoverTime');
- expect(densityMapModelSource).toContain('getDensityMapColumnIndexForTimestamp');
- expect(densityMapModelSource).toContain('getDensityMapCellOpacity');
- expect(densityMapModelSource).not.toContain('buildDensityMapFocusSparklinePath');
- expect(densityMapModelSource).not.toContain('sparklinePath: string | null;');
- expect(densityMapModelSource).not.toContain('currentValue:');
- expect(densityMapModelSource).not.toContain('hoveredValue:');
+
});
it('keeps dialog on shell, runtime, and model owners', () => {
@@ -1014,22 +947,7 @@ describe('shared primitive guardrails', () => {
it('keeps infrastructure details drawer on shell, runtime, and model owners', () => {
- expect(infrastructureDetailsDrawerStateSource).toContain(
- 'export function useInfrastructureDetailsDrawerState',
- );
- expect(infrastructureDetailsDrawerStateSource).toContain('createSignal');
- expect(infrastructureDetailsDrawerStateSource).toContain(
- "type InfrastructureDetailsDrawerTab = 'overview' | 'discovery'",
- );
- expect(infrastructureDetailsDrawerModelSource).toContain(
- 'resolveInfrastructureDetailsDrawerMetadataId',
- );
- expect(infrastructureDetailsDrawerModelSource).toContain(
- 'resolveInfrastructureDetailsDrawerDiscoveryHostname',
- );
- expect(infrastructureDetailsDrawerModelSource).toContain('getInfrastructureMetadataId');
- expect(infrastructureDetailsDrawerModelSource).toContain('getInfrastructureDiscoveryHostname');
});
it('keeps mobile nav on shell, runtime, and model owners', () => {
@@ -1236,18 +1154,7 @@ describe('shared primitive guardrails', () => {
it('keeps collapsible search input on shell, runtime, and model owners', () => {
- expect(collapsibleSearchInputStateSource).toContain(
- 'export function useCollapsibleSearchInputState',
- );
- expect(collapsibleSearchInputStateSource).toContain('createSignal');
- expect(collapsibleSearchInputStateSource).toContain('useTypeToSearch');
- expect(collapsibleSearchInputStateSource).toContain('queueMicrotask');
- expect(collapsibleSearchInputStateSource).toContain('setIsExpanded(true)');
-
- expect(collapsibleSearchInputModelSource).toContain('getCollapsibleSearchTriggerLabel');
- expect(collapsibleSearchInputModelSource).toContain('shouldShowCollapsibleSearchExpanded');
- expect(collapsibleSearchInputModelSource).toContain('getCollapsibleSearchRootClass');
- expect(collapsibleSearchInputModelSource).toContain('order-last basis-full w-full');
+
});
it('keeps the chip-based FilterBar on a catalog descriptor with shell, chip, and add-menu owners', () => {
diff --git a/frontend-modern/src/components/shared/__tests__/InteractiveSparkline.test.tsx b/frontend-modern/src/components/shared/__tests__/InteractiveSparkline.test.tsx
deleted file mode 100644
index bb27e627ad..0000000000
--- a/frontend-modern/src/components/shared/__tests__/InteractiveSparkline.test.tsx
+++ /dev/null
@@ -1,816 +0,0 @@
-import { afterEach, describe, expect, it, vi } from 'vitest';
-import { cleanup, fireEvent, render, screen } from '@solidjs/testing-library';
-import { InteractiveSparkline } from '@/components/shared/InteractiveSparkline';
-import interactiveSparklineSource from '@/components/shared/InteractiveSparkline.tsx?raw';
-import interactiveSparklineModelSource from '@/components/shared/interactiveSparklineModel.ts?raw';
-import interactiveSparklineStateSource from '@/components/shared/useInteractiveSparklineState.ts?raw';
-import {
- buildInteractiveSparklineChartData,
- buildInteractiveSparklineSynchronizedReadout,
- computeInteractiveSparklineHoverState,
- getInteractiveSparklineTooltipSideX,
-} from '@/components/shared/interactiveSparklineModel';
-
-describe('InteractiveSparkline hover behavior', () => {
- afterEach(() => {
- vi.useRealTimers();
- vi.restoreAllMocks();
- cleanup();
- });
-
- const mockImmediateRaf = () =>
- vi
- .spyOn(window, 'requestAnimationFrame')
- .mockImplementation((callback: FrameRequestCallback) => {
- callback(0);
- return 1;
- });
-
- it('keeps the sparkline on shell, runtime, and model owners', () => {
- expect(interactiveSparklineSource).toContain('useInteractiveSparklineState');
- expect(interactiveSparklineSource).not.toContain('style={{');
- expect(interactiveSparklineSource).not.toContain('style={');
- expect(interactiveSparklineSource).not.toContain('createEffect');
- expect(interactiveSparklineSource).not.toContain('createSignal');
- expect(interactiveSparklineSource).not.toContain('scheduleSparkline');
- expect(interactiveSparklineSource).toContain('align="left"');
- expect(interactiveSparklineStateSource).toContain('scheduleSparkline');
- expect(interactiveSparklineStateSource).toContain('createSignal');
- expect(interactiveSparklineModelSource).toContain('buildInteractiveSparklineChartData');
- expect(interactiveSparklineModelSource).toContain('computeInteractiveSparklineHoverState');
- expect(interactiveSparklineModelSource).toContain('getInteractiveSparklineTooltipSideX');
- });
-
- it('renders axis labels in fixed-size SVG shells so tick text does not stretch', () => {
- const now = Date.now();
- const { container } = render(() => (
- <InteractiveSparkline
- size="lg"
- timeRange="1h"
- rangeLabel="1h"
- series={[
- {
- name: 'CPU',
- color: '#ff0000',
- data: [
- { timestamp: now - 30_000, value: 40 },
- { timestamp: now - 10_000, value: 50 },
- ],
- },
- ]}
- />
- ));
-
- const yAxis = container.querySelector('svg[data-sparkline-y-axis="true"]');
- const xAxis = container.querySelector('svg[data-sparkline-x-axis="true"]');
- expect(yAxis).toBeInTheDocument();
- expect(xAxis).toBeInTheDocument();
- expect(yAxis?.hasAttribute('viewBox')).toBe(false);
- expect(yAxis?.hasAttribute('preserveAspectRatio')).toBe(false);
- expect(xAxis?.hasAttribute('viewBox')).toBe(false);
- expect(xAxis?.hasAttribute('preserveAspectRatio')).toBe(false);
- expect(yAxis?.querySelector('text')?.getAttribute('y')).toBe('0%');
- expect(xAxis?.querySelectorAll('text')[1]?.getAttribute('x')).toBe('50%');
- });
-
- it('shows a vertical dashed hover line and a tooltip', async () => {
- vi.useFakeTimers();
- vi.setSystemTime(new Date('2024-01-01T12:00:00Z'));
- mockImmediateRaf();
- const now = Date.now();
-
- const { container } = render(() => (
- <InteractiveSparkline
- timeRange="1h"
- rangeLabel="1h"
- series={[
- {
- name: 'CPU',
- color: '#ff0000',
- data: [
- { timestamp: now - 30_000, value: 40 },
- { timestamp: now - 10_000, value: 50 },
- ],
- },
- ]}
- />
- ));
-
- const svg = container.querySelector('svg');
- expect(svg).not.toBeNull();
- if (!svg) return;
-
- // JSDOM returns zeros by default, but the hover math requires a non-zero width.
- (svg as unknown as { getBoundingClientRect: () => DOMRect }).getBoundingClientRect = () =>
- ({
- left: 0,
- top: 100,
- width: 200,
- height: 50,
- right: 200,
- bottom: 150,
- x: 0,
- y: 100,
- toJSON: () => ({}),
- }) as unknown as DOMRect;
-
- fireEvent.mouseMove(svg, { clientX: 199, clientY: 110 });
-
- const hoverLine = svg.querySelector('line[stroke-dasharray="3 3"]');
- expect(hoverLine).toBeInTheDocument();
- expect(hoverLine?.getAttribute('y1')).toBe('0');
- expect(hoverLine?.getAttribute('y2')).toBe('100');
- expect(await screen.findByText('50.0%')).toBeInTheDocument();
- expect(container.ownerDocument.querySelector('[data-sparkline-tooltip="true"]')).not.toBeNull();
-
- fireEvent.mouseLeave(svg);
- expect(svg.querySelector('line[stroke-dasharray="3 3"]')).toBeNull();
- expect(screen.queryByText('CPU')).toBeNull();
- });
-
- it('keeps the local hover cursor on the actual scrub position instead of snapping to the nearest sample timestamp', () => {
- vi.useFakeTimers();
- vi.setSystemTime(new Date('2024-01-01T12:00:00Z'));
- const now = Date.now();
- const windowStart = now - 60 * 60_000;
-
- const { container } = render(() => (
- <InteractiveSparkline
- timeRange="1h"
- rangeLabel="1h"
- series={[
- {
- name: 'CPU',
- color: '#ff0000',
- data: [
- { timestamp: windowStart + 5 * 60_000, value: 40 },
- { timestamp: windowStart + 55 * 60_000, value: 50 },
- ],
- },
- ]}
- />
- ));
-
- const svg = container.querySelector('svg');
- expect(svg).not.toBeNull();
- if (!svg) return;
-
- (svg as unknown as { getBoundingClientRect: () => DOMRect }).getBoundingClientRect = () =>
- ({
- left: 0,
- top: 100,
- width: 200,
- height: 50,
- right: 200,
- bottom: 150,
- x: 0,
- y: 100,
- toJSON: () => ({}),
- }) as unknown as DOMRect;
-
- fireEvent.mouseMove(svg, { clientX: 100, clientY: 120 });
-
- const root = container.firstElementChild;
- const hoverLine = svg.querySelector('line[stroke-dasharray="3 3"]');
- expect(hoverLine).toBeInTheDocument();
- expect(
- Number.parseFloat(root?.getAttribute('data-active-hover-cursor-x') ?? 'NaN'),
- ).toBeCloseTo(100, 1);
- expect(Number.parseFloat(hoverLine?.getAttribute('x1') ?? 'NaN')).toBeCloseTo(100, 1);
- expect(hoverLine?.getAttribute('y1')).toBe('0');
- });
-
- it('publishes synchronized hover identity and clears it on leave', () => {
- vi.useFakeTimers();
- vi.setSystemTime(new Date('2024-01-01T12:00:00Z'));
- const now = Date.now();
- const onHoverSyncChange = vi.fn();
-
- const { container } = render(() => (
- <InteractiveSparkline
- timeRange="1h"
- hoverSourceKey="cpu"
- onHoverSyncChange={onHoverSyncChange}
- highlightNearestSeriesOnHover
- series={[
- {
- id: 'alpha',
- name: 'Alpha',
- color: '#ff0000',
- data: [
- { timestamp: now - 30_000, value: 40 },
- { timestamp: now - 10_000, value: 50 },
- ],
- },
- ]}
- />
- ));
-
- const svg = container.querySelector('svg');
- expect(svg).not.toBeNull();
- if (!svg) return;
-
- (svg as unknown as { getBoundingClientRect: () => DOMRect }).getBoundingClientRect = () =>
- ({
- left: 0,
- top: 100,
- width: 200,
- height: 50,
- right: 200,
- bottom: 150,
- x: 0,
- y: 100,
- toJSON: () => ({}),
- }) as unknown as DOMRect;
-
- fireEvent.mouseMove(svg, { clientX: 199, clientY: 125 });
-
- const publishedHover = onHoverSyncChange.mock.calls.at(-1)?.[0];
- expect(publishedHover).toMatchObject({
- sourceKey: 'cpu',
- seriesId: 'alpha',
- });
- expect(publishedHover?.timestamp).toBe(now - 10_000);
-
- fireEvent.mouseLeave(svg);
- expect(onHoverSyncChange).toHaveBeenLastCalledWith(null);
- });
-
- it('builds a compact synchronized readout for sibling sparkline cards', () => {
- vi.useFakeTimers();
- vi.setSystemTime(new Date('2024-01-01T12:00:00Z'));
- const now = Date.now();
-
- const readout = buildInteractiveSparklineSynchronizedReadout({
- hoverSourceKey: 'memory',
- hoverSync: {
- sourceKey: 'cpu',
- seriesId: 'alpha',
- timestamp: now - 12_000,
- },
- series: [
- {
- id: 'alpha',
- name: 'Alpha',
- color: '#ff0000',
- data: [
- { timestamp: now - 30_000, value: 40 },
- { timestamp: now - 10_000, value: 50 },
- ],
- },
- ],
- timeRange: '1h',
- });
-
- expect(readout).toEqual({
- timestamp: now - 10_000,
- value: '50.0%',
- });
- expect(
- buildInteractiveSparklineSynchronizedReadout({
- hoverSourceKey: 'cpu',
- hoverSync: {
- sourceKey: 'cpu',
- seriesId: 'alpha',
- timestamp: now - 12_000,
- },
- series: [
- {
- id: 'alpha',
- name: 'Alpha',
- color: '#ff0000',
- data: [
- { timestamp: now - 30_000, value: 40 },
- { timestamp: now - 10_000, value: 50 },
- ],
- },
- ],
- timeRange: '1h',
- }),
- ).toBeNull();
- });
-
- it('keeps a synchronized hover timestamp visible even when the synced series is absent locally', () => {
- vi.useFakeTimers();
- vi.setSystemTime(new Date('2024-01-01T12:00:00Z'));
- const now = Date.now();
-
- const { container } = render(() => (
- <InteractiveSparkline
- timeRange="1h"
- hoverSourceKey="memory"
- hoverSync={{
- sourceKey: 'cpu',
- seriesId: 'missing-series',
- timestamp: now - 10_000,
- }}
- series={[
- {
- id: 'alpha',
- name: 'Alpha',
- color: '#ff0000',
- data: [
- { timestamp: now - 30_000, value: 40 },
- { timestamp: now - 10_000, value: 50 },
- ],
- },
- ]}
- />
- ));
-
- const root = container.firstElementChild;
- expect(root?.getAttribute('data-active-hover-timestamp')).toBe(String(now - 10_000));
- const svg = container.querySelector('svg');
- expect(svg?.querySelector('line[stroke-dasharray="3 3"]')).toBeInTheDocument();
- expect(screen.queryByText('Alpha')).toBeNull();
- });
-
- it('limits tooltip rows and shows the "+N more series" affordance', async () => {
- vi.useFakeTimers();
- vi.setSystemTime(new Date('2024-01-01T12:00:00Z'));
- mockImmediateRaf();
- const now = Date.now();
-
- const makeSeries = (i: number, value: number) => ({
- name: `S${i}`,
- color: `#${String(i).padStart(2, '0')}0000`,
- data: [
- { timestamp: now - 30_000, value },
- { timestamp: now - 10_000, value },
- ],
- });
-
- const { container } = render(() => (
- <InteractiveSparkline
- timeRange="1h"
- series={[1, 2, 3, 4, 5, 6, 7, 8].map((i) => makeSeries(i, i * 10))}
- maxTooltipRows={6}
- />
- ));
-
- const svg = container.querySelector('svg');
- expect(svg).not.toBeNull();
- if (!svg) return;
-
- (svg as unknown as { getBoundingClientRect: () => DOMRect }).getBoundingClientRect = () =>
- ({
- left: 0,
- top: 100,
- width: 200,
- height: 50,
- right: 200,
- bottom: 150,
- x: 0,
- y: 100,
- toJSON: () => ({}),
- }) as unknown as DOMRect;
-
- fireEvent.mouseMove(svg, { clientX: 199, clientY: 110 });
-
- expect(await screen.findByText('S1')).toBeInTheDocument();
- expect(screen.getByText('S6')).toBeInTheDocument();
- expect(screen.queryByText('S7')).toBeNull();
- expect(screen.getByText('+2 more series')).toBeInTheDocument();
- });
-
- it('clamps tooltip position so it stays in the viewport', async () => {
- vi.useFakeTimers();
- vi.setSystemTime(new Date('2024-01-01T12:00:00Z'));
- mockImmediateRaf();
- const now = Date.now();
-
- const { container } = render(() => (
- <InteractiveSparkline
- timeRange="1h"
- series={[
- {
- name: 'CPU',
- color: '#ff0000',
- data: [
- { timestamp: now - 30_000, value: 40 },
- { timestamp: now - 10_000, value: 50 },
- ],
- },
- ]}
- />
- ));
-
- const svg = container.querySelector('svg');
- expect(svg).not.toBeNull();
- if (!svg) return;
-
- (svg as unknown as { getBoundingClientRect: () => DOMRect }).getBoundingClientRect = () =>
- ({
- left: 0,
- top: 10,
- width: 200,
- height: 50,
- right: 200,
- bottom: 60,
- x: 0,
- y: 10,
- toJSON: () => ({}),
- }) as unknown as DOMRect;
-
- fireEvent.mouseMove(svg, { clientX: 1, clientY: 11 });
-
- const tooltip = container.ownerDocument.querySelector(
- '[data-sparkline-tooltip="true"]',
- ) as HTMLElement | null;
- expect(tooltip).not.toBeNull();
- if (!tooltip) return;
-
- const tooltipHost = tooltip.closest('foreignObject');
- expect(tooltipHost).not.toBeNull();
- if (!tooltipHost) return;
-
- const left = Number.parseFloat(tooltipHost.getAttribute('x') ?? 'NaN');
- const top = Number.parseFloat(tooltipHost.getAttribute('y') ?? 'NaN');
- expect(left).toBeGreaterThanOrEqual(0);
- expect(top).toBeGreaterThanOrEqual(0);
- });
-
- it('anchors the tooltip to the pointer instead of the chart top edge', async () => {
- vi.useFakeTimers();
- vi.setSystemTime(new Date('2024-01-01T12:00:00Z'));
- mockImmediateRaf();
- const now = Date.now();
-
- const { container } = render(() => (
- <InteractiveSparkline
- timeRange="1h"
- series={[
- {
- name: 'CPU',
- color: '#ff0000',
- data: [
- { timestamp: now - 30_000, value: 40 },
- { timestamp: now - 10_000, value: 50 },
- ],
- },
- ]}
- />
- ));
-
- const svg = container.querySelector('svg');
- expect(svg).not.toBeNull();
- if (!svg) return;
-
- (svg as unknown as { getBoundingClientRect: () => DOMRect }).getBoundingClientRect = () =>
- ({
- left: 0,
- top: 100,
- width: 200,
- height: 80,
- right: 200,
- bottom: 180,
- x: 0,
- y: 100,
- toJSON: () => ({}),
- }) as unknown as DOMRect;
-
- fireEvent.mouseMove(svg, { clientX: 120, clientY: 110 });
-
- const tooltip = container.ownerDocument.querySelector(
- '[data-sparkline-tooltip="true"]',
- ) as HTMLElement | null;
- expect(tooltip).not.toBeNull();
- if (!tooltip) return;
-
- const tooltipHost = tooltip.closest('foreignObject');
- expect(tooltipHost).not.toBeNull();
- if (!tooltipHost) return;
-
- const firstTop = Number.parseFloat(tooltipHost.getAttribute('y') ?? 'NaN');
-
- fireEvent.mouseMove(svg, { clientX: 120, clientY: 160 });
-
- const secondTop = Number.parseFloat(tooltipHost.getAttribute('y') ?? 'NaN');
- expect(secondTop).toBeGreaterThan(firstTop);
- });
-
- it('offsets the tooltip beside the hover cursor so the scrub line remains visible', () => {
- vi.useFakeTimers();
- vi.setSystemTime(new Date('2024-01-01T12:00:00Z'));
- const now = Date.now();
-
- const chartData = buildInteractiveSparklineChartData({
- bridgeLeadingGap: false,
- series: [
- {
- name: 'CPU',
- color: '#ff0000',
- data: [
- { timestamp: now - 30_000, value: 40 },
- { timestamp: now - 10_000, value: 50 },
- ],
- },
- ],
- shouldUseCanvas: false,
- timeRange: '1h',
- vbH: 100,
- vbW: 200,
- yMode: 'percent',
- });
- const chartRect = {
- left: 100,
- top: 100,
- width: 260,
- height: 80,
- right: 360,
- bottom: 180,
- x: 100,
- y: 100,
- toJSON: () => ({}),
- } as DOMRect;
-
- const hover = computeInteractiveSparklineHoverState({
- chartData,
- chartRect,
- clientX: 220,
- clientY: 140,
- highlightNearestSeriesOnHover: false,
- lockedSeriesIndex: null,
- maxRows: 6,
- sortTooltipByValue: false,
- vbH: 100,
- vbW: 200,
- yMode: 'percent',
- });
-
- expect(hover).not.toBeNull();
- expect(hover?.x).toBeCloseTo((120 / 260) * 200, 3);
- expect(hover?.tooltipX).toBeGreaterThan(220 + 8);
- });
-
- it('moves the side tooltip left of the cursor near the viewport edge', () => {
- const chartRect = {
- left: 560,
- top: 100,
- width: 240,
- height: 80,
- right: 800,
- bottom: 180,
- x: 560,
- y: 100,
- toJSON: () => ({}),
- } as DOMRect;
-
- const cursorX = chartRect.left + 210;
- const tooltipX = getInteractiveSparklineTooltipSideX({
- chartRect,
- mouseX: 210,
- viewportWidth: 800,
- });
-
- expect(tooltipX).toBeLessThan(cursorX - 200);
- });
-
- it('locks a hovered series on click and unlocks on second click', async () => {
- vi.useFakeTimers();
- vi.setSystemTime(new Date('2024-01-01T12:00:00Z'));
- const now = Date.now();
-
- const { container } = render(() => (
- <InteractiveSparkline
- timeRange="1h"
- highlightNearestSeriesOnHover
- series={[
- {
- name: 'High',
- color: '#ff0000',
- data: [
- { timestamp: now - 30_000, value: 90 },
- { timestamp: now - 10_000, value: 90 },
- ],
- },
- {
- name: 'Low',
- color: '#00ff00',
- data: [
- { timestamp: now - 30_000, value: 10 },
- { timestamp: now - 10_000, value: 10 },
- ],
- },
- ]}
- />
- ));
-
- const svg = container.querySelector('svg');
- expect(svg).not.toBeNull();
- if (!svg) return;
-
- (svg as unknown as { getBoundingClientRect: () => DOMRect }).getBoundingClientRect = () =>
- ({
- left: 0,
- top: 100,
- width: 200,
- height: 100,
- right: 200,
- bottom: 200,
- x: 0,
- y: 100,
- toJSON: () => ({}),
- }) as unknown as DOMRect;
-
- // Hover near the high series and lock it.
- fireEvent.mouseMove(svg, { clientX: 150, clientY: 110 });
- expect(await screen.findByText('High')).toBeInTheDocument();
- expect(screen.queryByText('Low')).toBeNull();
- fireEvent.click(svg);
-
- // Scrub near the low series: lock should keep High selected.
- fireEvent.mouseMove(svg, { clientX: 150, clientY: 190 });
- expect(await screen.findByText('High')).toBeInTheDocument();
- expect(screen.queryByText('Low')).toBeNull();
-
- // Click again to unlock, then low should become selectable.
- fireEvent.click(svg);
- fireEvent.mouseMove(svg, { clientX: 150, clientY: 190 });
- expect(await screen.findByText('Low')).toBeInTheDocument();
- expect(screen.queryByText('High')).toBeNull();
- });
-
- it('breaks the rendered line when there is a large gap in data', async () => {
- vi.useFakeTimers();
- vi.setSystemTime(new Date('2024-01-02T00:00:00Z'));
- const now = Date.now();
-
- const { container } = render(() => (
- <InteractiveSparkline
- timeRange="24h"
- series={[
- {
- name: 'CPU',
- color: '#ff0000',
- data: [
- { timestamp: now - 23 * 60 * 60_000, value: 40 },
- { timestamp: now - 22 * 60 * 60_000, value: 42 },
- { timestamp: now - 5 * 60_000, value: 70 },
- { timestamp: now - 2 * 60_000, value: 75 },
- ],
- },
- ]}
- />
- ));
-
- await Promise.resolve();
-
- const paths = container.querySelectorAll('path[vector-effect="non-scaling-stroke"]');
- expect(paths.length).toBeGreaterThan(1);
- });
-
- it('keeps evenly spaced sparse data connected as a single line', async () => {
- vi.useFakeTimers();
- vi.setSystemTime(new Date('2024-01-02T00:00:00Z'));
- const now = Date.now();
-
- const data = Array.from({ length: 30 }, (_, index) => ({
- timestamp: now - (60 - index * 2) * 60_000,
- value: 50 + (index % 5),
- }));
-
- const { container } = render(() => (
- <InteractiveSparkline
- timeRange="1h"
- series={[
- {
- name: 'CPU',
- color: '#ff0000',
- data,
- },
- ]}
- />
- ));
-
- await Promise.resolve();
-
- const paths = container.querySelectorAll('path[vector-effect="non-scaling-stroke"]');
- expect(paths.length).toBe(1);
- });
-
- it('renders tiered-density data (sparse + medium + dense) as a single continuous line', async () => {
- vi.useFakeTimers();
- vi.setSystemTime(new Date('2024-01-08T00:00:00Z'));
- const now = Date.now();
-
- // Simulate tiered mock data: sparse (~65min), medium (~2min), dense (~1min)
- const data: { timestamp: number; value: number }[] = [];
- // Sparse tier: 7d–24h ago, ~65min intervals (~133 points)
- for (let i = 0; i < 133; i++) {
- data.push({
- timestamp: now - 7 * 24 * 60 * 60_000 + i * 65 * 60_000,
- value: 30 + Math.sin(i * 0.1) * 10,
- });
- }
- // Medium tier: 24h–2h ago, ~2min intervals (~660 points)
- const mediumStart = now - 24 * 60 * 60_000;
- for (let i = 0; i < 660; i++) {
- data.push({
- timestamp: mediumStart + i * 2 * 60_000,
- value: 35 + Math.sin(i * 0.05) * 8,
- });
- }
- // Dense tier: last 2h, ~1min intervals (~120 points)
- const denseStart = now - 2 * 60 * 60_000;
- for (let i = 0; i < 120; i++) {
- data.push({
- timestamp: denseStart + i * 60_000,
- value: 40 + Math.sin(i * 0.2) * 5,
- });
- }
-
- const { container } = render(() => (
- <InteractiveSparkline
- timeRange="7d"
- series={[
- {
- name: 'CPU',
- color: '#ff0000',
- data,
- },
- ]}
- />
- ));
-
- await Promise.resolve();
-
- // After LTTB downsampling + P90 gap detection, tiered data should render
- // as a single continuous segment, not fragmented by tier transitions.
- const paths = container.querySelectorAll('path[vector-effect="non-scaling-stroke"]');
- expect(paths.length).toBe(1);
- });
-
- it('can bridge the leading window-start gap when requested', async () => {
- vi.useFakeTimers();
- vi.setSystemTime(new Date('2024-01-02T00:00:00Z'));
- const now = Date.now();
-
- const { container } = render(() => (
- <InteractiveSparkline
- timeRange="1h"
- bridgeLeadingGap
- series={[
- {
- name: 'CPU',
- color: '#ff0000',
- data: [
- { timestamp: now - 60 * 60_000, value: 55 },
- { timestamp: now - 5 * 60_000, value: 55 },
- { timestamp: now - 4 * 60_000, value: 60 },
- ],
- },
- ]}
- />
- ));
-
- await Promise.resolve();
-
- const paths = container.querySelectorAll('path[vector-effect="non-scaling-stroke"]');
- expect(paths.length).toBe(1);
- });
-
- it('renders only the active series when isolate mode is enabled', async () => {
- vi.useFakeTimers();
- vi.setSystemTime(new Date('2024-01-02T00:00:00Z'));
- const now = Date.now();
-
- const { container } = render(() => (
- <InteractiveSparkline
- timeRange="1h"
- activeSeriesDisplay="isolate"
- highlightSeriesId="beta"
- series={[
- {
- id: 'alpha',
- name: 'Alpha',
- color: '#ff0000',
- data: [
- { timestamp: now - 30 * 60_000, value: 30 },
- { timestamp: now - 5 * 60_000, value: 45 },
- ],
- },
- {
- id: 'beta',
- name: 'Beta',
- color: '#00ff00',
- data: [
- { timestamp: now - 30 * 60_000, value: 70 },
- { timestamp: now - 5 * 60_000, value: 80 },
- ],
- },
- ]}
- />
- ));
-
- await Promise.resolve();
-
- const root = container.firstElementChild as HTMLElement | null;
- expect(root).not.toBeNull();
- expect(root?.getAttribute('data-active-series-display')).toBe('isolate');
- expect(root?.getAttribute('data-rendered-series-count')).toBe('1');
-
- const paths = container.querySelectorAll('path[vector-effect="non-scaling-stroke"]');
- expect(paths.length).toBe(1);
- });
-});
diff --git a/frontend-modern/src/types/agentDeploy.ts b/frontend-modern/src/types/agentDeploy.ts
deleted file mode 100644
index ba74222b52..0000000000
--- a/frontend-modern/src/types/agentDeploy.ts
+++ /dev/null
@@ -1,149 +0,0 @@
-// Types for cluster agent deployment, mirroring backend Go structs
-// from internal/deploy/types.go and internal/api/deploy_handlers.go.
-
-/** Lifecycle state of a deployment job. */
-export type DeployJobStatus =
- | 'queued'
- | 'waiting_source'
- | 'running'
- | 'succeeded'
- | 'partial_success'
- | 'failed'
- | 'canceling'
- | 'canceled';
-
-/** Lifecycle state of a single deployment target node. */
-export type DeployTargetStatus =
- | 'pending'
- | 'preflighting'
- | 'ready'
- | 'installing'
- | 'enrolling'
- | 'verifying'
- | 'succeeded'
- | 'failed_retryable'
- | 'failed_permanent'
- | 'skipped_already_agent'
- | 'canceled';
-
-/** Event type classification for deployment audit log entries. */
-export type DeployEventType =
- | 'job_created'
- | 'job_status_changed'
- | 'target_status_changed'
- | 'preflight_result'
- | 'install_output'
- | 'enroll_complete'
- | 'error'
- | 'job_complete';
-
-// --- API response types ---
-
-/** A candidate node in the cluster for agent deployment. */
-export interface CandidateNode {
- nodeId: string;
- name: string;
- ip: string;
- hasAgent: boolean;
- deployable: boolean;
- reason?: string;
-}
-
-/** A connected agent that can act as a deployment source (SSH to peers). */
-export interface SourceAgentInfo {
- agentId: string;
- nodeId: string;
- online: boolean;
-}
-
-/** Response from GET /api/clusters/{clusterId}/agent-deploy/candidates */
-export interface CandidatesResponse {
- clusterId: string;
- clusterName: string;
- sourceAgents: SourceAgentInfo[];
- nodes: CandidateNode[];
-}
-
-/** A single target node within a deploy job. */
-export interface DeployTarget {
- id: string;
- jobId: string;
- nodeId: string;
- nodeName: string;
- nodeIP: string;
- arch?: string;
- status: DeployTargetStatus;
- errorMessage?: string;
- attempts: number;
- createdAt: string;
- updatedAt: string;
-}
-
-/** A deploy or preflight job with its targets. */
-export interface DeployJob {
- id: string;
- clusterId: string;
- clusterName: string;
- sourceAgentId: string;
- status: DeployJobStatus;
- targets: DeployTarget[];
- createdAt: string;
- updatedAt: string;
- completedAt?: string;
-}
-
-/** An immutable audit log entry for a deployment lifecycle. */
-export interface DeployEvent {
- id: string;
- jobId: string;
- targetId?: string;
- type: DeployEventType;
- message: string;
- data?: string;
- createdAt: string;
-}
-
-// --- Request/Response types ---
-
-export interface CreatePreflightRequest {
- sourceAgentId: string;
- targetNodeIds: string[];
- maxParallel?: number;
-}
-
-/** Response from POST /api/clusters/{clusterId}/agent-deploy/preflights */
-export interface CreatePreflightResponse {
- preflightId: string;
- status: string;
- eventsUrl: string;
-}
-
-export interface CreateJobRequest {
- sourceAgentId: string;
- preflightId: string;
- targetNodeIds: string[];
- mode?: string;
- maxParallel?: number;
- retryPolicy?: { maxAttempts: number };
-}
-
-export interface SkippedTarget {
- nodeId: string;
- reason: string;
-}
-
-/** Response from POST /api/clusters/{clusterId}/agent-deploy/jobs */
-export interface CreateJobResponse {
- jobId: string;
- acceptedTargets: string[];
- skippedTargets: SkippedTarget[];
- eventsUrl: string;
-}
-
-/** Response from POST /api/agent-deploy/jobs/{jobId}/retry */
-export interface RetryJobResponse {
- jobId: string;
- retryTargets: number;
- status: string;
- eventsUrl: string;
-}
diff --git a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
index 68957ceb41..0ee6e59cba 100644
--- a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
+++ b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
@@ -15,10 +15,8 @@ import columnPickerSource from '@/components/shared/ColumnPicker.tsx?raw';
import columnPickerModelSource from '@/components/shared/columnPickerModel.ts?raw';
import tagInputSource from '@/components/shared/TagInput.tsx?raw';
import tagInputModelSource from '@/components/shared/tagInputModel.ts?raw';
-import collapsibleSearchInputModelSource from '@/components/shared/collapsibleSearchInputModel.ts?raw';
import containerUpdateBadgeSource from '@/components/shared/ContainerUpdateBadge.tsx?raw';
import containerUpdateBadgeModelSource from '@/components/shared/containerUpdateBadgeModel.ts?raw';
-import densityMapModelSource from '@/components/shared/densityMapModel.ts?raw';
import dialogSource from '@/components/shared/Dialog.tsx?raw';
import dialogModelSource from '@/components/shared/dialogModel.ts?raw';
import filterButtonGroupSource from '@/components/shared/FilterButtonGroup.tsx?raw';
@@ -40,7 +38,6 @@ import searchInputSource from '@/components/shared/SearchInput.tsx?raw';
import searchInputEnhancementsSource from '@/components/shared/SearchInputEnhancements.tsx?raw';
import searchInputEnhancementsModelSource from '@/components/shared/searchInputEnhancementsModel.ts?raw';
import searchInputModelSource from '@/components/shared/searchInputModel.ts?raw';
-import scrollToTopButtonModelSource from '@/components/shared/scrollToTopButtonModel.ts?raw';
import statusBadgeSource from '@/components/shared/StatusBadge.tsx?raw';
import statusBadgeModelSource from '@/components/shared/statusBadgeModel.ts?raw';
import toggleSource from '@/components/shared/Toggle.tsx?raw';
@@ -50,15 +47,12 @@ import searchTipsPopoverModelSource from '@/components/shared/searchTipsPopoverM
import tooltipSource from '@/components/shared/Tooltip.tsx?raw';
import tooltipModelSource from '@/components/shared/tooltipModel.ts?raw';
import upgradeLinkSource from '@/components/shared/UpgradeLink.tsx?raw';
-import monitoredSystemDefinitionDisclosureSource from '@/components/Commercial/MonitoredSystemDefinitionDisclosure.tsx?raw';
-import interactiveSparklineSource from '@/components/shared/InteractiveSparkline.tsx?raw';
import interactiveSparklineModelSource from '@/components/shared/interactiveSparklineModel.ts?raw';
import selectionCardGroupSource from '@/components/shared/SelectionCardGroup.tsx?raw';
import selectionCardGroupModelSource from '@/components/shared/selectionCardGroupModel.ts?raw';
import commandPaletteStateSource from '@/components/shared/useCommandPaletteState.ts?raw';
import columnPickerStateSource from '@/components/shared/useColumnPickerState.ts?raw';
import tagInputStateSource from '@/components/shared/useTagInputState.ts?raw';
-import collapsibleSearchInputStateSource from '@/components/shared/useCollapsibleSearchInputState.ts?raw';
import containerUpdateButtonStateSource from '@/components/shared/useContainerUpdateButtonState.ts?raw';
import dialogStateSource from '@/components/shared/useDialogState.ts?raw';
import filterButtonGroupStateSource from '@/components/shared/useFilterButtonGroupState.ts?raw';
@@ -69,7 +63,6 @@ import pulseDataGridStateSource from '@/components/shared/usePulseDataGridState.
import searchFieldStateSource from '@/components/shared/useSearchFieldState.ts?raw';
import searchInputStateSource from '@/components/shared/useSearchInputState.ts?raw';
import searchInputEnhancementsStateSource from '@/components/shared/useSearchInputEnhancements.ts?raw';
-import scrollToTopButtonStateSource from '@/components/shared/useScrollToTopButtonState.ts?raw';
import statusBadgeStateSource from '@/components/shared/useStatusBadgeState.ts?raw';
import toggleStateSource from '@/components/shared/useToggleState.ts?raw';
import searchTipsPopoverStateSource from '@/components/shared/useSearchTipsPopoverState.ts?raw';
@@ -81,7 +74,6 @@ import resourceBadgePresentationSource from '@/utils/resourceBadgePresentation.t
import workloadTypeBadgesSource from '@/components/shared/workloadTypeBadges.ts?raw';
import tagBadgesSource from '@/components/shared/TagBadges.tsx?raw';
import emptyStateSource from '@/components/shared/EmptyState.tsx?raw';
-import densityMapStateSource from '@/components/shared/useDensityMapState.ts?raw';
import webInterfaceUrlFieldSource from '@/components/shared/WebInterfaceUrlField.tsx?raw';
import webInterfaceUrlFieldModelSource from '@/components/shared/webInterfaceUrlFieldModel.ts?raw';
import webInterfaceUrlFieldStateSource from '@/components/shared/useWebInterfaceUrlFieldState.ts?raw';
@@ -132,7 +124,6 @@ import dockerRuntimeSettingsCardSource from '@/components/Settings/DockerRuntime
import discoveryTargetSource from '@/utils/discoveryTarget.ts?raw';
import recoveryOutcomePresentationSource from '@/utils/recoveryOutcomePresentation.ts?raw';
import recoveryArtifactModePresentationSource from '@/utils/recoveryArtifactModePresentation.ts?raw';
-import recoveryIssuePresentationSource from '@/utils/recoveryIssuePresentation.ts?raw';
import recoveryDatePresentationSource from '@/utils/recoveryDatePresentation.ts?raw';
import recoveryTimelineChartPresentationSource from '@/utils/recoveryTimelineChartPresentation.ts?raw';
import recoveryTimelinePresentationSource from '@/utils/recoveryTimelinePresentation.ts?raw';
@@ -209,13 +200,11 @@ import useDiskListModelSource from '@/components/Storage/useDiskListModel.ts?raw
import diskDetailSource from '@/components/Storage/DiskDetail.tsx?raw';
import storageDetailKeyValueRowSource from '@/components/Storage/StorageDetailKeyValueRow.tsx?raw';
import storageDetailMetricCardSource from '@/components/Storage/StorageDetailMetricCard.tsx?raw';
-import useDiskLiveMetricModelSource from '@/components/Storage/useDiskLiveMetricModel.ts?raw';
import storagePageControlsSource from '@/components/Storage/StoragePageControls.tsx?raw';
import storageContentCardSource from '@/components/Storage/StorageContentCard.tsx?raw';
import storagePageSource from '@/components/Storage/Storage.tsx?raw';
import storageSummaryCacheSource from '@/utils/storageSummaryCache.ts?raw';
import useStorageContentCardModelSource from '@/components/Storage/useStorageContentCardModel.ts?raw';
-import useZFSHealthMapModelSource from '@/components/Storage/useZFSHealthMapModel.ts?raw';
import storagePoolsTableSource from '@/components/Storage/StoragePoolsTable.tsx?raw';
import useStoragePoolsTableModelSource from '@/components/Storage/useStoragePoolsTableModel.ts?raw';
import storageGroupRowSource from '@/components/Storage/StorageGroupRow.tsx?raw';
@@ -284,12 +273,6 @@ import findingsPanelSource from '@/components/AI/FindingsPanel.tsx?raw';
import discoveryTabSource from '@/components/Discovery/DiscoveryTab.tsx?raw';
import discoveryProvenanceMarkerSource from '@/components/shared/DiscoveryProvenanceMarker.tsx?raw';
import discoveryPresentationSource from '@/utils/discoveryPresentation.ts?raw';
-import mailGatewaySource from '@/components/PMG/MailGateway.tsx?raw';
-import pmgInstancePanelSource from '@/components/PMG/PMGInstancePanel.tsx?raw';
-import pmgPresentationSource from '@/utils/pmgPresentation.ts?raw';
-import pmgThreatPresentationSource from '@/utils/pmgThreatPresentation.ts?raw';
-import pmgQueuePresentationSource from '@/utils/pmgQueuePresentation.ts?raw';
-import pmgServiceHealthBadgeSource from '@/components/PMG/ServiceHealthBadge.tsx?raw';
import proxmoxSettingsModelSource from '@/components/Settings/proxmoxSettingsModel.ts?raw';
import infrastructureWorkspaceSource from '@/components/Settings/InfrastructureWorkspace.tsx?raw';
import infrastructureWorkspaceModelSource from '@/components/Settings/infrastructureWorkspaceModel.ts?raw';
@@ -303,7 +286,6 @@ import nodeModalStatusFooterSource from '@/components/Settings/NodeModalStatusFo
import nodeModalStateSource from '@/components/Settings/useNodeModalState.ts?raw';
import nodeModalPresentationSource from '@/utils/nodeModalPresentation.ts?raw';
import diskPresentationSource from '@/features/storageBackups/diskPresentation.ts?raw';
-import diskLiveMetricPresentationSource from '@/features/storageBackups/diskLiveMetricPresentation.ts?raw';
import storageDetailPresentationSource from '@/features/storageBackups/detailPresentation.ts?raw';
import diskDetailPresentationSource from '@/features/storageBackups/diskDetailPresentation.ts?raw';
import storageRecordPresentationSource from '@/features/storageBackups/recordPresentation.ts?raw';
@@ -327,11 +309,7 @@ import storageFilterPresentationSource from '@/features/storageBackups/storageFi
import storageRowAlertPresentationSource from '@/features/storageBackups/storageRowAlertPresentation.ts?raw';
import storagePoolsTablePresentationSource from '@/features/storageBackups/storagePoolsTablePresentation.ts?raw';
import zfsPresentationSource from '@/features/storageBackups/zfsPresentation.ts?raw';
-import zfsHealthMapPresentationSource from '@/features/storageBackups/zfsHealthMapPresentation.ts?raw';
import storageAdaptersSource from '@/features/storageBackups/storageAdapters.ts?raw';
-import deployStatusBadgeSource from '@/components/Infrastructure/deploy/DeployStatusBadge.tsx?raw';
-import deployFlowPresentationSource from '@/utils/deployFlowPresentation.ts?raw';
-import deployStatusPresentationSource from '@/utils/deployStatusPresentation.ts?raw';
import alertsPageSource from '@/pages/Alerts.tsx?raw';
import alertDestinationsPresentationSource from '@/utils/alertDestinationsPresentation.ts?raw';
import alertBulkEditPresentationSource from '@/utils/alertBulkEditPresentation.ts?raw';
@@ -507,8 +485,6 @@ import modelSelectorSource from '@/components/AI/Chat/ModelSelector.tsx?raw';
import remediationStatusSource from '@/components/patrol/RemediationStatus.tsx?raw';
import remediationPresentationSource from '@/utils/remediationPresentation.ts?raw';
import aiChatPresentationSource from '@/utils/aiChatPresentation.ts?raw';
-import infrastructureDetailsDrawerModelSource from '@/components/shared/infrastructureDetailsDrawerModel.ts?raw';
-import infrastructureDetailsDrawerStateSource from '@/components/shared/useInfrastructureDetailsDrawerState.ts?raw';
const aiSettingsSource = [
aiSettingsShellSource,
@@ -950,7 +926,6 @@ describe('frontend resource type boundaries', () => {
expect(recoveryArtifactModePresentationSource).toContain(
'export function getRecoveryArtifactModePresentation',
);
- expect(recoveryIssuePresentationSource).toContain('export function getRecoveryIssueRailClass');
expect(recoveryDatePresentationSource).toContain(
'export function recoveryDateKeyFromTimestamp',
);
@@ -1321,8 +1296,6 @@ describe('frontend resource type boundaries', () => {
expect(diskDetailSource).not.toContain('class="relative"');
expect(useDiskDetailModelSource).toContain('extractPhysicalDiskPresentationData');
expect(useDiskDetailModelSource).toContain('resolvePhysicalDiskHistoryResourceId');
- expect(useDiskLiveMetricModelSource).toContain('getDiskLiveMetricFormattedValue');
- expect(useDiskLiveMetricModelSource).toContain('getDiskLiveMetricTextClass');
expect(storagePoolRowSource).toContain('getStoragePoolProtectionTextClass');
expect(storagePoolRowSource).toContain('stateToneClass');
expect(storagePoolRowSource).toContain('buildStoragePoolRowModel');
@@ -1584,10 +1557,6 @@ describe('frontend resource type boundaries', () => {
expect(storageRowAlertPresentationSource).toContain(
'export const getStorageRowAlertPresentation',
);
- expect(diskLiveMetricPresentationSource).toContain('export const getDiskLiveMetricTextClass');
- expect(diskLiveMetricPresentationSource).toContain(
- 'export const getDiskLiveMetricFormattedValue',
- );
expect(diskPresentationSource).toContain('export function extractPhysicalDiskPresentationData');
expect(diskPresentationSource).toContain('export function matchesPhysicalDiskSearch');
expect(diskPresentationSource).toContain('export function comparePhysicalDiskPresentation');
@@ -1619,24 +1588,6 @@ describe('frontend resource type boundaries', () => {
expect(storagePoolDetailSource).not.toContain('text-base-content truncate flex-1');
expect(zfsPresentationSource).toContain('export const getZfsDeviceBlockClass');
expect(zfsPresentationSource).toContain('export const getZfsDeviceStateTextClass');
- expect(zfsHealthMapPresentationSource).toContain('export const getZfsHealthMapDevices');
- expect(zfsHealthMapPresentationSource).toContain(
- 'export const isZfsHealthMapDeviceResilvering',
- );
- expect(zfsHealthMapPresentationSource).toContain(
- 'export const getZfsHealthMapTooltipPresentation',
- );
- expect(zfsHealthMapPresentationSource).toContain('export const getZfsHealthMapDeviceClass');
- expect(zfsHealthMapPresentationSource).toContain(
- 'export const getZfsHealthMapErrorSummaryClass',
- );
- expect(zfsHealthMapPresentationSource).toContain('export const getZfsHealthMapMessageClass');
- expect(zfsHealthMapPresentationSource).toContain(
- 'export const ZFS_HEALTH_MAP_TOOLTIP_CARD_CLASS',
- );
- expect(useZFSHealthMapModelSource).toContain('getZfsHealthMapDevices');
- expect(useZFSHealthMapModelSource).toContain('isZfsHealthMapDeviceResilvering');
- expect(useZFSHealthMapModelSource).toContain('getZfsHealthMapTooltipPresentation');
expect(zfsPresentationSource).toContain('export const getZfsPoolStateTextClass');
expect(diskPresentationSource).toContain('export function getPhysicalDiskHealthStatus');
expect(diskPresentationSource).toContain('export function getPhysicalDiskHealthSummary');
@@ -2328,16 +2279,6 @@ describe('frontend resource type boundaries', () => {
expect(tagInputModelSource).toContain('getTagInputPlaceholder');
expect(tagInputModelSource).toContain('getNextTagsAfterRemove');
expect(tagInputModelSource).toContain('getTagInputRemoveTitle');
- expect(scrollToTopButtonStateSource).toContain('createSignal');
- expect(scrollToTopButtonStateSource).toContain('onMount');
- expect(scrollToTopButtonStateSource).toContain('addEventListener');
- expect(scrollToTopButtonStateSource).toContain("scrollTo({ top: 0, behavior: 'smooth' })");
- expect(scrollToTopButtonStateSource).toContain('findNearestScrollableAncestor');
- expect(scrollToTopButtonModelSource).toContain('SCROLL_TO_TOP_BUTTON_THRESHOLD');
- expect(scrollToTopButtonModelSource).toContain('SCROLL_TO_TOP_BUTTON_ARIA_LABEL');
- expect(scrollToTopButtonModelSource).toContain('findNearestScrollableAncestor');
- expect(scrollToTopButtonModelSource).toContain('isScrollToTopButtonVisible');
- expect(scrollToTopButtonModelSource).toContain('getScrollToTopButtonClass');
expect(filterButtonGroupSource).toContain('useFilterButtonGroupState');
expect(filterButtonGroupSource).toContain('getFilterButtonGroupClass');
expect(filterButtonGroupSource).toContain('getFilterButtonGroupButtonClass');
@@ -2396,12 +2337,6 @@ describe('frontend resource type boundaries', () => {
expect(selectionCardGroupModelSource).toContain('resolveSelectionCardTone');
expect(selectionCardGroupModelSource).toContain('getSelectionCardButtonClass');
expect(selectionCardGroupModelSource).toContain("compact: 'grid grid-cols-2 gap-2'");
- expect(monitoredSystemDefinitionDisclosureSource).toContain(
- '@/utils/monitoredSystemPresentation',
- );
- expect(monitoredSystemDefinitionDisclosureSource).toContain(
- 'getMonitoredSystemDisclosureToggleLabel',
- );
expect(monitoredSystemPresentationSource).toContain(
'export function getMonitoredSystemLedgerPresentation',
);
@@ -2444,27 +2379,10 @@ describe('frontend resource type boundaries', () => {
expect(dialogModelSource).toContain('getDialogViewportClass');
expect(dialogModelSource).toContain('getDialogAlignmentClass');
expect(dialogModelSource).toContain('getDialogPanelClass');
- expect(collapsibleSearchInputStateSource).toContain('createSignal');
- expect(collapsibleSearchInputStateSource).toContain('useTypeToSearch');
- expect(collapsibleSearchInputStateSource).toContain('queueMicrotask');
- expect(collapsibleSearchInputModelSource).toContain('getCollapsibleSearchTriggerLabel');
- expect(collapsibleSearchInputModelSource).toContain('shouldShowCollapsibleSearchExpanded');
- expect(collapsibleSearchInputModelSource).toContain('getCollapsibleSearchRootClass');
- expect(interactiveSparklineSource).toContain('useInteractiveSparklineState');
- expect(interactiveSparklineSource).not.toContain('scheduleSparkline');
- expect(interactiveSparklineSource).not.toContain('downsampleLTTB');
- expect(interactiveSparklineSource).not.toContain('createSignal');
expect(interactiveSparklineStateSource).toContain('scheduleSparkline');
expect(interactiveSparklineStateSource).toContain('createSignal');
expect(interactiveSparklineModelSource).toContain('buildInteractiveSparklineChartData');
expect(interactiveSparklineModelSource).toContain('computeInteractiveSparklineHoverState');
- expect(densityMapStateSource).toContain('createSignal');
- expect(densityMapStateSource).toContain('canvas.getContext');
- expect(densityMapStateSource).toContain('window.addEventListener');
- expect(densityMapModelSource).toContain('buildDensityMapChartData');
- expect(densityMapModelSource).toContain('buildDensityMapHoveredState');
- expect(densityMapModelSource).toContain('formatDensityMapHoverTime');
- expect(densityMapModelSource).toContain('getDensityMapCellOpacity');
expect(historyChartSource).toContain('useHistoryChartState');
expect(historyChartSource).toContain('HistoryChartHeader');
expect(historyChartSource).toContain('HistoryChartOverlay');
@@ -2517,18 +2435,6 @@ describe('frontend resource type boundaries', () => {
expect(mobileNavBarModelSource).toContain('buildOrderedMobileNavUtilityTabs');
expect(mobileNavBarModelSource).toContain('getMobileNavAlertBadgeCounts');
expect(mobileNavBarModelSource).toContain('getMobileNavFadeState');
- expect(infrastructureDetailsDrawerStateSource).toContain('createSignal');
- expect(infrastructureDetailsDrawerStateSource).toContain(
- "type InfrastructureDetailsDrawerTab = 'overview' | 'discovery'",
- );
- expect(infrastructureDetailsDrawerModelSource).toContain(
- 'resolveInfrastructureDetailsDrawerMetadataId',
- );
- expect(infrastructureDetailsDrawerModelSource).toContain(
- 'resolveInfrastructureDetailsDrawerDiscoveryHostname',
- );
- expect(infrastructureDetailsDrawerModelSource).toContain('getInfrastructureMetadataId');
- expect(infrastructureDetailsDrawerModelSource).toContain('getInfrastructureDiscoveryHostname');
expect(useUnifiedResourcesSource).not.toContain('normalizeResourcePolicyAISafeSummary(');
expect(useUnifiedResourcesSource).not.toContain('normalizeResourcePolicy(');
expect(useUnifiedResourcesSource).not.toContain('const resolvePolicySensitivity =');
@@ -2671,30 +2577,6 @@ describe('frontend resource type boundaries', () => {
expect(discoverySettingsFormSource).not.toContain(
'Discovery settings are locked by environment variables.',
);
- expect(mailGatewaySource).toContain('getPMGThreatPresentation');
- expect(mailGatewaySource).not.toContain('const barColor =');
- expect(mailGatewaySource).not.toContain('const textColor =');
- expect(mailGatewaySource).toContain('getPMGQueueTextClass');
- expect(mailGatewaySource).toContain('getPMGOldestAgeTextClass');
- expect(mailGatewaySource).not.toContain('const queueSeverity =');
- expect(mailGatewaySource).toContain('ServiceHealthBadge');
- expect(mailGatewaySource).toContain('PMG_EMPTY_STATE_TITLE');
- expect(mailGatewaySource).toContain('PMG_EMPTY_STATE_DESCRIPTION');
- expect(mailGatewaySource).toContain('PMG_LOADING_STATE_TITLE');
- expect(mailGatewaySource).toContain('PMG_LOADING_STATE_DESCRIPTION');
- expect(mailGatewaySource).toContain('getPMGDisconnectedState');
- expect(mailGatewaySource).toContain('getPMGSearchEmptyState');
- expect(mailGatewaySource).toContain('PMG_SEARCH_PLACEHOLDER');
- expect(mailGatewaySource).not.toContain('No Mail Gateways configured');
- expect(mailGatewaySource).not.toContain('Loading mail gateway data...');
- expect(mailGatewaySource).not.toContain('Connection lost');
- expect(mailGatewaySource).not.toContain('Attempting to reconnect…');
- expect(mailGatewaySource).not.toContain('Unable to connect to the backend server');
- expect(mailGatewaySource).not.toContain('Search gateways...');
- expect(mailGatewaySource).not.toContain('No gateways match "');
- expect(mailGatewaySource).not.toContain('Reconnect now');
- expect(mailGatewaySource).not.toContain('Clear search');
- expect(mailGatewaySource).not.toContain('const StatusBadge: Component');
expect(proxmoxMailGatewayDrawerSource).toMatch(/<Table(?:\s|>)/);
expect(proxmoxMailGatewayDrawerSource).toContain('PLATFORM_TABLE_HEADER_ROW_CLASS');
expect(proxmoxMailGatewayDrawerSource).toContain('PLATFORM_TABLE_BODY_CLASS');
@@ -2702,41 +2584,12 @@ describe('frontend resource type boundaries', () => {
expect(proxmoxMailGatewayDrawerSource).toContain('getPlatformTableCellClassForKind');
expect(proxmoxMailGatewayDrawerSource).not.toContain('divide-y divide-border-subtle');
expect(proxmoxMailGatewayDrawerSource).not.toContain('<div class="mt-2 overflow-x-auto">');
- expect(mailGatewaySource).not.toContain('<div class="overflow-x-auto -mx-4 px-4">');
- expect(mailGatewaySource).not.toContain('wrapperClass="-mx-4 px-4"');
- expect(pmgInstancePanelSource).not.toContain('<div class="overflow-x-auto -mx-4 px-4">');
- expect(pmgInstancePanelSource).not.toContain('wrapperClass="-mx-4 px-4"');
- expect(pmgInstancePanelSource).not.toContain(
- '<div class="overflow-auto max-h-[240px] rounded-md border border-border">',
- );
- expect(pmgInstancePanelSource).not.toContain(
- '<div class="overflow-auto max-h-[260px] rounded-md border border-border">',
- );
expect(proxmoxMailGatewayDrawerSource).not.toContain('Search domains...');
expect(proxmoxMailGatewayDrawerSource).not.toContain('Unknown host');
expect(proxmoxMailGatewayDrawerSource).not.toContain('Spam Distribution');
expect(proxmoxMailGatewayDrawerSource).not.toContain('No PMG details for this resource yet');
expect(proxmoxMailGatewayDrawerSource).not.toContain('Loading mail gateway details...');
expect(proxmoxMailGatewayDrawerSource).not.toContain('Failed to load PMG details');
- expect(pmgInstancePanelSource).toContain('getPMGThreatPresentation');
- expect(pmgInstancePanelSource).not.toContain('const barColor =');
- expect(pmgInstancePanelSource).not.toContain('const textColor =');
- expect(pmgInstancePanelSource).toContain('getPMGQueueTextClass');
- expect(pmgInstancePanelSource).toContain('getPMGOldestAgeTextClass');
- expect(pmgInstancePanelSource).not.toContain('const queueSeverity =');
- expect(pmgInstancePanelSource).toContain('ServiceHealthBadge');
- expect(pmgInstancePanelSource).not.toContain('const StatusBadge: Component');
- expect(pmgPresentationSource).toContain('export const PMG_EMPTY_STATE_TITLE');
- expect(pmgPresentationSource).toContain('export const PMG_EMPTY_STATE_DESCRIPTION');
- expect(pmgPresentationSource).toContain('export const PMG_LOADING_STATE_TITLE');
- expect(pmgPresentationSource).toContain('export const PMG_LOADING_STATE_DESCRIPTION');
- expect(pmgPresentationSource).toContain('export const PMG_DISCONNECTED_STATE_TITLE');
- expect(pmgPresentationSource).toContain('export const PMG_SEARCH_PLACEHOLDER');
- expect(pmgPresentationSource).toContain('export function getPMGDisconnectedState');
- expect(pmgPresentationSource).toContain('export function getPMGSearchEmptyState');
- expect(pmgThreatPresentationSource).toContain('export function getPMGThreatPresentation');
- expect(pmgQueuePresentationSource).toContain('export function getPMGQueueTextClass');
- expect(pmgServiceHealthBadgeSource).toContain('getServiceHealthPresentation');
expect(proxmoxSettingsModelSource).toContain(
'export interface InfrastructurePlatformSettingsProps',
);
@@ -2797,8 +2650,6 @@ describe('frontend resource type boundaries', () => {
expect(storageDomainSource).toContain('export const getCephDisconnectedStatePresentation');
expect(storageDomainSource).toContain('export const getCephNoClustersStatePresentation');
expect(storageDomainSource).toContain('export const getCephPoolsSearchEmptyStatePresentation');
- expect(deployStatusBadgeSource).toContain('getDeployStatusPresentation');
- expect(deployStatusBadgeSource).not.toContain('const statusConfig: Record<DeployTargetStatus');
for (const source of [
]) {
expect(source).toContain("from '@/components/shared/Table'");
@@ -2809,15 +2660,6 @@ describe('frontend resource type boundaries', () => {
expect(source).not.toContain('<td ');
expect(source).not.toContain('<th ');
}
- expect(deployFlowPresentationSource).toContain(
- 'export function getDeployCandidatesLoadingState',
- );
- expect(deployFlowPresentationSource).toContain('export function getDeployNoSourceAgentsState');
- expect(deployFlowPresentationSource).toContain('export function getDeployNoCandidatesState');
- expect(deployFlowPresentationSource).toContain(
- 'export function getDeployInstallCommandLoadingState',
- );
- expect(deployStatusPresentationSource).toContain('export const getDeployStatusPresentation');
expect(alertHistoryTableSectionSource).toContain('AlertHistoryTableGroupRow');
expect(alertHistoryTableSectionSource).toContain('AlertHistoryTableAlertRow');
expect(alertHistoryTableAlertRowSource).toContain('getAlertHistoryStatusPresentation');