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.

fix: delete from kernel when deleting using shift+delete (#4181)

Myles Scolnickcb85243ff9ad
diff --git a/frontend/src/components/editor/cell/code/cell-editor.tsx b/frontend/src/components/editor/cell/code/cell-editor.tsx
index d9b3fd9cbe..d827103eac 100644
--- a/frontend/src/components/editor/cell/code/cell-editor.tsx
+++ b/frontend/src/components/editor/cell/code/cell-editor.tsx
@@ -36,6 +36,7 @@ import { connectionAtom } from "@/core/network/connection";
import { WebSocketState } from "@/core/websocket/types";
import { realTimeCollaboration } from "@/core/codemirror/rtc/extension";
import { store } from "@/core/state/jotai";
+import { useDeleteCellCallback } from "../useDeleteCell";
export interface CellEditorProps
extends Pick<CellRuntimeState, "status">,
@@ -91,6 +92,7 @@ const CellEditorInternal = ({
}: CellEditorProps) => {
const [aiCompletionCell, setAiCompletionCell] = useAtom(aiCompletionCellAtom);
const setLastFocusedCellId = useSetLastFocusedCellId();
+ const deleteCell = useDeleteCellCallback();
const loading = status === "running" || status === "queued";
const cellActions = useCellActions();
@@ -104,7 +106,7 @@ const CellEditorInternal = ({
return false;
}
- cellActions.deleteCell({ cellId });
+ deleteCell({ cellId });
return true;
});