ledger: tell the truth on Platform API remove confirm

Agent rows already got an honest confirm-expansion ("Removing forgets
this agent from the ledger; history is retained…") plus uninstall
commands as a courtesy. Platform API rows (PVE / PBS / PMG / VMware /
TrueNAS) had nothing beyond "Click again to confirm," which left two
honest questions unanswered:

- Does this delete my history? (No — history is retained in v1.)
- Does this log me out of the platform itself? (No — credentials on
  the platform side are untouched.)

Add a parallel expansion for non-agent rows that answers both directly.
Matches the plan's "user-facing copy in Remove dialog must be explicit"
note and keeps honesty symmetric between Agent and Platform API rows.
This commit is contained in:
rcourtman
2026-04-20 10:44:58 +01:00
parent 06a602c5ef
commit 7e7765187b
2 changed files with 33 additions and 0 deletions
@@ -219,6 +219,18 @@ export const ConnectionsTable: Component<ConnectionsTableProps> = (props) => {
</TableRow>
</Show>
<Show when={!row.isAgent && isConfirmingRemove()}>
<TableRow>
<TableCell colspan={colSpan()} class="bg-surface-alt px-4 pb-3 pt-1">
<p class="text-xs text-muted">
Removing forgets this connection from Pulse; history is retained.
Credentials on the platform itself are untouched — revoke them there
separately if you want to invalidate access.
</p>
</TableCell>
</TableRow>
</Show>
<Show when={row.isAgent && isConfirmingRemove() && props.agentUninstallCommands}>
<TableRow>
<TableCell colspan={colSpan()} class="bg-surface-alt px-4 pb-4 pt-1">
@@ -190,6 +190,27 @@ describe('ConnectionsTable', () => {
expect(screen.queryByRole('button', { name: 'Remove' })).toBeNull();
});
it('tells the truth on Platform API remove confirm: history retained, platform untouched', () => {
const actions = makeActions({ confirmingRemove: () => true });
const pveConnection = connectionFixture({
id: 'pve:zeus',
type: 'pve',
name: 'zeus',
});
render(() => (
<ConnectionsTable
rows={() => [row({ connection: pveConnection, isAgent: false })]}
actions={actions}
onEdit={vi.fn()}
/>
));
expect(screen.getByText(/history is retained/i)).toBeInTheDocument();
expect(screen.getByText(/Credentials on the platform itself are untouched/i)).toBeInTheDocument();
// No uninstall block for Platform API rows — only agents get that courtesy.
expect(screen.queryByText(/--uninstall/)).toBeNull();
});
it('reveals the agent uninstall commands while confirming removal of an agent row', () => {
const actions = makeActions({ confirmingRemove: () => true });
const agentConnection = connectionFixture({