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.

refactor(connections): drop drawer, render detail inline in workspace

rcourtmane6352afbef2f
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
index 979fbade49..f13fd52803 100644
--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
@@ -37,7 +37,7 @@ management, and fleet control surfaces.
13. `frontend-modern/src/components/Settings/ConnectionsTable.tsx`
14. `frontend-modern/src/components/Settings/connectionsTableModel.ts`
15. `frontend-modern/src/components/Settings/useConnectionsLedger.ts`
-16. `frontend-modern/src/components/Settings/ConnectionDetailDrawer.tsx`
+16. `frontend-modern/src/components/Settings/ConnectionDetailPanel.tsx`
17. `frontend-modern/src/components/Settings/ConnectionEditor/ConnectionEditor.tsx`
18. `frontend-modern/src/components/Settings/ConnectionEditor/AddressProbeStep.tsx`
19. `frontend-modern/src/components/Settings/ConnectionEditor/useConnectionEditor.ts`
@@ -192,7 +192,7 @@ an add-only capacity posture.
4. Keep legacy Unified Agent compatibility names explicitly secondary when touching shared `internal/api/` runtime helpers: the legacy host-route family and `host-agent:*` scope names may remain as ingress or migration aliases, but they must not retake primary ownership in router state, live runtime scope checks, handler commentary, or operator-facing guidance.
5. Add or change the unified agent CLI entrypoint, version/help exit semantics, or startup argument/error routing through `cmd/pulse-agent/main.go`.
6. Add or change installer flags, persisted service arguments, or upgrade-safe re-entry behavior through `scripts/install.sh` and `scripts/install.ps1`.
-7. Add or change profile management, the extracted agent profiles runtime owner, the top-level infrastructure ledger, the pure unified-agent inventory/install model, the connections-ledger workspace shell, the unified ConnectionEditor and its per-type credential slots, route model, shared install section owner, the shared direct-node/discovery infrastructure settings owners plus their model, shared frontend install-command assembly, Proxmox setup/install API transport, TrueNAS platform-connection management, VMware platform-connection management, the shared monitored-system admission preview shell for those platform connections, setup-completion install handoff transport, deploy-fallback manual install transport, and fleet-control presentation through `frontend-modern/src/api/agentProfiles.ts`, `frontend-modern/src/api/nodes.ts`, `frontend-modern/src/components/Settings/AgentProfilesPanel.tsx`, `frontend-modern/src/components/Settings/useAgentProfilesPanelState.ts`, `frontend-modern/src/components/Settings/ConnectionsTable.tsx`, `frontend-modern/src/components/Settings/connectionsTableModel.ts`, `frontend-modern/src/components/Settings/useConnectionsLedger.ts`, `frontend-modern/src/components/Settings/ConnectionDetailDrawer.tsx`, `frontend-modern/src/components/Settings/ConnectionEditor/ConnectionEditor.tsx`, `frontend-modern/src/components/Settings/ConnectionEditor/AddressProbeStep.tsx`, `frontend-modern/src/components/Settings/ConnectionEditor/useConnectionEditor.ts`, `frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/NodeCredentialSlot.tsx`, `frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/TrueNASCredentialSlot.tsx`, `frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/VMwareCredentialSlot.tsx`, `frontend-modern/src/components/Settings/infrastructureOperationsModel.tsx`, `frontend-modern/src/components/Settings/InfrastructureInstallerSection.tsx`, `frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx`, `frontend-modern/src/components/Settings/infrastructureWorkspaceModel.ts`, `frontend-modern/src/components/Settings/MonitoredSystemAdmissionPreview.tsx`, `frontend-modern/src/components/Settings/platformConnectionsModel.ts`, `frontend-modern/src/components/Settings/useTrueNASSettingsPanelState.ts`, `frontend-modern/src/components/Settings/useVMwareSettingsPanelState.ts`, `frontend-modern/src/components/Settings/proxmoxSettingsModel.ts`, `frontend-modern/src/components/Settings/ConfiguredNodeTables.tsx`, `frontend-modern/src/components/Settings/SettingsSectionNav.tsx`, `frontend-modern/src/components/Settings/infrastructureSettingsModel.ts`, `frontend-modern/src/components/Settings/useInfrastructureConfiguredNodesState.ts`, `frontend-modern/src/components/Settings/useInfrastructureDiscoveryRuntimeState.ts`, `frontend-modern/src/components/Settings/useInfrastructureInstallState.tsx`, `frontend-modern/src/components/Settings/useInfrastructureOperationsState.tsx`, `frontend-modern/src/components/Settings/useInfrastructureSettingsState.ts`, `frontend-modern/src/components/Settings/nodeModalModel.ts`, `frontend-modern/src/components/Settings/useNodeModalState.ts`, `frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx`, and `frontend-modern/src/utils/agentInstallCommand.ts`. Phase 9 retired the legacy reporting/inventory surface (InfrastructureOperationsController, InfrastructureInventorySection, InfrastructureActiveRowDetails, InfrastructureIgnoredRowDetails, InfrastructureStopMonitoringDialog, useInfrastructureReportingState) and the per-type shells (PlatformConnectionsWorkspace, ProxmoxSettingsPanel, ProxmoxDirectWorkspace, ProxmoxConfiguredNodesTable, ProxmoxDirectConnectionsCard, ProxmoxDiscoveryResultsCard, ProxmoxDeleteNodeDialog, ProxmoxNodeModalStack, NodeModal shell, TrueNASSettingsPanel, VMwareSettingsPanel, useProxmoxDirectWorkspaceState); lifecycle extensions must route through the unified aggregator ledger plus ConnectionEditor credential slots rather than reintroducing those retired surfaces.
+7. Add or change profile management, the extracted agent profiles runtime owner, the top-level infrastructure ledger, the pure unified-agent inventory/install model, the connections-ledger workspace shell, the unified ConnectionEditor and its per-type credential slots, route model, shared install section owner, the shared direct-node/discovery infrastructure settings owners plus their model, shared frontend install-command assembly, Proxmox setup/install API transport, TrueNAS platform-connection management, VMware platform-connection management, the shared monitored-system admission preview shell for those platform connections, setup-completion install handoff transport, deploy-fallback manual install transport, and fleet-control presentation through `frontend-modern/src/api/agentProfiles.ts`, `frontend-modern/src/api/nodes.ts`, `frontend-modern/src/components/Settings/AgentProfilesPanel.tsx`, `frontend-modern/src/components/Settings/useAgentProfilesPanelState.ts`, `frontend-modern/src/components/Settings/ConnectionsTable.tsx`, `frontend-modern/src/components/Settings/connectionsTableModel.ts`, `frontend-modern/src/components/Settings/useConnectionsLedger.ts`, `frontend-modern/src/components/Settings/ConnectionDetailPanel.tsx`, `frontend-modern/src/components/Settings/ConnectionEditor/ConnectionEditor.tsx`, `frontend-modern/src/components/Settings/ConnectionEditor/AddressProbeStep.tsx`, `frontend-modern/src/components/Settings/ConnectionEditor/useConnectionEditor.ts`, `frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/NodeCredentialSlot.tsx`, `frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/TrueNASCredentialSlot.tsx`, `frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/VMwareCredentialSlot.tsx`, `frontend-modern/src/components/Settings/infrastructureOperationsModel.tsx`, `frontend-modern/src/components/Settings/InfrastructureInstallerSection.tsx`, `frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx`, `frontend-modern/src/components/Settings/infrastructureWorkspaceModel.ts`, `frontend-modern/src/components/Settings/MonitoredSystemAdmissionPreview.tsx`, `frontend-modern/src/components/Settings/platformConnectionsModel.ts`, `frontend-modern/src/components/Settings/useTrueNASSettingsPanelState.ts`, `frontend-modern/src/components/Settings/useVMwareSettingsPanelState.ts`, `frontend-modern/src/components/Settings/proxmoxSettingsModel.ts`, `frontend-modern/src/components/Settings/ConfiguredNodeTables.tsx`, `frontend-modern/src/components/Settings/SettingsSectionNav.tsx`, `frontend-modern/src/components/Settings/infrastructureSettingsModel.ts`, `frontend-modern/src/components/Settings/useInfrastructureConfiguredNodesState.ts`, `frontend-modern/src/components/Settings/useInfrastructureDiscoveryRuntimeState.ts`, `frontend-modern/src/components/Settings/useInfrastructureInstallState.tsx`, `frontend-modern/src/components/Settings/useInfrastructureOperationsState.tsx`, `frontend-modern/src/components/Settings/useInfrastructureSettingsState.ts`, `frontend-modern/src/components/Settings/nodeModalModel.ts`, `frontend-modern/src/components/Settings/useNodeModalState.ts`, `frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx`, and `frontend-modern/src/utils/agentInstallCommand.ts`. Phase 9 retired the legacy reporting/inventory surface (InfrastructureOperationsController, InfrastructureInventorySection, InfrastructureActiveRowDetails, InfrastructureIgnoredRowDetails, InfrastructureStopMonitoringDialog, useInfrastructureReportingState) and the per-type shells (PlatformConnectionsWorkspace, ProxmoxSettingsPanel, ProxmoxDirectWorkspace, ProxmoxConfiguredNodesTable, ProxmoxDirectConnectionsCard, ProxmoxDiscoveryResultsCard, ProxmoxDeleteNodeDialog, ProxmoxNodeModalStack, NodeModal shell, TrueNASSettingsPanel, VMwareSettingsPanel, useProxmoxDirectWorkspaceState); lifecycle extensions must route through the unified aggregator ledger plus ConnectionEditor credential slots rather than reintroducing those retired surfaces.
Those lifecycle-owned settings hooks may consume websocket state only through `frontend-modern/src/contexts/appRuntime.ts`; they must not import `frontend-modern/src/App.tsx` or recreate root-shell providers.
Public demo and other read-only settings posture must stay reporting-first
on that same lifecycle-owned workspace boundary: infrastructure workspace
@@ -343,12 +343,14 @@ an add-only capacity posture.
rows; the aggregator is the only configured-connections source of
truth. Drill-in
from a unified row opens
- `frontend-modern/src/components/Settings/ConnectionDetailDrawer.tsx`,
- which renders the aggregator fields directly (type, address, state,
- state reason, enabled flag, surfaces with active scope, last seen,
- last error) rather than the legacy `InfrastructureActiveRowDetails`
- surface-breakdown drawer; the active-row drawer is no longer mounted
- by the workspace for unified rows.
+ `frontend-modern/src/components/Settings/ConnectionDetailPanel.tsx`
+ inline as a workspace mode (alongside add and edit) with a
+ "Back to systems" header; the panel renders the aggregator fields
+ directly (type, address, state, state reason, enabled flag, surfaces
+ with active scope, last seen, last error) rather than the legacy
+ `InfrastructureActiveRowDetails` surface-breakdown drawer, and it
+ must not be re-wrapped in a floating `Dialog` drawer — the detail
+ view is a workspace mode, not an overlay.
The TrueNAS and VMware credential slots carry per-surface Monitor*
scope the same way the PVE/PBS/PMG credential slot already does:
`TrueNASSettingsPanelState`/`VMwareSettingsPanelState` read and
@@ -726,7 +728,7 @@ The connected-infrastructure reporting workspace also now treats API-backed
platform surfaces as platform-connection-managed capabilities, not host-managed
agent extensions. `frontend-modern/src/components/Settings/infrastructureOperationsModel.tsx`,
`frontend-modern/src/components/Settings/useConnectionsLedger.ts`, and
-`frontend-modern/src/components/Settings/ConnectionDetailDrawer.tsx` must keep
+`frontend-modern/src/components/Settings/ConnectionDetailPanel.tsx` must keep
Proxmox, PBS, PMG, and TrueNAS on the shared Infrastructure API-backed path,
while only machine-installed agent, Docker, and Kubernetes surfaces
participate in host stop-monitoring scope, uninstall commands, and upgrade
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index 9d94819fa7..4809fd6ebd 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -456,7 +456,7 @@ the canonical monitored-system blocked payload.
`frontend-modern/src/components/Settings/infrastructureOperationsModel.tsx`
together with
`frontend-modern/src/components/Settings/useConnectionsLedger.ts` and
- `frontend-modern/src/components/Settings/ConnectionDetailDrawer.tsx`
+ `frontend-modern/src/components/Settings/ConnectionDetailPanel.tsx`
must preserve the transport distinction between machine-managed surfaces
(`agent`, `docker`, `kubernetes`) and platform-connections-managed
surfaces (`proxmox`, `pbs`, `pmg`, `truenas`) instead of collapsing them
@@ -2909,7 +2909,7 @@ connected-infrastructure distinction between machine-managed and
platform-connections-managed reporting. `frontend-modern/src/types/api.ts`,
`frontend-modern/src/components/Settings/infrastructureOperationsModel.tsx`,
`frontend-modern/src/components/Settings/useConnectionsLedger.ts`, and
-`frontend-modern/src/components/Settings/ConnectionDetailDrawer.tsx`
+`frontend-modern/src/components/Settings/ConnectionDetailPanel.tsx`
must treat `truenas` as a canonical connected-infrastructure surface kind
alongside `proxmox`, `pbs`, and `pmg`, and the settings reporting/install
surfaces must keep those platform-managed rows navigable back to platform
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 9a95210907..ac7abadd11 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -260,8 +260,9 @@ work extends shared components instead of creating new local variants.
table rows from
`frontend-modern/src/components/Settings/useConnectionsLedger.ts`
(polling `GET /api/connections`) and the unified row click opens
- `frontend-modern/src/components/Settings/ConnectionDetailDrawer.tsx`,
- which reads the aggregator fields directly. Phase 9 retired the
+ `frontend-modern/src/components/Settings/ConnectionDetailPanel.tsx`
+ inline as a workspace mode, which reads the aggregator fields
+ directly and must not be re-wrapped as a floating `Dialog` drawer. Phase 9 retired the
parallel reporting/inventory surface entirely:
`useInfrastructureReportingState`, `InfrastructureOperationsController`,
`InfrastructureInventorySection`, `InfrastructureActiveRowDetails`,
@@ -1317,10 +1318,12 @@ The v6 welcome surface is one guided spotlight tour, not a modal plus a second
dashboard-only migration hint: it must dim the live app, glow the real
primary-navigation target being described, and keep route-orientation copy on
the existing welcome flow instead of layering a duplicate in-product banner.
-Its primary job is rapid v5-to-v6 reorientation. The modal should explain
-where familiar v5 destinations moved and what each v6 top-level area is for,
-so operators who feel briefly lost after upgrading can rebuild their mental
-map in one pass.
+Its primary job is fast route orientation. The modal should explain what each
+top-level area is for in plain product language, so operators can understand
+the new navigation in one pass without needing historical layout context.
+That copy should stay direct and present-tense. Each guided step should say
+what the destination does, not depend on v5 comparisons, migration framing, or
+older information architecture to make sense.
That guided welcome surface should stay compact. The canonical shape is a
coachmark-sized card centered on the current destination with one short
step-specific sentence, a small clickable step strip, and minimal footer
diff --git a/docs/release-control/v6/internal/subsystems/registry.json b/docs/release-control/v6/internal/subsystems/registry.json
index a5da1f59b4..c0173b6289 100644
--- a/docs/release-control/v6/internal/subsystems/registry.json
+++ b/docs/release-control/v6/internal/subsystems/registry.json
@@ -586,7 +586,7 @@
"frontend-modern/src/components/Infrastructure/deploy/ResultsStep.tsx",
"frontend-modern/src/components/Settings/AgentProfilesPanel.tsx",
"frontend-modern/src/components/Settings/ConfiguredNodeTables.tsx",
- "frontend-modern/src/components/Settings/ConnectionDetailDrawer.tsx",
+ "frontend-modern/src/components/Settings/ConnectionDetailPanel.tsx",
"frontend-modern/src/components/Settings/ConnectionEditor/AddressProbeStep.tsx",
"frontend-modern/src/components/Settings/ConnectionEditor/ConnectionEditor.tsx",
"frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/NodeCredentialSlot.tsx",
@@ -883,7 +883,7 @@
"match_prefixes": [],
"match_files": [
"frontend-modern/src/components/Settings/ConfiguredNodeTables.tsx",
- "frontend-modern/src/components/Settings/ConnectionDetailDrawer.tsx",
+ "frontend-modern/src/components/Settings/ConnectionDetailPanel.tsx",
"frontend-modern/src/components/Settings/ConnectionEditor/AddressProbeStep.tsx",
"frontend-modern/src/components/Settings/ConnectionEditor/ConnectionEditor.tsx",
"frontend-modern/src/components/Settings/ConnectionEditor/CredentialSlots/NodeCredentialSlot.tsx",
diff --git a/frontend-modern/src/components/Settings/ConnectionDetailDrawer.tsx b/frontend-modern/src/components/Settings/ConnectionDetailDrawer.tsx
deleted file mode 100644
index 4eb7db1b84..0000000000
--- a/frontend-modern/src/components/Settings/ConnectionDetailDrawer.tsx
+++ /dev/null
@@ -1,312 +0,0 @@
-import { Component, For, Show, createEffect, createSignal, onCleanup } from 'solid-js';
-import { Dialog } from '@/components/shared/Dialog';
-import { ConnectionsAPI, type Connection } from '@/api/connections';
-import { CONNECTION_TYPE_LABELS, surfaceLabel } from './useConnectionsLedger';
-
-interface ConnectionDetailDrawerProps {
- connection: () => Connection | undefined;
- onClose: () => void;
- onMutated?: () => void;
- onEdit?: (connection: Connection) => void;
-}
-
-const EDITABLE_CONNECTION_TYPES: readonly Connection['type'][] = [
- 'pve',
- 'pbs',
- 'pmg',
- 'vmware',
- 'truenas',
-];
-
-const REMOVE_CONFIRM_TIMEOUT_MS = 4000;
-
-const errorMessage = (err: unknown): string => {
- if (err instanceof Error && err.message) return err.message;
- if (typeof err === 'string' && err.trim()) return err;
- return 'Something went wrong.';
-};
-
-const formatLastSeen = (value: string | null): string => {
- if (!value) return 'No activity yet';
- const ts = Date.parse(value);
- if (Number.isNaN(ts)) return value;
- return new Date(ts).toLocaleString();
-};
-
-const formatErrorAt = (value: string): string => {
- const ts = Date.parse(value);
- if (Number.isNaN(ts)) return value;
- return new Date(ts).toLocaleString();
-};
-
-export const ConnectionDetailDrawer: Component<ConnectionDetailDrawerProps> = (props) => {
- const [pendingAction, setPendingAction] = createSignal<'pause' | 'remove' | null>(null);
- const [actionError, setActionError] = createSignal<string | null>(null);
- const [confirmingRemove, setConfirmingRemove] = createSignal(false);
- let confirmTimer: number | undefined;
-
- const clearConfirmTimer = () => {
- if (confirmTimer !== undefined) {
- window.clearTimeout(confirmTimer);
- confirmTimer = undefined;
- }
- };
-
- // Reset transient action state whenever the selected connection changes
- // (including when the drawer closes).
- createEffect(() => {
- props.connection();
- setPendingAction(null);
- setActionError(null);
- setConfirmingRemove(false);
- clearConfirmTimer();
- });
-
- onCleanup(clearConfirmTimer);
-
- const handlePauseToggle = async (connection: Connection) => {
- setActionError(null);
- setPendingAction('pause');
- try {
- await ConnectionsAPI.setEnabled(connection.id, !connection.enabled);
- props.onMutated?.();
- } catch (err) {
- setActionError(errorMessage(err));
- } finally {
- setPendingAction(null);
- }
- };
-
- const handleRemoveClick = async (connection: Connection) => {
- setActionError(null);
- if (!confirmingRemove()) {
- setConfirmingRemove(true);
- clearConfirmTimer();
- confirmTimer = window.setTimeout(() => {
- setConfirmingRemove(false);
- confirmTimer = undefined;
- }, REMOVE_CONFIRM_TIMEOUT_MS);
- return;
- }
- clearConfirmTimer();
- setConfirmingRemove(false);
- setPendingAction('remove');
- try {
- await ConnectionsAPI.remove(connection.id);
- props.onMutated?.();
- props.onClose();
- } catch (err) {
- setActionError(errorMessage(err));
- } finally {
- setPendingAction(null);
- }
- };
-
- return (
- <Dialog
- isOpen={Boolean(props.connection())}
- onClose={props.onClose}
- layout="drawer-right"
- panelClass="max-w-[560px]"
- ariaLabel="Connection details"
- >
- <Show when={props.connection()}>
- {(accessor) => {
- const connection = accessor();
- const typeLabel = CONNECTION_TYPE_LABELS[connection.type] ?? connection.type;
- const activeScopeKeys = Object.keys(connection.scope ?? {}).filter(
- (key) => connection.scope?.[key],
- );
- const inactiveScopeKeys = (connection.surfaces ?? []).filter(
- (key) => !activeScopeKeys.includes(key),
- );
- const canPause = connection.capabilities.supportsPause;
- const canRemove =
- connection.type !== 'docker' && connection.type !== 'kubernetes';
- const canEdit =
- Boolean(props.onEdit) && EDITABLE_CONNECTION_TYPES.includes(connection.type);
- const pauseLabel = connection.enabled ? 'Pause' : 'Resume';
- const pauseBusy = () => pendingAction() === 'pause';
- const removeBusy = () => pendingAction() === 'remove';
- const anyBusy = () => pendingAction() !== null;
- return (
- <div class="flex h-full flex-col">
- <div class="flex items-start justify-between gap-4 border-b border-border px-5 py-4">
- <div class="min-w-0 space-y-1">
- <div class="break-words text-base font-semibold text-base-content">
- {connection.name || connection.address || connection.id}
- </div>
- <div class="text-xs text-muted">{typeLabel}</div>
- </div>
- <button
- type="button"
- onClick={props.onClose}
- class="inline-flex items-center rounded-md border border-border px-2.5 py-1 text-xs font-medium text-base-content transition-colors hover:bg-surface-hover"
- >
- Close
- </button>
- </div>
-
- <div class="flex-1 overflow-y-auto px-5 py-4">
- <dl class="space-y-4 text-sm">
- <div>
- <dt class="text-xs font-semibold uppercase tracking-wide text-muted">
- Address
- </dt>
- <dd class="mt-1 break-all text-base-content">{connection.address || '—'}</dd>
- </div>
-
- <div>
- <dt class="text-xs font-semibold uppercase tracking-wide text-muted">State</dt>
- <dd class="mt-1 text-base-content">
- <div class="font-medium capitalize">{connection.state}</div>
- <Show when={connection.stateReason}>
- <div class="mt-0.5 text-xs text-muted">{connection.stateReason}</div>
- </Show>
- </dd>
- </div>
-
- <div>
- <dt class="text-xs font-semibold uppercase tracking-wide text-muted">
- Enabled
- </dt>
- <dd class="mt-1 text-base-content">
- {connection.enabled ? 'Yes' : 'No (paused)'}
- </dd>
- </div>
-
- <div>
- <dt class="text-xs font-semibold uppercase tracking-wide text-muted">
- Surfaces collected
- </dt>
- <dd class="mt-1 flex flex-wrap gap-1.5">
- <Show
- when={activeScopeKeys.length > 0}
- fallback={
- <span class="text-xs text-muted">
- No surfaces currently enabled for collection.
- </span>
- }
- >
- <For each={activeScopeKeys}>
- {(key) => (
- <span class="inline-flex items-center rounded-full border border-border bg-surface px-2 py-0.5 text-xs font-medium text-base-content">
- {surfaceLabel(key)}
- </span>
- )}
- </For>
- </Show>
- </dd>
- <Show when={inactiveScopeKeys.length > 0}>
- <dd class="mt-2 flex flex-wrap gap-1.5">
- <For each={inactiveScopeKeys}>
- {(key) => (
- <span class="inline-flex items-center rounded-full border border-dashed border-border bg-surface-alt px-2 py-0.5 text-xs font-medium text-muted">
- {surfaceLabel(key)} (paused)
- </span>
- )}
- </For>
- </dd>
- </Show>
- </div>
-
- <div>
- <dt class="text-xs font-semibold uppercase tracking-wide text-muted">
- Last activity
- </dt>
- <dd class="mt-1 text-base-content">{formatLastSeen(connection.lastSeen)}</dd>
- </div>
-
- <Show when={connection.lastError}>
- {(errorAccessor) => {
- const err = errorAccessor();
- return (
- <div>
- <dt class="text-xs font-semibold uppercase tracking-wide text-muted">
- Last error
- </dt>
- <dd class="mt-1 space-y-1">
- <div class="break-words text-rose-700 dark:text-rose-300">
- {err.message}
- </div>
- <div class="text-xs text-muted">{formatErrorAt(err.at)}</div>
- </dd>
- </div>
- );
- }}
- </Show>
-
- <div>
- <dt class="text-xs font-semibold uppercase tracking-wide text-muted">
- Source
- </dt>
- <dd class="mt-1 text-base-content capitalize">{connection.source}</dd>
- </div>
- </dl>
- </div>
-
- <Show when={canEdit || canPause || canRemove}>
- <div class="space-y-2 border-t border-border px-5 py-4">
- <Show when={actionError()}>
- <div
- role="alert"
- class="rounded-md border border-rose-300 bg-rose-50 px-3 py-2 text-xs text-rose-800 dark:border-rose-900 dark:bg-rose-950 dark:text-rose-200"
- >
- {actionError()}
- </div>
- </Show>
- <div class="flex flex-wrap items-center justify-end gap-2">
- <Show when={canEdit}>
- <button
- type="button"
- disabled={anyBusy()}
- onClick={() => props.onEdit?.(connection)}
- class="inline-flex items-center rounded-md border border-border px-3 py-1.5 text-sm font-medium text-base-content transition-colors hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-60"
- >
- Edit
- </button>
- </Show>
- <Show when={canPause}>
- <button
- type="button"
- disabled={anyBusy()}
- onClick={() => void handlePauseToggle(connection)}
- class="inline-flex items-center rounded-md border border-border px-3 py-1.5 text-sm font-medium text-base-content transition-colors hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-60"
- >
- {pauseBusy() ? 'Working…' : pauseLabel}
- </button>
- </Show>
- <Show when={canRemove}>
- <button
- type="button"
- disabled={anyBusy()}
- onClick={() => void handleRemoveClick(connection)}
- class={
- confirmingRemove()
- ? 'inline-flex items-center rounded-md bg-rose-600 px-3 py-1.5 text-sm font-medium text-white transition-colors hover:bg-rose-700 disabled:cursor-not-allowed disabled:opacity-60'
- : 'inline-flex items-center rounded-md border border-rose-300 px-3 py-1.5 text-sm font-medium text-rose-700 transition-colors hover:bg-rose-50 disabled:cursor-not-allowed disabled:opacity-60 dark:border-rose-900 dark:text-rose-300 dark:hover:bg-rose-950'
- }
- >
- {removeBusy()
- ? 'Removing…'
- : confirmingRemove()
- ? 'Click again to confirm'
- : 'Remove'}
- </button>
- </Show>
- </div>
- <Show when={connection.type === 'agent'}>
- <p class="text-xs text-muted">
- Removing stops recording this agent. Run the uninstall command on the host to
- fully detach; history is retained.
- </p>
- </Show>
- </div>
- </Show>
- </div>
- );
- }}
- </Show>
- </Dialog>
- );
-};
diff --git a/frontend-modern/src/components/Settings/ConnectionDetailPanel.tsx b/frontend-modern/src/components/Settings/ConnectionDetailPanel.tsx
new file mode 100644
index 0000000000..f74e7a1a67
--- /dev/null
+++ b/frontend-modern/src/components/Settings/ConnectionDetailPanel.tsx
@@ -0,0 +1,284 @@
+import { Component, For, Show, createEffect, createSignal, onCleanup } from 'solid-js';
+import { ConnectionsAPI, type Connection } from '@/api/connections';
+import { CONNECTION_TYPE_LABELS, surfaceLabel } from './useConnectionsLedger';
+
+interface ConnectionDetailPanelProps {
+ connection: () => Connection | undefined;
+ onMutated?: () => void;
+ onEdit?: (connection: Connection) => void;
+ onRemoved?: () => void;
+}
+
+const EDITABLE_CONNECTION_TYPES: readonly Connection['type'][] = [
+ 'pve',
+ 'pbs',
+ 'pmg',
+ 'vmware',
+ 'truenas',
+];
+
+const REMOVE_CONFIRM_TIMEOUT_MS = 4000;
+
+const errorMessage = (err: unknown): string => {
+ if (err instanceof Error && err.message) return err.message;
+ if (typeof err === 'string' && err.trim()) return err;
+ return 'Something went wrong.';
+};
+
+const formatLastSeen = (value: string | null): string => {
+ if (!value) return 'No activity yet';
+ const ts = Date.parse(value);
+ if (Number.isNaN(ts)) return value;
+ return new Date(ts).toLocaleString();
+};
+
+const formatErrorAt = (value: string): string => {
+ const ts = Date.parse(value);
+ if (Number.isNaN(ts)) return value;
+ return new Date(ts).toLocaleString();
+};
+
+export const ConnectionDetailPanel: Component<ConnectionDetailPanelProps> = (props) => {
+ const [pendingAction, setPendingAction] = createSignal<'pause' | 'remove' | null>(null);
+ const [actionError, setActionError] = createSignal<string | null>(null);
+ const [confirmingRemove, setConfirmingRemove] = createSignal(false);
+ let confirmTimer: number | undefined;
+
+ const clearConfirmTimer = () => {
+ if (confirmTimer !== undefined) {
+ window.clearTimeout(confirmTimer);
+ confirmTimer = undefined;
+ }
+ };
+
+ // Reset transient action state whenever the selected connection changes.
+ createEffect(() => {
+ props.connection();
+ setPendingAction(null);
+ setActionError(null);
+ setConfirmingRemove(false);
+ clearConfirmTimer();
+ });
+
+ onCleanup(clearConfirmTimer);
+
+ const handlePauseToggle = async (connection: Connection) => {
+ setActionError(null);
+ setPendingAction('pause');
+ try {
+ await ConnectionsAPI.setEnabled(connection.id, !connection.enabled);
+ props.onMutated?.();
+ } catch (err) {
+ setActionError(errorMessage(err));
+ } finally {
+ setPendingAction(null);
+ }
+ };
+
+ const handleRemoveClick = async (connection: Connection) => {
+ setActionError(null);
+ if (!confirmingRemove()) {
+ setConfirmingRemove(true);
+ clearConfirmTimer();
+ confirmTimer = window.setTimeout(() => {
+ setConfirmingRemove(false);
+ confirmTimer = undefined;
+ }, REMOVE_CONFIRM_TIMEOUT_MS);
+ return;
+ }
+ clearConfirmTimer();
+ setConfirmingRemove(false);
+ setPendingAction('remove');
+ try {
+ await ConnectionsAPI.remove(connection.id);
+ props.onMutated?.();
+ props.onRemoved?.();
+ } catch (err) {
+ setActionError(errorMessage(err));
+ } finally {
+ setPendingAction(null);
+ }
+ };
+
+ return (
+ <Show when={props.connection()}>
+ {(accessor) => {
+ const connection = accessor();
+ const typeLabel = CONNECTION_TYPE_LABELS[connection.type] ?? connection.type;
+ const activeScopeKeys = Object.keys(connection.scope ?? {}).filter(
+ (key) => connection.scope?.[key],
+ );
+ const inactiveScopeKeys = (connection.surfaces ?? []).filter(
+ (key) => !activeScopeKeys.includes(key),
+ );
+ const canPause = connection.capabilities.supportsPause;
+ const canRemove = connection.type !== 'docker' && connection.type !== 'kubernetes';
+ const canEdit =
+ Boolean(props.onEdit) && EDITABLE_CONNECTION_TYPES.includes(connection.type);
+ const pauseLabel = connection.enabled ? 'Pause' : 'Resume';
+ const pauseBusy = () => pendingAction() === 'pause';
+ const removeBusy = () => pendingAction() === 'remove';
+ const anyBusy = () => pendingAction() !== null;
+ return (
+ <div class="rounded-lg border border-border bg-surface">
+ <div class="px-5 py-4">
+ <dl class="grid gap-4 text-sm sm:grid-cols-2">
+ <div>
+ <dt class="text-xs font-semibold uppercase tracking-wide text-muted">Type</dt>
+ <dd class="mt-1 text-base-content">{typeLabel}</dd>
+ </div>
+
+ <div>
+ <dt class="text-xs font-semibold uppercase tracking-wide text-muted">Address</dt>
+ <dd class="mt-1 break-all text-base-content">{connection.address || '—'}</dd>
+ </div>
+
+ <div>
+ <dt class="text-xs font-semibold uppercase tracking-wide text-muted">State</dt>
+ <dd class="mt-1 text-base-content">
+ <div class="font-medium capitalize">{connection.state}</div>
+ <Show when={connection.stateReason}>
+ <div class="mt-0.5 text-xs text-muted">{connection.stateReason}</div>
+ </Show>
+ </dd>
+ </div>
+
+ <div>
+ <dt class="text-xs font-semibold uppercase tracking-wide text-muted">Enabled</dt>
+ <dd class="mt-1 text-base-content">
+ {connection.enabled ? 'Yes' : 'No (paused)'}
+ </dd>
+ </div>
+
+ <div class="sm:col-span-2">
+ <dt class="text-xs font-semibold uppercase tracking-wide text-muted">
+ Surfaces collected
+ </dt>
+ <dd class="mt-1 flex flex-wrap gap-1.5">
+ <Show
+ when={activeScopeKeys.length > 0}
+ fallback={
+ <span class="text-xs text-muted">
+ No surfaces currently enabled for collection.
+ </span>
+ }
+ >
+ <For each={activeScopeKeys}>
+ {(key) => (
+ <span class="inline-flex items-center rounded-full border border-border bg-surface px-2 py-0.5 text-xs font-medium text-base-content">
+ {surfaceLabel(key)}
+ </span>
+ )}
+ </For>
+ </Show>
+ </dd>
+ <Show when={inactiveScopeKeys.length > 0}>
+ <dd class="mt-2 flex flex-wrap gap-1.5">
+ <For each={inactiveScopeKeys}>
+ {(key) => (
+ <span class="inline-flex items-center rounded-full border border-dashed border-border bg-surface-alt px-2 py-0.5 text-xs font-medium text-muted">
+ {surfaceLabel(key)} (paused)
+ </span>
+ )}
+ </For>
+ </dd>
+ </Show>
+ </div>
+
+ <div>
+ <dt class="text-xs font-semibold uppercase tracking-wide text-muted">
+ Last activity
+ </dt>
+ <dd class="mt-1 text-base-content">{formatLastSeen(connection.lastSeen)}</dd>
+ </div>
+
+ <div>
+ <dt class="text-xs font-semibold uppercase tracking-wide text-muted">Source</dt>
+ <dd class="mt-1 text-base-content capitalize">{connection.source}</dd>
+ </div>
+
+ <Show when={connection.lastError}>
+ {(errorAccessor) => {
+ const err = errorAccessor();
+ return (
+ <div class="sm:col-span-2">
+ <dt class="text-xs font-semibold uppercase tracking-wide text-muted">
+ Last error
+ </dt>
+ <dd class="mt-1 space-y-1">
+ <div class="break-words text-rose-700 dark:text-rose-300">
+ {err.message}
+ </div>
+ <div class="text-xs text-muted">{formatErrorAt(err.at)}</div>
+ </dd>
+ </div>
+ );
+ }}
+ </Show>
+ </dl>
+ </div>
+
+ <Show when={canEdit || canPause || canRemove}>
+ <div class="space-y-2 border-t border-border px-5 py-4">
+ <Show when={actionError()}>
+ <div
+ role="alert"
+ class="rounded-md border border-rose-300 bg-rose-50 px-3 py-2 text-xs text-rose-800 dark:border-rose-900 dark:bg-rose-950 dark:text-rose-200"
+ >
+ {actionError()}
+ </div>
+ </Show>
+ <div class="flex flex-wrap items-center justify-end gap-2">
+ <Show when={canEdit}>
+ <button
+ type="button"
+ disabled={anyBusy()}
+ onClick={() => props.onEdit?.(connection)}
+ class="inline-flex items-center rounded-md border border-border px-3 py-1.5 text-sm font-medium text-base-content transition-colors hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-60"
+ >
+ Edit
+ </button>
+ </Show>
+ <Show when={canPause}>
+ <button
+ type="button"
+ disabled={anyBusy()}
+ onClick={() => void handlePauseToggle(connection)}
+ class="inline-flex items-center rounded-md border border-border px-3 py-1.5 text-sm font-medium text-base-content transition-colors hover:bg-surface-hover disabled:cursor-not-allowed disabled:opacity-60"
+ >
+ {pauseBusy() ? 'Working…' : pauseLabel}
+ </button>
+ </Show>
+ <Show when={canRemove}>
+ <button
+ type="button"
+ disabled={anyBusy()}
+ onClick={() => void handleRemoveClick(connection)}
+ class={
+ confirmingRemove()
+ ? 'inline-flex items-center rounded-md bg-rose-600 px-3 py-1.5 text-sm font-medium text-white transition-colors hover:bg-rose-700 disabled:cursor-not-allowed disabled:opacity-60'
+ : 'inline-flex items-center rounded-md border border-rose-300 px-3 py-1.5 text-sm font-medium text-rose-700 transition-colors hover:bg-rose-50 disabled:cursor-not-allowed disabled:opacity-60 dark:border-rose-900 dark:text-rose-300 dark:hover:bg-rose-950'
+ }
+ >
+ {removeBusy()
+ ? 'Removing…'
+ : confirmingRemove()
+ ? 'Click again to confirm'
+ : 'Remove'}
+ </button>
+ </Show>
+ </div>
+ <Show when={connection.type === 'agent'}>
+ <p class="text-xs text-muted">
+ Removing stops recording this agent. Run the uninstall command on the host to
+ fully detach; history is retained.
+ </p>
+ </Show>
+ </div>
+ </Show>
+ </div>
+ );
+ }}
+ </Show>
+ );
+};
diff --git a/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx b/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx
index 2b48180b83..a775907b78 100644
--- a/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx
+++ b/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx
@@ -2,7 +2,7 @@ import { Component, Match, Show, Switch, createEffect, createMemo, createSignal
import { useLocation, useNavigate, useSearchParams } from '@solidjs/router';
import { presentationPolicyIsReadOnly } from '@/stores/sessionPresentationPolicy';
import { AgentProfilesPanel } from './AgentProfilesPanel';
-import { ConnectionDetailDrawer } from './ConnectionDetailDrawer';
+import { ConnectionDetailPanel } from './ConnectionDetailPanel';
import { ConnectionsTable, type ConnectionsTableHeaderAction } from './ConnectionsTable';
import type { InfrastructureSystemRow, SystemManageAction } from './connectionsTableModel';
import { ConnectionEditor } from './ConnectionEditor/ConnectionEditor';
@@ -179,12 +179,15 @@ const InfrastructureWorkspaceContent: Component<InfrastructureWorkspaceProps> =
);
};
- const mode = createMemo<'ledger' | 'add' | 'edit'>(() => {
+ const mode = createMemo<'ledger' | 'add' | 'edit' | 'detail'>(() => {
if (editingConnection()) return 'edit';
if (addMode()) return 'add';
+ if (selectedConnection()) return 'detail';
return 'ledger';
});
+ const exitDetailMode = () => setSelectedConnectionId(null);
+
return (
<div class="space-y-8">
<Switch
@@ -297,6 +300,39 @@ const InfrastructureWorkspaceContent: Component<InfrastructureWorkspaceProps> =
}}
</Match>
+ <Match when={mode() === 'detail' && selectedConnection()}>
+ {(accessor) => {
+ const connection = accessor();
+ const handleEditFromDetail = () => handleEditConnection(connection);
+ return (
+ <div class="space-y-4">
+ <div class="flex items-center justify-between gap-3">
+ <div>
+ <div class="text-base font-semibold text-base-content">
+ {connection.name || connection.address || connection.id}
+ </div>
+ <div class="mt-0.5 text-xs text-muted">{connection.address}</div>
+ </div>
+ <button
+ type="button"
+ onClick={exitDetailMode}
+ class="inline-flex items-center gap-1 rounded-md border border-border px-3 py-1.5 text-sm font-medium text-base-content transition-colors hover:bg-surface-hover"
+ >
+ ← Back to systems
+ </button>
+ </div>
+
+ <ConnectionDetailPanel
+ connection={selectedConnection}
+ onMutated={() => ledger.reload()}
+ onEdit={handleEditFromDetail}
+ onRemoved={exitDetailMode}
+ />
+ </div>
+ );
+ }}
+ </Match>
+
<Match when={mode() === 'add'}>
<div class="space-y-4">
<div class="flex items-center justify-between gap-3">
@@ -383,13 +419,6 @@ const InfrastructureWorkspaceContent: Component<InfrastructureWorkspaceProps> =
</div>
</Match>
</Switch>
-
- <ConnectionDetailDrawer
- connection={selectedConnection}
- onClose={() => setSelectedConnectionId(null)}
- onMutated={() => ledger.reload()}
- onEdit={handleEditConnection}
- />
</div>
);
};
diff --git a/frontend-modern/src/components/Settings/__tests__/ConnectionDetailDrawer.test.tsx b/frontend-modern/src/components/Settings/__tests__/ConnectionDetailPanel.test.tsx
similarity index 89%
rename from frontend-modern/src/components/Settings/__tests__/ConnectionDetailDrawer.test.tsx
rename to frontend-modern/src/components/Settings/__tests__/ConnectionDetailPanel.test.tsx
index 257cfe01e4..dafaba106e 100644
--- a/frontend-modern/src/components/Settings/__tests__/ConnectionDetailDrawer.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/ConnectionDetailPanel.test.tsx
@@ -1,6 +1,6 @@
import { cleanup, fireEvent, render, screen, waitFor } from '@solidjs/testing-library';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
-import { ConnectionDetailDrawer } from '../ConnectionDetailDrawer';
+import { ConnectionDetailPanel } from '../ConnectionDetailPanel';
import type { Connection } from '@/api/connections';
const setEnabled = vi.fn<(connectionId: string, enabled: boolean) => Promise<void>>();
@@ -53,7 +53,7 @@ const agentConnection = (overrides: Partial<Connection> = {}): Connection => ({
...overrides,
});
-describe('ConnectionDetailDrawer', () => {
+describe('ConnectionDetailPanel', () => {
beforeEach(() => {
setEnabled.mockReset();
remove.mockReset();
@@ -62,9 +62,8 @@ describe('ConnectionDetailDrawer', () => {
it('hides pause for agent connections but still allows remove', () => {
render(() => (
- <ConnectionDetailDrawer
+ <ConnectionDetailPanel
connection={() => agentConnection()}
- onClose={() => {}}
onMutated={() => {}}
/>
));
@@ -77,9 +76,8 @@ describe('ConnectionDetailDrawer', () => {
it('shows Edit for pve connections and invokes onEdit with the connection', () => {
const onEdit = vi.fn();
render(() => (
- <ConnectionDetailDrawer
+ <ConnectionDetailPanel
connection={() => pveConnection()}
- onClose={() => {}}
onMutated={() => {}}
onEdit={onEdit}
/>
@@ -94,11 +92,10 @@ describe('ConnectionDetailDrawer', () => {
it('shows Edit for vmware connections', () => {
const onEdit = vi.fn();
render(() => (
- <ConnectionDetailDrawer
+ <ConnectionDetailPanel
connection={() =>
pveConnection({ id: 'vmware:abc', type: 'vmware', name: 'vcsa' })
}
- onClose={() => {}}
onMutated={() => {}}
onEdit={onEdit}
/>
@@ -113,11 +110,10 @@ describe('ConnectionDetailDrawer', () => {
it('shows Edit for truenas connections', () => {
const onEdit = vi.fn();
render(() => (
- <ConnectionDetailDrawer
+ <ConnectionDetailPanel
connection={() =>
pveConnection({ id: 'truenas:xyz', type: 'truenas', name: 'tower' })
}
- onClose={() => {}}
onMutated={() => {}}
onEdit={onEdit}
/>
@@ -131,9 +127,8 @@ describe('ConnectionDetailDrawer', () => {
it('omits Edit for agent connections (edit is not yet supported)', () => {
render(() => (
- <ConnectionDetailDrawer
+ <ConnectionDetailPanel
connection={() => agentConnection()}
- onClose={() => {}}
onMutated={() => {}}
onEdit={() => {}}
/>
@@ -147,9 +142,8 @@ describe('ConnectionDetailDrawer', () => {
const onMutated = vi.fn();
render(() => (
- <ConnectionDetailDrawer
+ <ConnectionDetailPanel
connection={() => pveConnection()}
- onClose={() => {}}
onMutated={onMutated}
/>
));
@@ -167,9 +161,8 @@ describe('ConnectionDetailDrawer', () => {
const onMutated = vi.fn();
render(() => (
- <ConnectionDetailDrawer
+ <ConnectionDetailPanel
connection={() => pveConnection()}
- onClose={() => {}}
onMutated={onMutated}
/>
));
@@ -182,16 +175,16 @@ describe('ConnectionDetailDrawer', () => {
expect(onMutated).not.toHaveBeenCalled();
});
- it('requires a second click to confirm removal, then calls remove + onClose + onMutated', async () => {
+ it('requires a second click to confirm removal, then calls remove + onRemoved + onMutated', async () => {
remove.mockResolvedValueOnce(undefined);
const onMutated = vi.fn();
- const onClose = vi.fn();
+ const onRemoved = vi.fn();
render(() => (
- <ConnectionDetailDrawer
+ <ConnectionDetailPanel
connection={() => pveConnection()}
- onClose={onClose}
onMutated={onMutated}
+ onRemoved={onRemoved}
/>
));
@@ -206,7 +199,7 @@ describe('ConnectionDetailDrawer', () => {
await waitFor(() => {
expect(remove).toHaveBeenCalledWith('pve:tower');
expect(onMutated).toHaveBeenCalledTimes(1);
- expect(onClose).toHaveBeenCalledTimes(1);
+ expect(onRemoved).toHaveBeenCalledTimes(1);
});
});
});
diff --git a/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx b/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx
index 854c330f66..ba98f83af7 100644
--- a/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx
@@ -81,18 +81,12 @@ vi.mock('../AgentProfilesPanel', () => ({
AgentProfilesPanel: () => <div data-testid="agent-profiles">profiles</div>,
}));
-vi.mock('../ConnectionDetailDrawer', () => ({
- ConnectionDetailDrawer: (props: {
- connection: () => Connection | undefined;
- onClose: () => void;
- }) => (
+vi.mock('../ConnectionDetailPanel', () => ({
+ ConnectionDetailPanel: (props: { connection: () => Connection | undefined }) => (
<>
{props.connection() ? (
- <div role="dialog" aria-label="Connection details">
+ <div data-testid="connection-detail-panel">
<div>{props.connection()!.name || props.connection()!.id}</div>
- <button type="button" onClick={props.onClose}>
- Close
- </button>
</div>
) : null}
</>
@@ -304,15 +298,16 @@ describe('InfrastructureWorkspace', () => {
expect(screen.getByTestId('agent-profiles')).toBeInTheDocument();
});
- it('opens the connection detail drawer when a ledger row is viewed', async () => {
+ it('opens the inline connection detail panel when a ledger row is viewed', async () => {
renderWorkspace();
await waitFor(() => expect(screen.getByText('zeus')).toBeInTheDocument());
fireEvent.click(screen.getByRole('button', { name: 'View details' }));
- const dialog = screen.getByRole('dialog', { name: 'Connection details' });
- expect(dialog).toBeInTheDocument();
- expect(within(dialog).getByText('zeus')).toBeInTheDocument();
+ const panel = screen.getByTestId('connection-detail-panel');
+ expect(panel).toBeInTheDocument();
+ expect(within(panel).getByText('zeus')).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: /Back to systems/i })).toBeInTheDocument();
});
it('redirects legacy install deep links and pre-selects the agent install slot', async () => {