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.

improvement: default show code in static notebooks (#712)

Myles Scolnick9350b6e67801
diff --git a/frontend/src/components/editor/renderers/vertical-layout/vertical-layout.tsx b/frontend/src/components/editor/renderers/vertical-layout/vertical-layout.tsx
index 3aeb6d2e08..3692a1e326 100644
--- a/frontend/src/components/editor/renderers/vertical-layout/vertical-layout.tsx
+++ b/frontend/src/components/editor/renderers/vertical-layout/vertical-layout.tsx
@@ -24,7 +24,10 @@ const VerticalLayoutRenderer: React.FC<VerticalLayoutProps> = ({
mode,
}) => {
const { invisible } = useDelayVisibility(cells.length, mode);
- const [showCode, setShowCode] = useState(false);
+ const [showCode, setShowCode] = useState(() => {
+ // Default to showing code if the notebook is static
+ return isStaticNotebook();
+ });
// Show code if there is at least one cell with code
const canShowCode = mode === "read" && cells.some((cell) => cell.code);
return (
diff --git a/frontend/src/css/Cell.css b/frontend/src/css/Cell.css
index f8d8ff804d..425c2cddf6 100644
--- a/frontend/src/css/Cell.css
+++ b/frontend/src/css/Cell.css
@@ -23,6 +23,10 @@
outline: none;
}
+ &:focus-within {
+ z-index: 10;
+ }
+
/* Interactive */
&.interactive {
/* Only restrain output length in edit mode. */
diff --git a/frontend/src/css/index.css b/frontend/src/css/index.css
index c8b4400c92..4e8931bba2 100644
--- a/frontend/src/css/index.css
+++ b/frontend/src/css/index.css
@@ -21,7 +21,6 @@ body {
-moz-osx-font-smoothing: grayscale;
}
-body,
#root {
width: 100%;
display: flex;