Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

send delete cell network request in cell action button (#1017)

Akshay Agrawal204e810bfd67
diff --git a/frontend/src/components/editor/actions/useCellActionButton.tsx b/frontend/src/components/editor/actions/useCellActionButton.tsx
index b44bbc27e9..39054da87f 100644
--- a/frontend/src/components/editor/actions/useCellActionButton.tsx
+++ b/frontend/src/components/editor/actions/useCellActionButton.tsx
@@ -1,4 +1,5 @@
/* Copyright 2024 Marimo. All rights reserved. */
+import { sendDeleteCell } from "@/core/network/requests";
import { downloadCellOutput } from "@/components/export/export-output-button";
import { Switch } from "@/components/ui/switch";
import { formatEditorViews } from "@/core/codemirror/format";
@@ -262,7 +263,10 @@ export function useCellActionButtons({ cell }: Props) {
label: "Delete",
variant: "danger",
icon: <Trash2Icon size={13} strokeWidth={1.5} />,
- handle: () => deleteCell({ cellId }),
+ handle: async () => {
+ await sendDeleteCell(cellId);
+ deleteCell({ cellId });
+ },
},
],
];