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.

v6(settings): phase 5 — inline the add-connection flow, retire the add drawer

rcourtmana1f8dbe8f990
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
index 08fdde73da..0c6e0f1f28 100644
--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
@@ -315,12 +315,15 @@ an add-only capacity posture.
rather than an installer pre-flight gate.
The unified add surface is
`frontend-modern/src/components/Settings/ConnectionEditor/ConnectionEditor.tsx`,
- mounted by `InfrastructureWorkspace.tsx` in place of the legacy
- type-picker step tree. The editor's probe step calls the aggregator
- probe endpoint and dispatches the detected or manually-selected type
- into a credential slot that renders the existing per-type panel; it
- must not bypass the probe endpoint or fabricate probe candidates, and
- the agent credential slot must continue to reach
+ mounted inline by `InfrastructureWorkspace.tsx` in place of the legacy
+ type-picker step tree. The add flow must not be a right-side drawer,
+ centered modal, or any other overlay chrome — it takes over the
+ infrastructure workspace in place, headed by a back-to-systems
+ affordance. The editor's probe step calls the aggregator probe
+ endpoint and dispatches the detected or manually-selected type into a
+ credential slot that renders the existing per-type panel; it must not
+ bypass the probe endpoint or fabricate probe candidates, and the
+ agent credential slot must continue to reach
`InfrastructureInstallerSection.tsx` so install handoffs remain on the
canonical unified-agent install path.
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 919e452e86..07ae17b115 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -235,7 +235,12 @@ work extends shared components instead of creating new local variants.
not through a per-type picker or per-type step tree. The editor's probe
step is the canonical entry point; credential slots are dispatched by the
detected or manually-selected type and must reach the existing per-type
- settings panel rather than diverging into a parallel add surface.
+ settings panel rather than diverging into a parallel add surface. The
+ add flow must render inline in place of the inventory table, not as a
+ right-side drawer, centered modal, or other overlay chrome — placing
+ isolated per-type forms behind a common drawer is re-wrapping, and the
+ unified add surface is specifically not allowed to reintroduce that
+ pattern.
6. Keep Proxmox deep-link route selection on the shared settings-navigation boundary. `frontend-modern/src/components/Settings/settingsNavigationModel.ts` and `frontend-modern/src/components/Settings/useSettingsNavigation.ts` must treat the canonical PBS and PMG Proxmox deep links as agent-selection authority even though those URLs resolve to the shared `infrastructure-operations` tab. Reloading or remounting on a PBS or PMG deep link must not silently fall back to the PVE selector state.
7. Keep shared storage feature presenters on canonical platform truth. When reusable storage presenters under `frontend-modern/src/features/storageBackups/` classify canonical resources for the shared storage route, API-backed virtualization datastores such as VMware must stay inventory-only datastores instead of inheriting PBS-specific backup-repository or protected-target copy from older fallback branches.
8. Keep shared source/platform vocabulary on the governed manifest boundary. `frontend-modern/src/utils/platformSupportManifest.generated.ts` must be the tracked frontend projection of `docs/release-control/v6/internal/PLATFORM_SUPPORT_MANIFEST.json`, `frontend-modern/src/utils/platformSupportManifest.ts`, `frontend-modern/src/utils/sourcePlatforms.ts`, and `frontend-modern/src/utils/sourcePlatformOptions.ts` must consume that generated projection instead of embedding divergent future-label lists, setup/onboarding path allowlists, or presentation-only guesses, and `frontend-modern/scripts/canonical-platform-audit.mjs` must fail when the generated projection drifts from the governed manifest.
diff --git a/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx b/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx
index 94423ed745..0fbc624f64 100644
--- a/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx
+++ b/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx
@@ -46,7 +46,7 @@ const InfrastructureWorkspaceContent: Component<InfrastructureWorkspaceProps> =
const location = useLocation();
const state = useInfrastructureOperationsContext();
- const [addDrawerOpen, setAddDrawerOpen] = createSignal(false);
+ const [addMode, setAddMode] = createSignal(false);
const [initialAddType, setInitialAddType] = createSignal<ConnectionType | null>(null);
const [showAgentProfiles, setShowAgentProfiles] = createSignal(false);
const readOnly = createMemo(() => presentationPolicyIsReadOnly());
@@ -59,7 +59,7 @@ const InfrastructureWorkspaceContent: Component<InfrastructureWorkspaceProps> =
const step = deriveAddStepFromLegacyPath(path);
navigate(buildInfrastructureWorkspacePath(), { replace: true });
if (!readOnly()) {
- setAddDrawerOpen(true);
+ setAddMode(true);
if (step && step !== 'pick') {
setInitialAddType(ADD_STEP_TO_TYPE[step]);
} else {
@@ -70,16 +70,16 @@ const InfrastructureWorkspaceContent: Component<InfrastructureWorkspaceProps> =
// Auto-open the agent installer when a setup handoff is waiting.
createEffect(() => {
- if (state.setupHandoff?.() && !addDrawerOpen() && !readOnly()) {
- setAddDrawerOpen(true);
+ if (state.setupHandoff?.() && !addMode() && !readOnly()) {
+ setAddMode(true);
setInitialAddType('agent');
}
});
- // Close add panel in read-only mode.
+ // Drop add mode in read-only sessions.
createEffect(() => {
- if (readOnly() && addDrawerOpen()) {
- setAddDrawerOpen(false);
+ if (readOnly() && addMode()) {
+ setAddMode(false);
}
});
@@ -95,10 +95,10 @@ const InfrastructureWorkspaceContent: Component<InfrastructureWorkspaceProps> =
? []
: [
{
- label: 'Add infrastructure',
+ label: 'Add connection',
onSelect: () => {
setInitialAddType(null);
- setAddDrawerOpen(true);
+ setAddMode(true);
setShowAgentProfiles(false);
},
tone: 'primary' as const,
@@ -121,8 +121,8 @@ const InfrastructureWorkspaceContent: Component<InfrastructureWorkspaceProps> =
}
};
- const closeAddDrawer = () => {
- setAddDrawerOpen(false);
+ const exitAddMode = () => {
+ setAddMode(false);
setInitialAddType(null);
setShowAgentProfiles(false);
};
@@ -141,97 +141,88 @@ const InfrastructureWorkspaceContent: Component<InfrastructureWorkspaceProps> =
return (
<div class="space-y-8">
- <ConnectionsTable
- rows={rows}
- headerActions={headerActions()}
- onManageRow={(row) => handleManageAction(row.manage)}
- />
-
- {/* Unified add-connection drawer */}
- <Dialog
- isOpen={addDrawerOpen()}
- onClose={closeAddDrawer}
- layout="drawer-right"
- panelClass="max-w-[820px]"
- ariaLabel="Add connection"
+ <Show
+ when={addMode()}
+ fallback={
+ <ConnectionsTable
+ rows={rows}
+ headerActions={headerActions()}
+ onManageRow={(row) => handleManageAction(row.manage)}
+ />
+ }
>
- <div class="flex h-full flex-col overflow-hidden">
- <div class="flex shrink-0 items-center justify-between gap-3 border-b border-border px-4 py-3">
- <span class="text-sm font-semibold text-base-content">Add connection</span>
+ <div class="space-y-4">
+ <div class="flex items-center justify-between gap-3">
+ <div>
+ <div class="text-base font-semibold text-base-content">Add connection</div>
+ <div class="mt-0.5 text-xs text-muted">
+ Paste an address — Pulse detects the product, you enter credentials, save.
+ </div>
+ </div>
<button
type="button"
- onClick={closeAddDrawer}
- class="rounded-md p-1 text-muted hover:bg-surface-hover hover:text-base-content"
- aria-label="Close"
+ onClick={exitAddMode}
+ 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"
>
- <svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path
- stroke-linecap="round"
- stroke-linejoin="round"
- stroke-width="2"
- d="M6 18L18 6M6 6l12 12"
- />
- </svg>
+ ← Back to systems
</button>
</div>
- <div class="flex-1 overflow-y-auto">
- <Show when={addDrawerOpen()}>
- <ConnectionEditor
- mode="add"
- initialType={initialAddType() ?? undefined}
- onClose={closeAddDrawer}
- renderCredentialSlot={({ type }) => {
- switch (type) {
- case 'pve':
- case 'pbs':
- case 'pmg':
- return renderProxmoxSlot(type);
- case 'truenas':
- return <TrueNASSettingsPanel state={props.trueNASSettings} />;
- case 'vmware':
- return <VMwareSettingsPanel state={props.vmwareSettings} />;
- case 'agent':
- return (
- <div class="space-y-4">
- <div class="flex items-center justify-end">
- <button
- type="button"
- onClick={() => setShowAgentProfiles((v) => !v)}
- 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"
- >
- {showAgentProfiles() ? 'Hide agent profiles' : 'Manage agent profiles'}
- </button>
- </div>
- <Show when={showAgentProfiles()}>
- <div class="rounded-xl border border-border bg-surface p-4 shadow-sm">
- <div class="mb-4 space-y-1">
- <div class="text-base font-semibold text-base-content">
- Agent profiles
- </div>
- <div class="text-sm text-muted">
- Manage reusable install defaults for agent-based systems.
- </div>
+ <div class="rounded-lg border border-border bg-surface">
+ <ConnectionEditor
+ mode="add"
+ initialType={initialAddType() ?? undefined}
+ onClose={exitAddMode}
+ renderCredentialSlot={({ type }) => {
+ switch (type) {
+ case 'pve':
+ case 'pbs':
+ case 'pmg':
+ return renderProxmoxSlot(type);
+ case 'truenas':
+ return <TrueNASSettingsPanel state={props.trueNASSettings} />;
+ case 'vmware':
+ return <VMwareSettingsPanel state={props.vmwareSettings} />;
+ case 'agent':
+ return (
+ <div class="space-y-4">
+ <div class="flex items-center justify-end">
+ <button
+ type="button"
+ onClick={() => setShowAgentProfiles((v) => !v)}
+ 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"
+ >
+ {showAgentProfiles() ? 'Hide agent profiles' : 'Manage agent profiles'}
+ </button>
+ </div>
+ <Show when={showAgentProfiles()}>
+ <div class="rounded-xl border border-border bg-surface p-4 shadow-sm">
+ <div class="mb-4 space-y-1">
+ <div class="text-base font-semibold text-base-content">
+ Agent profiles
+ </div>
+ <div class="text-sm text-muted">
+ Manage reusable install defaults for agent-based systems.
</div>
- <AgentProfilesPanel />
</div>
- </Show>
- <InfrastructureInstallerSection />
- </div>
- );
- default:
- return (
- <div class="text-sm text-muted">
- No credential form is wired up for the {type} type yet.
- </div>
- );
- }
- }}
- />
- </Show>
+ <AgentProfilesPanel />
+ </div>
+ </Show>
+ <InfrastructureInstallerSection />
+ </div>
+ );
+ default:
+ return (
+ <div class="text-sm text-muted">
+ No credential form is wired up for the {type} type yet.
+ </div>
+ );
+ }
+ }}
+ />
</div>
</div>
- </Dialog>
+ </Show>
{/* Active system detail drawer */}
<Dialog
diff --git a/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx b/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx
index 2408cf1063..dfe4cedc84 100644
--- a/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx
@@ -183,7 +183,7 @@ describe('InfrastructureWorkspace', () => {
renderWorkspace();
expect(screen.getByRole('heading', { name: 'Monitored systems' })).toBeInTheDocument();
- expect(screen.getByRole('button', { name: 'Add infrastructure' })).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: 'Add connection' })).toBeInTheDocument();
expect(screen.queryByTestId('install-section')).toBeNull();
expect(screen.queryByTestId('proxmox-section')).toBeNull();
expect(screen.queryByTestId('agent-profiles')).toBeNull();
@@ -201,7 +201,7 @@ describe('InfrastructureWorkspace', () => {
it('opens the unified add drawer with the probe step when Add infrastructure is clicked', () => {
renderWorkspace();
- fireEvent.click(screen.getByRole('button', { name: /Add infrastructure/i }));
+ fireEvent.click(screen.getByRole('button', { name: /Add connection/i }));
expect(screen.getByRole('button', { name: /Probe address/i })).toBeInTheDocument();
expect(screen.getByPlaceholderText(/pve01\.lan/)).toBeInTheDocument();
@@ -211,7 +211,7 @@ describe('InfrastructureWorkspace', () => {
it('routes to the agent credential slot when the user picks agent manually', () => {
renderWorkspace();
- fireEvent.click(screen.getByRole('button', { name: /Add infrastructure/i }));
+ fireEvent.click(screen.getByRole('button', { name: /Add connection/i }));
fireEvent.click(screen.getByRole('button', { name: /Enter credentials manually/i }));
fireEvent.click(screen.getByRole('button', { name: /Agent \(install on host\)/i }));
@@ -221,7 +221,7 @@ describe('InfrastructureWorkspace', () => {
it('routes to the TrueNAS credential slot when TrueNAS is picked manually', () => {
renderWorkspace();
- fireEvent.click(screen.getByRole('button', { name: /Add infrastructure/i }));
+ fireEvent.click(screen.getByRole('button', { name: /Add connection/i }));
fireEvent.click(screen.getByRole('button', { name: /Enter credentials manually/i }));
fireEvent.click(screen.getByRole('button', { name: /TrueNAS SCALE/i }));
@@ -231,7 +231,7 @@ describe('InfrastructureWorkspace', () => {
it('routes to the VMware credential slot when VMware is picked manually', () => {
renderWorkspace();
- fireEvent.click(screen.getByRole('button', { name: /Add infrastructure/i }));
+ fireEvent.click(screen.getByRole('button', { name: /Add connection/i }));
fireEvent.click(screen.getByRole('button', { name: /Enter credentials manually/i }));
fireEvent.click(screen.getByRole('button', { name: /VMware vCenter/i }));
@@ -241,7 +241,7 @@ describe('InfrastructureWorkspace', () => {
it('routes to the Proxmox credential slot when Proxmox VE is picked manually', () => {
renderWorkspace();
- fireEvent.click(screen.getByRole('button', { name: /Add infrastructure/i }));
+ fireEvent.click(screen.getByRole('button', { name: /Add connection/i }));
fireEvent.click(screen.getByRole('button', { name: /Enter credentials manually/i }));
fireEvent.click(screen.getByRole('button', { name: /^Proxmox VE/i }));
@@ -251,7 +251,7 @@ describe('InfrastructureWorkspace', () => {
it('can return to the probe step from a credential slot via Back to probe', () => {
renderWorkspace();
- fireEvent.click(screen.getByRole('button', { name: /Add infrastructure/i }));
+ fireEvent.click(screen.getByRole('button', { name: /Add connection/i }));
fireEvent.click(screen.getByRole('button', { name: /Enter credentials manually/i }));
fireEvent.click(screen.getByRole('button', { name: /Agent \(install on host\)/i }));
fireEvent.click(screen.getByRole('button', { name: /Back to probe/i }));
@@ -263,7 +263,7 @@ describe('InfrastructureWorkspace', () => {
it('toggles agent profiles inside the agent credential slot', () => {
renderWorkspace();
- fireEvent.click(screen.getByRole('button', { name: /Add infrastructure/i }));
+ fireEvent.click(screen.getByRole('button', { name: /Add connection/i }));
fireEvent.click(screen.getByRole('button', { name: /Enter credentials manually/i }));
fireEvent.click(screen.getByRole('button', { name: /Agent \(install on host\)/i }));
fireEvent.click(screen.getByRole('button', { name: 'Manage agent profiles' }));
@@ -274,7 +274,7 @@ describe('InfrastructureWorkspace', () => {
it('does not mount node-modal legacy spies when a credential slot is rendered', () => {
renderWorkspace();
- fireEvent.click(screen.getByRole('button', { name: /Add infrastructure/i }));
+ fireEvent.click(screen.getByRole('button', { name: /Add connection/i }));
fireEvent.click(screen.getByRole('button', { name: /Enter credentials manually/i }));
fireEvent.click(screen.getByRole('button', { name: /^Proxmox VE/i }));
@@ -313,7 +313,7 @@ describe('InfrastructureWorkspace', () => {
presentationPolicyIsReadOnlyMock.mockReturnValue(true);
renderWorkspace();
- expect(screen.queryByRole('button', { name: /Add infrastructure/i })).toBeNull();
+ expect(screen.queryByRole('button', { name: /Add connection/i })).toBeNull();
expect(screen.queryByTestId('install-section')).toBeNull();
expect(screen.queryByRole('button', { name: /Probe address/i })).toBeNull();
});