diff --git a/e2e/connections.spec.ts b/e2e/connections.spec.ts
index e9d32f15..303e7bed 100644
--- a/e2e/connections.spec.ts
+++ b/e2e/connections.spec.ts
@@ -395,10 +395,14 @@ test('closing a connection removes it from the list and clears the selection', a
await expect(page.locator('.rp-toast.positive')).toContainText('Closed api.telegram.org');
await expect(page).toHaveURL(/#\/connections$/);
await expect(page.locator('.rp-table [data-key="c-0001"]')).toHaveCount(0);
- // A kernel-observed connection is refused by the backend, and the row stays.
+ // A kernel-forwarded connection has no userspace transport to cancel, so Close says why before it is pressed.
await page.goto('/#/connections?id=c-0002');
- await panel.getByRole('button', {name: 'Close connection', exact: true}).click();
- await expect(page.locator('.rp-toast.negative')).toContainText('cannot be closed');
+ const reason =
+ 'The backend has no userspace transfer to interrupt, so this connection cannot be closed. Connections the kernel forwards directly are of this kind.';
+ const close = panel.getByRole('button', {name: 'Close connection', exact: true});
+ await expect(close).toBeDisabled();
+ await expect(close).toHaveAccessibleDescription(reason);
+ await expect(panel.getByText(reason)).toBeVisible();
await expect(page.locator('.rp-table [data-key="c-0002"]')).toHaveCount(1);
});
diff --git a/src/features/connections/Connections.tsx b/src/features/connections/Connections.tsx
index f86876d5..3f0633cd 100644
--- a/src/features/connections/Connections.tsx
+++ b/src/features/connections/Connections.tsx
@@ -1,4 +1,5 @@
import {
+ ActionHelp,
Badge,
Button,
ConfirmButton,
@@ -120,9 +121,11 @@ export function Connections(props: PageProps) {
{cur.source && }
{vm.canClose && cur.closable && (
-
+
+
+
)}
diff --git a/src/features/connections/view.ts b/src/features/connections/view.ts
index 774150bc..3fa98093 100644
--- a/src/features/connections/view.ts
+++ b/src/features/connections/view.ts
@@ -360,6 +360,8 @@ export function connectionDetail(
: null,
source: current.src ? (sourceIp(current.src) ?? current.src) : null,
closable: current.state === 'active' || current.state === 'dialing' || current.state === 'routing',
+ // An ebpf-only observation is kernel-forwarded: the backend has no userspace transport to cancel.
+ closeReason: current.observed_by === 'ebpf' ? t('conn.notClosable') : null,
stateHelp: connectionStateHelp(current.state, t)
}
: null;