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.
Python artificial-intelligencedagdata-sciencedata-visualizationdataflowdeveloper-toolsmachine-learningnotebookspipelinepythonreactivesqlweb-app
improve: temporarily show code (#2504)
Akshay Agrawal68bfd9d0dfd4
diff --git a/frontend/src/components/editor/cell/code/cell-editor.tsx b/frontend/src/components/editor/cell/code/cell-editor.tsxindex 0ea2383831..4aeb1503a9 100644--- a/frontend/src/components/editor/cell/code/cell-editor.tsx+++ b/frontend/src/components/editor/cell/code/cell-editor.tsx@@ -325,12 +325,15 @@ const CellEditorInternal = ({};}, [editorViewRef]);- const showCode = async () => {+ const temporarilyShowCode = async () => {if (hidden) {- await saveCellConfig({ configs: { [cellId]: { hide_code: false } } });updateCellConfig({ cellId, config: { hide_code: false } });- // Focus on the editor vieweditorViewRef.current?.focus();+ editorViewRef.current?.contentDOM.addEventListener(+ "blur",+ () => updateCellConfig({ cellId, config: { hide_code: true } }),+ { once: true },+ );}};@@ -369,7 +372,7 @@ const CellEditorInternal = ({className="relative w-full"onFocus={() => setLastFocusedCellId(cellId)}>- {hidden && <HideCodeButton onClick={showCode} />}+ {hidden && <HideCodeButton onClick={temporarilyShowCode} />}<CellCodeMirrorEditorclassName={cn(hidden && "opacity-20 h-8 overflow-hidden")}editorView={editorViewRef.current}