diff --git a/src/components/layout/connections-section.tsx b/src/components/layout/connections-section.tsx
index f84d42f..c7c2572 100644
--- a/src/components/layout/connections-section.tsx
+++ b/src/components/layout/connections-section.tsx
@@ -24,6 +24,7 @@ type GroupBy = "edge_type" | "node_type"
export function ConnectionsSection({ nodeRefId, schemas, currentNode, onNavigate }: ConnectionsSectionProps) {
const [groupBy, setGroupBy] = useState("edge_type")
const [confirmingDelete, setConfirmingDelete] = useState(null)
+ const [deleteError, setDeleteError] = useState<{ edgeRefId: string; message: string } | null>(null)
const nodes = useGraphStore((s) => s.nodes)
const edges = useGraphStore((s) => s.edges)
const removeEdge = useGraphStore((s) => s.removeEdge)
@@ -72,11 +73,13 @@ export function ConnectionsSection({ nodeRefId, schemas, currentNode, onNavigate
if (!isAdmin) return
try {
await deleteEdge(edgeRefId)
+ removeEdge(edgeRefId)
+ setConfirmingDelete(null)
+ setDeleteError(null)
} catch {
- // Best-effort — remove locally regardless
+ setConfirmingDelete(null)
+ setDeleteError({ edgeRefId, message: "Could not remove connection. Please try again." })
}
- removeEdge(edgeRefId)
- setConfirmingDelete(null)
}
return (
@@ -134,51 +137,64 @@ export function ConnectionsSection({ nodeRefId, schemas, currentNode, onNavigate
{conns.map((conn, i) => {
const isConfirming = confirmingDelete === conn.edge_ref_id
+ const rowError =
+ conn.edge_ref_id !== undefined && deleteError?.edgeRefId === conn.edge_ref_id
+ ? deleteError.message
+ : null
return (
-
-